zackbuffo
23rd September 2011 11:17 UTC
Any instructions not allowed in Uninstall Section?
Hi,
I set the Variable $path (with /GLOBAL) in Section "Install". Can I use it in Section "Uninstall" with.
RMDir /r "$path"
It didn't work, so I tried to read it again from an .ini file in the "Uninstall" Section before deleting all the directories, but that didn't work either.
ReadINIStr $path $INSTDIR\Setup.ini SOME PATH
Are any instructions not allowed in "Uninstall" Section?
MSG
23rd September 2011 11:24 UTC
No, all instructions are valid both in installer and uninstaller. Variables are however NOT shared. Even $INSTDIR isn't shared: In the uninstaller, $INSTDIR simply contains the directory where the uninstaller was launched from. (This is why you should always verify it before deleting $INSTDIR\*.* /r . Some joker might've put your uninstaller in c:\Windows, or c:\Program Files.)
If your readini is failing, either the path to the ini file is incorrect or its contents are messed up. Or you're calling the readinistr command incorrectly. I suggest adding a messagebox in front of it to see what path it's trying to read.
zackbuffo
23rd September 2011 12:00 UTC
Thanx. I solved it with your help. I simply put the path in $0. Missing declarartion of $unpath in Section "Uninstall" was the issue.