<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nsis.sourceforge.io/mediawiki/index.php?action=history&amp;feed=atom&amp;title=GetDLLVersionLocal_as_define</id>
	<title>GetDLLVersionLocal as define - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nsis.sourceforge.io/mediawiki/index.php?action=history&amp;feed=atom&amp;title=GetDLLVersionLocal_as_define"/>
	<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=GetDLLVersionLocal_as_define&amp;action=history"/>
	<updated>2026-08-13T10:51:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=GetDLLVersionLocal_as_define&amp;diff=17977&amp;oldid=prev</id>
		<title>Anders: Created page with &#039;{{PageAuthor|Anders}}   GetDLLVersionLocal only gives you two packed 32bit numbers, but sometimes you might need the unpacked numbers at compile time. This is where this ugly thi…&#039;</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=GetDLLVersionLocal_as_define&amp;diff=17977&amp;oldid=prev"/>
		<updated>2010-01-03T03:12:55Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;{{PageAuthor|Anders}}   GetDLLVersionLocal only gives you two packed 32bit numbers, but sometimes you might need the unpacked numbers at compile time. This is where this ugly thi…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{PageAuthor|Anders}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GetDLLVersionLocal only gives you two packed 32bit numbers, but sometimes you might need the unpacked numbers at compile time. This is where this ugly thing comes in.&lt;br /&gt;
&lt;br /&gt;
==The macro==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
!macro GetPEVersionLocal file defbase&lt;br /&gt;
!verbose push&lt;br /&gt;
!verbose 2&lt;br /&gt;
!tempfile GetPEVersionLocal_nsi&lt;br /&gt;
!tempfile GetPEVersionLocal_exe&lt;br /&gt;
!define GetPEVersionLocal_doll &amp;quot;$&amp;quot;&lt;br /&gt;
!appendfile &amp;quot;${GetPEVersionLocal_nsi}&amp;quot; &amp;#039;SilentInstall silent$\nRequestExecutionLevel user$\nOutFile &amp;quot;${GetPEVersionLocal_exe}&amp;quot;$\nPage instfiles$\nSection&amp;#039;&lt;br /&gt;
!appendfile &amp;quot;${GetPEVersionLocal_nsi}&amp;quot; &amp;#039;$\nFileOpen $0 &amp;quot;${GetPEVersionLocal_nsi}&amp;quot; w$\nGetDllVersion &amp;quot;${file}&amp;quot; $R0 $R1$\nIntOp $R2 $R0 / 0x00010000$\nIntOp $R3 $R0 &amp;amp; 0x0000FFFF$\nIntOp $R4 $R1 / 0x00010000$\nIntOp $R5 $R1 &amp;amp; 0x0000FFFF&amp;#039;&lt;br /&gt;
!appendfile &amp;quot;${GetPEVersionLocal_nsi}&amp;quot; &amp;#039;$\nFileWrite $0 &amp;quot;!define ${defbase}_1 $R2${GetPEVersionLocal_doll}\n&amp;quot;$\nFileWrite $0 &amp;quot;!define ${defbase}_2 $R3${GetPEVersionLocal_doll}\n&amp;quot;$\nFileWrite $0 &amp;quot;!define ${defbase}_3 $R4${GetPEVersionLocal_doll}\n&amp;quot;$\nFileWrite $0 &amp;quot;!define ${defbase}_4 $R5${GetPEVersionLocal_doll}\n&amp;quot;$\nFileClose $0$\nSectionEnd&amp;#039;&lt;br /&gt;
!system &amp;#039;&amp;quot;${NSISDIR}\makensis&amp;quot; /V2 &amp;quot;${GetPEVersionLocal_nsi}&amp;quot;&amp;#039; = 0&lt;br /&gt;
!system &amp;#039;&amp;quot;${GetPEVersionLocal_exe}&amp;quot;&amp;#039; = 0&lt;br /&gt;
!include &amp;quot;${GetPEVersionLocal_nsi}&amp;quot;&lt;br /&gt;
!delfile &amp;quot;${GetPEVersionLocal_nsi}&amp;quot;&lt;br /&gt;
!delfile &amp;quot;${GetPEVersionLocal_exe}&amp;quot;&lt;br /&gt;
!undef GetPEVersionLocal_nsi&lt;br /&gt;
!undef GetPEVersionLocal_exe&lt;br /&gt;
!undef GetPEVersionLocal_doll&lt;br /&gt;
!verbose pop&lt;br /&gt;
!macroend&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example usage==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
!insertmacro GetPEVersionLocal &amp;quot;$%windir%\system32\kernel32.dll&amp;quot; myver&lt;br /&gt;
Outfile &amp;quot;$%temp%\hello ${myver_1}.${myver_2}.${myver_3}.${myver_4}.exe&amp;quot;&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Version Manipulation Functions]]&lt;/div&gt;</summary>
		<author><name>Anders</name></author>
	</entry>
</feed>