Old 29th March 2011, 15:39   #1
sproket
Junior Member
 
Join Date: Apr 2006
Posts: 4
Question 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
sproket is offline   Reply With Quote
Old 29th March 2011, 17:12   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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.
Afrow UK is offline   Reply With Quote
Old 29th March 2011, 19:22   #3
sproket
Junior Member
 
Join Date: Apr 2006
Posts: 4
Thanks. That's what I thought. I would be nice if the uninstaller kept the variables.
sproket is offline   Reply With Quote
Old 30th March 2011, 08:01   #4
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
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.
MSG is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
uninstaller

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump