Archive: "ifempty" not working?


"ifempty" not working?
  Write to registry:


Name "test"

>OutFile "test.exe"
>ShowInstDetails show

Page instfiles

Section
WriteRegStr HKLM "Software\nsis-test" "data" "somedata"
>WriteRegStr HKLM "Software\nsis-test" "info" "someinfo"
>WriteRegDWORD HKLM "Software\nsis-test" "Value" 10
WriteRegStr HKLM "Software\nsis-test" "key" "somekey"
>SectionEnd
>
Now deleting one value and later try to remove the hole key (ifempty):

Name "test"

>OutFile "test.exe"
>ShowInstDetails show

Page instfiles

Section
DeleteRegValue HKLM "Software\nsis-test" "data"
>DeleteRegKey /ifempty HKLM "Software\nsis-test"
>SectionEnd
>
But the installer remove all the "Software\nsis-test" even still some keys...is this normal?
I'm using nsis 2.25

The documentation specifies that /ifempty relates to subkeys. So your example did have some values, but since it didn't have any subkeys, /ifempty did not prevent the key from being removed.


Oh! Yeah! :)