Old 15th December 2015, 23:05   #1
jla
Junior Member
 
Join Date: Dec 2015
Posts: 10
Multiple product installers overwrite/clobber

I've got three slightly different product installers created with NSIS and HM NIS Edit Wizard that all work correctly if I only install one product on a system. If I install two or more the latter ones decide to drop stuff into the $INSTDIR of the first.

Products: Thing 1, Thing 2, Thing 3

Install just Thing 2:

$LOCALAPPDATA\Programs\Thing 2\stuff

stuff's contents are Thing 2's stuff

The same is true if I do a fresh install of just Thing 1 or just Thing 3. They go to the right $INSTDIR and with the right path.

If after installing Thing 2 I install Thing 1:

$LOCALAPPDATA\Programs\Thing 2\stuff

stuff's contents are Thing 1's stuff and $LOCALAPPDATA\Programs\Thing 1\ doesn't exist.

This is true for all installed files that share names (eg icon.ico, splash.jpg, config.ini).

When I build each of the projects the output shows the properly expanded different $INSTDIR paths and when I install only one at a time they go into the right path. They also create separate Add/Remove entries with the right names (but wrong icons) when multiply installed. When I uninstall the second and third say they've already been uninstalled.

It is as if they all partially think they are patches to the same installer or something and ignore their $INSTDIR if another "sibling" product is already installed and install to it's path instead. I tried searching for others talking about this but I think I don't know what to call it to find the answer.

NSIS 2.46 Built on Win10, install target Vista SP2 & Win7 SP1
jla is offline   Reply With Quote
Old 15th December 2015, 23:22   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
Are you using InstallDirRegKey? Try adding MessageBox mb_ok $InstDir in .onInit and in your first section to try to find out where the wrong path comes from.

NSIS does not do any kind automatic patching. You are probably using the same string in all the installers. Check your defines...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 16th December 2015, 17:55   #3
jla
Junior Member
 
Join Date: Dec 2015
Posts: 10
Thumbs up

That was it, I am using InstallDirRegKey as defined by the HM NIS Edit wizard.

All three of my installers use the same launcher name and the wizard used the App Paths key to store this, so they got the same value back to override InstallDir.

code:

!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\launcher.exe"
!define PRODUCT_UNINST_ROOT_KEY "HKCU"
...
InstallDirRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_DIR_REGKEY}" ""




For now I'm just going to not use InstallDirRegKey since I'm trying to keep the install as simple as possible. If we decide to allow the user to choose the install location I'll know to either change the saved location away from App Paths or make our launcher names unique.

Thank you!
jla is offline   Reply With Quote
Old 16th December 2015, 19:26   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
Use the path to your UninstallString value...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

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