Archive: easiest way to share info between installer and uninstaller?


easiest way to share info between installer and uninstaller?
Im building an installer for a web application. This installer will be used for many of our different web applications because there installed the same way. Everytime the user installs one of our web apps it will add another entry in the add/remove programs in the control panel. So in the install i have these lines:
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mysoftwarecompany$appName" "DisplayName" "GeoPrise Shell - $appName"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mysoftwarecompany$appName" "UninstallString" "$INSTDIR\$appname\uninstall.exe"

$appName is the name of application they are installing, its set by the user during installation.

During uninstall I have to call a vbs script that removes the application from IIS(web server). That script needs to know the name of the application(the value of $appName). I also have to delete the registry keys for the application and in order to do that I need to know the value of $appName again. So I thought I would just write a .nsh file with these commands and then just include them in the unistaller. But that would require me to create a .nsh file for each web app. Any ideas of how I can get the application name in the uninstaller?


you already know what $appName is in the installer, is the source of this value not just a define or something that will work in the installer aswell?


$appName is set by the user during the install. They are prompted to enter an application name that will be used to create the virtual directories and such.


Nevermind, I figured it out. I took the low tech way and just wrote the application name to a file and then read from it during uninstall.