Skip to content
⌘ NSIS Forum Archive

Variables in UNINSTALL

6 posts

HSorgYves#

Variables in UNINSTALL

Is it possible to use variables (besides $0 .. $9 and $R0 .. $R9) in the Uninstall Section?

Thanks,
Yves
Joel#
Originally posted by Joel
Yes, is possible.
OutFile "poop.exe"
Name "Poop"
Section -poop
    WriteUninstaller "$EXEDIR\\unpoop.exe" 
SectionEnd
Section "Uninstall"
    StrCpy $0 "poop"
    DetailPrint "Yes, we are in Windows tring this $0"
    DetailPrint "Now you can unpoop me, bye bye"
SectionEnd 
MSG#
Re: Variables in UNINSTALL

Originally posted by HSorgYves
Is it possible to use variables (besides $0 .. $9 and $R0 .. $R9) in the Uninstall Section?

Thanks,
Yves
OF course you can use them, but they will NOT contain the data they contained during installation. (Similarly, $INSTDIR will NOT contain the installation directory. In the uninstaller $INSTDIR contains the directory where uninstall.exe is located.)

If you want to save data, either put it in the registry or create an ini file (or some other text file).
HSorgYves#
Thanks for your quick answers. If I use WriteINIStr, will it use the folder set by SetOutPath or do I need to specify it in each line?
MSG#


Doesn't mention SetOutPath, so yeah you need to supply the full path.