Archive: Uninstall Directory question

Uninstall Directory question
Is there a way to set the Uninstall Directory? To change the path that comes after "Uninstalling from:" when running an Uninstaller.exe? Something like how you can change $INSTDIR? It appears that the Uninstall Directory automatically takes the directory that Uninstall.exe is in. I want to be able to change that to somewhere else, something to the effect of StrCpy $UNINSTDIR "C:\Example", which unfortunately doesn't work :igor:

I've done a bunch of searching, and can't seem to get my phrasing correct, as I have not got one hit on this. Is it possible to do? Thanks! :up:

The variable that determines the directory is the same for both the installer and the uninstaller: $INSTDIR (although it can have different values for each). See section 4.2.2 in the manual.

You could also have a page in the uninstaller that lets the user select the directory, if that makes sense. You would certainly need to verify the directory the user selects is valid and contains your application. It would be best to avoid wildcard deletes and to delete just the specific files that you installed.

You can call Uninstall.exe with _? parameter!

For example:

Uninstall.exe "_?=C:\Example"

Note, however, that Uninstall.exe normally copies itself into the TEMP folder. Then the actuall Uninstall.exe executes the temporary copy (from TEMP folder) and terminates itself. The actual uninstall is then perfromed by the temporary copy, so the Uninstall.exe can be deleted. This does not work if you call Uninstall.exe with "_?" parameter, because then Uninstall.exe will think that it already is the temporary copy.