Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Read Version Information from MyApp.exe (http://forums.winamp.com/showthread.php?t=234145)

fellz 27th December 2005 21:52

Read Version Information from MyApp.exe
 
Hi!

I am trying to read version information from my application's fileinfo. I want the installer to automatically show the Application's version (which is stored in MyApp.exe).

I tried it that way - without any success:

---
!include "FileFunc.nsh"
!insertmacro GetFileVersion
Section test
${GetFileVersion} "MyApp.exe" $R0
!define PRODUCT_VERSION "$R0"
SectionEnd
---

Any clues what's wrong here?

Many thanks in advance!

Chris

Afrow UK 28th December 2005 12:07

Make sure you specify a full path and not a relative one.

-Stu

fellz 28th December 2005 15:02

thanks,

i also tried using a full path before - without luck :-(
and yes, windows explorer shows the version information of the .exe - so this should be ok as well (even the my program itself reads it from the exe)

Afrow UK 28th December 2005 15:59

O.K. I see your problem I think.
Check the value of $R0 in your Section (e.g. with a MessageBox). It should be correct.

Now, the problem is that you are defining PRODUCT_VERSION as $R0. As soon as you change the value of $R0, PRODUCT_VERSION will also be changed. PRODUCT_VERSION is not a variable. It's just a constant and when you compile your installer, all instances of ${PRODUCT_VERSION} will be replaced with $R0.

The best thing to do here would be to define a PRODUCT_VERSION variable with the Var instruction, and use that instead of $R0. The PRODUCT_VERSION define will no longer be necessary.

-Stu


All times are GMT. The time now is 04:57.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.