Skip to content
⌘ NSIS Forum Archive

Uninstall cant write to Var(s) or Read from Registry???

5 posts

vmsgman#

Uninstall cant write to Var(s) or Read from Registry???

I found somewhere in the docs or forum that you should use the registry if you are creating the Uninstall file in a different directory than the Install Directory.

But the code below still does not seem to work. Any ideas?

Thx for you help! Greg


Section "Uninstall"

ReadRegStr $insDir HKLM "Software\Paxscan\Imaging Systems\Imagers\$serNum" "instdir" ; Install Directory
ReadRegStr $uniFil HKLM "Software\Paxscan\Imaging Systems\Imagers\$serNum" "unifile" ; Uninstall File

MessageBox MB_OK $insDir ; The message box shows nothing?

RMDir /r $insDir

DeleteRegKey HKLM "Software\Paxscan\Imaging Systems\Imagers\$serNum"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$serNum"
; These seem to work fine !

Delete $uniFil ; Since $uniFil is "" this does not work

SectionEnd
goldy1064#
Are your variables declared first?

Var insDir
Var uniFil

Section "Uninstall"
...
SEctionEnd
vmsgman#
Yes, they are declared first up before any sections. Like so ...
;-----------------------
;Variables

Var rcpExists
Var snPath
Var serNum
Var uniDir
Var uniFil
Var insDir

.... All the other stuff sections then Uninstall is the last section

Greg
kichik#
Are you sure that registry key really contains what you're looking for? Did you write it in the installer? Is $serNum properly initialized? Where did you get $serNum from?
vmsgman#
I guess that they are not properly initialized in the Uninstaller section. They were earlier in the script. I think I just thought of a workaround as the serial number is also available in the registry. Thanks for your prompt help.

Greg