WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Create installer version at runtime
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
kiplingw
Junior Member

Registered: Nov 2004
From:

Create installer version at runtime

Greetings everyone,

I would like to set my installer's version information at compile time based on the version number of another executable. GetDllVersionLocal unfortunately can only be called inside a function at runtime. I would like to do this without creating a seperate script to invoke the main one. Is this possible? Thank you.

--
Kip

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

kiplingw is offline Old Post 02-28-2005 09:42 PM
Click Here to See the Profile for kiplingw Click here to Send kiplingw a Private Message Click Here to Email kiplingw Find more posts by kiplingw Add kiplingw to your buddy list Edit/Delete Message Reply w/Quote
Afrow UK
Moderator

Registered: Nov 2002
From: Shropshire, England

You need to compile this:

code:
OutFile "GetVersion.exe" !define File "C:\MyFile.exe" Function .onInit GetDllVersion "${File}" $R0 $R1 IntOp $R2 $R0 / 0x00010000 IntOp $R3 $R0 & 0x0000FFFF IntOp $R4 $R1 / 0x00010000 IntOp $R5 $R1 & 0x0000FFFF StrCpy $R1 "$R2.$R3.$R4.$R5" FileOpen $R0 "$EXEDIR\Version.txt" w FileWrite $R0 '!echo "${File} version: $R1"$\r$\n!define Version "$R1"' FileClose $R0 Abort FunctionEnd Section SectionEnd

Make sure you change the path of C:\MyFile.exe to your EXE's path.
Put the output installer in the same place as your script, then put this at the top of your script:
code:
!system "GetVersion.exe" !include "Version.txt"


You will then have the ${Version} define available.

-Stu

__________________
afrowuk.co.uk

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

Afrow UK is offline Old Post 03-01-2005 08:09 AM
Click Here to See the Profile for Afrow UK Click here to Send Afrow UK a Private Message Click Here to Email Afrow UK Visit Afrow UK's homepage! Find more posts by Afrow UK Add Afrow UK to your buddy list Edit/Delete Message Reply w/Quote
WhiteLion
Junior Member

Registered: Oct 2003
From: There

There is URL submitted by user. I came to...

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

WhiteLion is offline Old Post 06-16-2005 04:08 PM
Click Here to See the Profile for WhiteLion Click here to Send WhiteLion a Private Message Find more posts by WhiteLion Add WhiteLion to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 08:49 PM. 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 > Create installer version at runtime
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