View Single Post
Old 11th January 2012, 05:14   #1
jakc
Junior Member
 
Join Date: Sep 2011
Posts: 12
Question Problem using SetRegView

I am creating my first installer with NSIS, and learning a lot.
It is for a desktop Java application, and is 64bit only.
The installer actually exits at onInit if it detects its 32bit.

I have the below code that detects if some application (that's a 32bit native app) is already on the machine.
This code works fine, but I understand that using the Wow6432Node is not good practise, and that I should make use of SetRegView.

Existing Code:

PHP Code:
Section "Check AGS" SEC01
 call CheckAGS
 Pop $R0
 messagebox MB_OK $AGSv 
SectionEnd

;Check to see if AGS is installed, and which version.  none9.310, (10.1)
Function 
CheckAGS
        ReadRegStr 
$1 HKLM "SOFTWARE\Wow6432Node\ESRI\Server10.0\CoreRuntime" "RealVersion"
${If} $!= ""
    
StrCpy $AGSv 2
    
return
${EndIf}
ReadRegStr $1 HKLM "SOFTWARE\Wow6432Node\ESRI\ArcServer\Microsoft .NET Framework Edition" "RealVersion"
${If} $!= ""
    
StrCpy $AGSv 1
    
return
${EndIf}
StrCpy $AGSv 0 ;not found
Messagebox MB_ICONSTOP 
"No AGS installation detected."
FunctionEnd 
If I ammend this code to change:

PHP Code:
SetRegView 64
ReadRegStr 
$1 HKLM "SOFTWARE\ESRI\Server10.0\CoreRuntime" "RealVersion"
${If} $!= ""
    
StrCpy $AGSv 2
    
return
${EndIf}
ReadRegStr $1 HKLM "SOFTWARE\ESRI\ArcServer\Microsoft .NET Framework Edition" "RealVersion"
${If} $!= ""
    
StrCpy $AGSv 1
    
return
${EndIf} 
It still compiles, but always returns me a 0, indicating that its not finding the registry keys that I am expecting it to find.

Can someone point out where I am going wrong?
jakc is offline   Reply With Quote