From the Inno Setup Help:
dontcreatekey
When this flag is specified, Setup will not attempt to create the key or any value if the key did not already exist on the user's system. No error message is displayed if the key does not exist.
Typically this flag is used in combination with the
uninsdeletekey
flag, for deleting keys during uninstallation but not creating them during installation.
My program creates a registry value (of type string
) under the Current User autostart section, but only if the user explicitly does so from the settings screen.
I want that entry to be cleaned up by the uninstaller, so I added the following to my Inno Setup project:
[Registry]
Root: HKCU; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "this_is_a_test"; Flags: dontcreatekey uninsdeletevalue
However that doesn't seem to work. I feel that the dontcreatekey
flag only applies to "keys"ยน and not to "values". If so, how can I accomplish this?
(1) Assuming the "key" would be "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" (which will always exists prior to installation), and the "value" would be the entry of type string
residing inside that key.