i was testing 3 NSIS setup files. the problem is the subsequent setup uses the previous default installation directory. but if i uninstall previous setup the next setup will use the specified installation directory.
i used HM NIS Edit to create the scripts.
Testing multiple NSIS installations
5 posts
InstallDirRegKey does this, are you using this in your scripts?
i did a search for InstallDirRegKey and this was the only one found in the search.
(i can give links to the entire three scripts?)
Galaxian Script
so if i install Galaxian first the default directory will be
C:\Program Files\Galaxian
but if i install Centipede next (without uninstalling Galaxian first) the default directory is
C:\Program Files\Galaxian
However if i uninstall Galaxian first then install Centipede the correct default directory will be displayed for Centipede
C:\Program Files\Centipede
and likewise with the other game.
the only editing i did to the script was to change the default icon after CreateShortCut for the desktop and start menu, so as you can guess i know very little.
(i can give links to the entire three scripts?)
Galaxian Script
Centipede ScriptInstallDir "$PROGRAMFILES\Galaxian"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
i have a third script somewhere as well, but i would guess it is the same since i followed the same steps in HM NIS Edit to build them.InstallDir "$PROGRAMFILES\Centipede"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
so if i install Galaxian first the default directory will be
C:\Program Files\Galaxian
but if i install Centipede next (without uninstalling Galaxian first) the default directory is
C:\Program Files\Galaxian
However if i uninstall Galaxian first then install Centipede the correct default directory will be displayed for Centipede
C:\Program Files\Centipede
and likewise with the other game.
the only editing i did to the script was to change the default icon after CreateShortCut for the desktop and start menu, so as you can guess i know very little.
[solved]
after a little searching on InstallDirRegKey i saw on a thread to put in "Install_Dir", so i edited the script to this
thanks for putting me in the right direction - because i was searching before i made this post, only i didn't even know what i was looking for. 🙂
after a little searching on InstallDirRegKey i saw on a thread to put in "Install_Dir", so i edited the script to this
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "Install_Dir"on each of my three scripts and now they install to the correct directory, regardless of what was installed before hand.thanks for putting me in the right direction - because i was searching before i made this post, only i didn't even know what i was looking for. 🙂
PRODUCT_DIR_REGKEY should be unique for each product...