Archive: Uninstaller questions...


Uninstaller questions...
I am also doing a two-in-one install. I have everything worked out (I think), except for the uninstaller. I have an uninstaller for each package, which does everything, with the exeption of being able to delete the shortcuts correctly.

Is it possible to pass information to the Uninstall section using variables? Globals don't seem to stick very well. It does seem a bit odd, as $INSTDIR works fine, but everything I define does not.

Thanks,

-Kevin


Since the variables are initialized at runtime, they're not going to be available in the uninstaller. The built in variables are automatically detected at runtime.

If you need some install data in the uninstaller, you can save that data to the registry or a file at install time, see the ReadRegStr and ReadINIStr functions.


I wound up getting this to work by parsing $INSTDIR, which seems to be magically populated.

-Kevin


The $INSTDIR populated is the default value you have given by using this command

InstallDir "XXXXXXXX"

Hence when the user changes the Installation Directory your uninstallation will fail. So the best bet is to make a registry entry and then read it back during uninstallation.


Yes, if the user changes the install dir at runtime, that will break your uninstaller (unless you disable the user from selecting a dir).


No, since the installer is two-in-one (actually about seven-in-one), the directories are fixed,and the user doesn't have the luxury of changing directories. Since I overwrite $INSTDIR (rather than using InstallDir), it seems to work fine. Much better than the alternative of having installers three levels deep.