Archive: Writing (Default) values in registry


Writing (Default) values in registry
Hi,

I'm new at this... I'm trying to modify an existing script that we had been using to add in file associations between our custom file extension and our application. I've done it manually in the registry to get it working and then went to do it in the script and am having problems.

The problem is... When I do it manually, I set the values, for example, DefaultIcon (Default) REG_SZ c:\icon\icon.ico ...and this works. But, when I use the nsi file, I have the following line...

WriteRegStr "HKCR" "LMS\DefaultIcon" "(Default)" "c:\icon\icon.ico"

This adds a 2nd entry into the key's folder for (Default), it doesn't replace or modify the default one that is there when the key was created. How would I just write the default value of the key?

Thank you,

Aaron


Use

WriteRegStr "HKCR" "LMS\DefaultIcon" "" "c:\icon\icon.ico"

As glory_man has pointed out, "" covers the default key name, not "(Default)" (which is just to show the default key name in regedit).

-Stu