WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > x86 and x64 InstallDirRegKey
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
sl1982
Junior Member

Registered: Nov 2009
From:

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 URL submitted by user."
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 URL submitted by user.

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.

Quick Link | Report this post to a moderator | IP: Logged

sl1982 is offline Old Post 11-06-2009 08:26 PM
Click Here to See the Profile for sl1982 Click here to Send sl1982 a Private Message Find more posts by sl1982 Add sl1982 to your buddy list Edit/Delete Message Reply w/Quote
Yathosho
Forum King

Registered: Jan 2002
From: AT-DE

might have to use SetRegView

__________________
Fossil 2002 III | VISBOT TV | NSIS Icons | PimpBot | Old Winamp Forums look?

Quick Link | Report this post to a moderator | IP: Logged

Yathosho is offline Old Post 11-06-2009 10:23 PM
Click Here to See the Profile for Yathosho Click here to Send Yathosho a Private Message Visit Yathosho's homepage! Find more posts by Yathosho Add Yathosho to your buddy list Edit/Delete Message Reply w/Quote
sl1982
Junior Member

Registered: Nov 2009
From:

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

Quick Link | Report this post to a moderator | IP: Logged

sl1982 is offline Old Post 11-06-2009 10:37 PM
Click Here to See the Profile for sl1982 Click here to Send sl1982 a Private Message Find more posts by sl1982 Add sl1982 to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 04:41 AM. Post New Thread    Post A Reply
  Last Thread   Next Thread
WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > x86 and x64 InstallDirRegKey
Show Printable Version
 | 
Email this Page
 | 
Subscribe to this Thread

Forum Jump:
 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is off
vB code is ON
Smilies are ON
[IMG] code is ON