Old 28th June 2014, 13:25   #1
freddyhard
Junior Member
 
Join Date: Jun 2014
Posts: 3
Testing multiple NSIS installations

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.
freddyhard is offline   Reply With Quote
Old 28th June 2014, 13:59   #2
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 916
InstallDirRegKey does this, are you using this in your scripts?

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 29th June 2014, 00:10   #3
freddyhard
Junior Member
 
Join Date: Jun 2014
Posts: 3
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
code:
InstallDir "$PROGRAMFILES\Galaxian"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""


Centipede Script
code:
InstallDir "$PROGRAMFILES\Centipede"
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.

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.
freddyhard is offline   Reply With Quote
Old 29th June 2014, 00:57   #4
freddyhard
Junior Member
 
Join Date: Jun 2014
Posts: 3
[solved]

after a little searching on InstallDirRegKey i saw on a thread to put in "Install_Dir", so i edited the script to this
code:
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.
freddyhard is offline   Reply With Quote
Old 29th June 2014, 09:25   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
PRODUCT_DIR_REGKEY should be unique for each product...

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