Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 17th June 2009, 17:59   #1
kihjin
Junior Member
 
Join Date: Jun 2009
Posts: 2
GetDLLVersion returning a negative release version

I'm getting back a negative release value after using GetDLLVersion.

code:

ReadRegStr $0 HKLM Software\Microsoft\.NETFramework InstallRoot
StrCpy $0 "$0\v2.0.50727\System.dll"
GetDllVersion "$0" $R0 $R1
IntOp $R2 $R0 / 0x00010000
IntOp $R3 $R0 & 0x0000FFFF
IntOp $R4 $R1 / 0x00010000
IntOp $R5 $R1 & 0x0000FFFF
MessageBox MB_OK "$R0 $R1 $R2 $R3 $R4 $R5"
IntCmpU $R4 50727 +3
MessageBox MB_OK "Not equal"
Goto +2
MessageBox MB_OK "It's equal!"



The actual version for System.dll is 2.0.50727.42.

After the call to GetDLLVersion,
code:

$R0 = 131072
$R1 = -970522582
$R2 = 2
$R3 = 0
$R4 = -14808
$R5 = 42



Notice that $R4 is negative.

Curiously enough, -14808 is the difference between 2^16-1 (65535) and 50727.

As a sanity test, I included the IntCmpU check. Following that, the "Not equal" messagebox is displayed.
kihjin is offline   Reply With Quote
Old 17th June 2009, 19:28   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
stupid nsis sign extension, try

intop $R4 $R1 >> 16
intop $R4 $R4 & 0xFFFF

IntOp $PostCount $PostCount + 1
Anders is online now   Reply With Quote
Old 17th June 2009, 19:55   #3
kihjin
Junior Member
 
Join Date: Jun 2009
Posts: 2
Oh I get it. Perfect.

Thanks Anders.
kihjin is offline   Reply With Quote
Reply
Go Back   Winamp 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