GetDllVersion Command Explained: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Added category links.)
m (Adding new author and category links.)
Line 1: Line 1:
{|align=right
{{PageAuthor|sunjammer}}
|<small>Author: [[{{ns:2}}:sunjammer|sunjammer]] ([[{{ns:3}}:sunjammer|talk]], [[{{ns:-1}}:Contributions/sunjammer|contrib]])</small>
 
|}
<br style="clear:both;">
== Description ==
== Description ==
GetDllVersion is a tricky command to get used to. It's one of the built-in commands in NSIS, I'm not sure what version it was introduced in (email me if you know). There is a download link at the bottom to a text file containing this example. v-tal's explanation went like this :-
GetDllVersion is a tricky command to get used to. It's one of the built-in commands in NSIS, I'm not sure what version it was introduced in (email me if you know). There is a download link at the bottom to a text file containing this example. v-tal's explanation went like this :-
Line 19: Line 17:
</highlight-nsis>
</highlight-nsis>


[[{{ns:14}}:Tutorials]]
[[Category:Tutorials]]

Revision as of 12:14, 24 June 2005

Author: sunjammer (talk, contrib)


Description

GetDllVersion is a tricky command to get used to. It's one of the built-in commands in NSIS, I'm not sure what version it was introduced in (email me if you know). There is a download link at the bottom to a text file containing this example. v-tal's explanation went like this :-

About numbers GetDllVersion. First 16 bit of first number is major version. Second 16 bit of first number is minor version. First 16 bit of second number is release version. Second 16 bit of second number is build version.

Example

So, try something like this:

GetDLLVersion "MyApp.exe" $R0 $R1
IntOp $R2 $R0 / 0x00010000 ; $R2 now contains major version
IntOp $R3 $R0 & 0x0000FFFF ; $R3 now contains minor version
IntOp $R4 $R1 / 0x00010000 ; $R4 now contains release
IntOp $R5 $R1 & 0x0000FFFF ; $R5 now contains build
StrCpy $0 "$R2.$R3.$R4.$R5" ; $0 now contains string like "1.2.0.192"