Old 6th November 2009, 19:26   #1
sl1982
Junior Member
 
Join Date: Nov 2009
Posts: 2
x86 and x64 InstallDirRegKey

Hey guys I am trying to create an installer for a patch for a game and I am having a problem. I am using x64.nsh to find out if the version of windows is 32 or 64 bit. Depending on which version of windows it is I need to look for the installdirregkey in a different spot of the registry. Here is the code I am trying to use but it leaves a blank value for the install directory. Any help would be appreciated


InstallDirRegKey HKLM "Software\Team Avalanche\" Install

Function .onInit

${If} ${RunningX64}
MessageBox MB_OK "running on x64"
ReadRegStr $0 HKLM "SOFTWARE\Wow6432Node\Square Soft, Inc.\Final Fantasy VII\1.00\Graphics\" Driver
ReadRegStr $1 HKLM "SOFTWARE\Wow6432Node\Square Soft, Inc.\Final Fantasy VII\" AppPath

${If} "$0" != "3"
MessageBox MB_OK "Aali's custom driver is not installed, or not installed correctly. Please re-install and

try again. To download driver go to http://forums.qhimm.com/index.php?topic=8306.0"
Abort ; causes installer to quit.
${EndIf}
${Else}
ReadRegStr $0 HKLM "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\1.00\Graphics\" Driver
ReadRegStr $1 HKLM "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\" AppPath
MessageBox MB_OK "running on x86, $0"
WriteRegStr HKLM "Software\Team Avalanche\" "Install" "$1"

${If} "$0" != "3"
MessageBox MB_OK "Aali's custom driver is not installed, or not installed correctly. Please re-install and

try again. Please re-install and try again. To download driver go to http://forums.qhimm.com/index.php?

topic=8306.0"
Abort ; causes installer to quit.
${EndIf}
${EndIf}

MessageBox MB_OK "$1"
;$INSTDIR "$1"
!define InstallDirRegKey HKLM "Software\Team Avalanche\" Install
FunctionEnd

I am thinking for some reason the installer tries to get the Install Dir before the oninit function writes the correct install directory into the registry, but I cannot figure out how to fix it.
sl1982 is offline   Reply With Quote
Old 6th November 2009, 21:23   #2
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
might have to use SetRegView
Yathosho is offline   Reply With Quote
Old 6th November 2009, 21:37   #3
sl1982
Junior Member
 
Join Date: Nov 2009
Posts: 2
Thats not really the problem. I can write to the registry fine. Its just that the installer doesnt read the key i write to the registry. Its like the order is backwards. It tries to read the key and then it writes it afterwards. I am working with the assumption that the function oninit should be the first thing that runs in the script
sl1982 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