Archive: Identifying multiple uninstallers


Identifying multiple uninstallers
I have looked through several threads and have yet to find the answer to the following.

I have multiple instances of a program and each has its own install directory with its own copy of the uninstaller. The installer has a field called "instance name" which is recorded in the registry like this:

HKLM "SOFTWARE\@vendor.name@\@product.name@ @product.version@\installs\$instance"

which works fine. This key contains the root path of the install.

I would like to uninstall the instance of the program that corresponds to the uninstaller that is executed but the Uninstall section does not retain the variable "$instance" that the user entered at install time.

Any ideas?

TIA :confused:


You need to save $instance in the registry or in a file. Variables don't get magically saved into the output uninstaller executable (although that would be cool). You could in theory write the uninstaller executable and then append the value of $instance on the end and then read it byte by byte in the uninstaller but I've not tried that. In theory it's doable as it's a common method of providing copies of an installer executable tailored to a particular user without rebuilding it. If there is some other way of getting the current instance (e.g. if it's a version number then read it from a DLL or EXE file in the current directory) then use that.


Thanks. That's what I thought. I would be nice if the uninstaller kept the variables.


Appending bytes to uninstall.exe is easy and works fine. Just make sure to add some form of error checking, because the appended bytes are not included in the uninstaller's crc check.

Edit: http://forums.winamp.com/showthread.php?t=321792#13 has an example.