Page 1 of 1

how to get version from a file?

Posted: Mon Dec 11, 2006 7:30 am
by binkle
Hi,
I don't linke to set the version for the setup every time.
How can I set the version by getting it from a file(version)?

Harry

Posted: Mon Dec 11, 2006 10:00 am
by MichaelNesmith
You can use compiler variables for the product version field, but you will still need to set the version yourself before building.

Posted: Mon Dec 11, 2006 10:29 am
by binkle
Fine, but it's not possible to get a file version in windows (XP) commandline.
Or do you know how to do that in a makefile?

Other setup programs do support this very easy e.g. Innosetup:

Code: Select all

#define AppVersion GetStringFileInfo(AddBackslash(SourcePath)+"..\\MyApp.exe", PRODUCT_VERSION)
#define BuildVersion GetStringFileInfo(AddBackslash(SourcePath)+"..\\MyApp.exe", FILE_VERSION)


Greetings

Harry

Posted: Mon Dec 11, 2006 10:47 am
by binkle
Ok,
wrote my own little command line util,
but where is the setup-file-version assigned?
I don't know where/when to assign my compile variable.

Harry

Posted: Mon Dec 11, 2006 5:01 pm
by MichaelNesmith
Please read the help file topics for compiler variables - their usage is described thoroughly.

Posted: Tue Dec 12, 2006 3:30 am
by binkle
Michael,
you missed my question.
I know how to use compiler variables.
But I don't know which variable I need to override with my compiler variable to set the setup version.
I know there is the predefined variable VERSION. I suppose this is the one to be changed. But I did not find it in my MSI script.
Where/when does this variable get the value I entered in the options?
Because I need to assign my compiler variable instead.

Posted: Tue Dec 12, 2006 5:47 pm
by MichaelNesmith
I think the help also says that you can set compiler variables from the command line build tool, or the IDE Project Options window which is where you first declare them.

Posted: Wed Dec 13, 2006 3:36 am
by binkle
Micheal,
let me reformulate my question:
I need to set the predefined variable VERSION for compiling to make the setup.exe file have the fileversion I specify in commandline build.
Where should I do this?
There is no hint in the help how to do this, or can you tell me where, or paste the related part of the help.

So I need to do something like:

Code: Select all

miabuild.exe mysetup.mpr /r /b=2 /p=testPASSWORD SETUPVERSION=1.2.3"

Then I should get a setup file mysetup.exe having the fileversion 1.2.3.
When/where in the setup script do I have to assign #SETUPVERSION# to the predefined variable VERSION?

Posted: Wed Dec 13, 2006 11:33 am
by MichaelNesmith
When/where in the setup script do I have to assign #SETUPVERSION# to the predefined variable VERSION?


I don't see why its hard to see this. Enter the compiler variable where you normally type a fixed version in the IDE. There are two places you type the fixed version in the IDE, both which edit the same property. One is in the Project Options window and the other is in the Project Properties designer in the visual IDE.

I'm sorry if I wasn't verbose enough, but this really seems obvious to me, since you have already set the version once, you know where it is, and I don't see why you just didn't try to put the compiler variable in there.

Posted: Thu Dec 14, 2006 3:44 am
by binkle
It is hard to see because on entering a compiler variable you get a balloon saying "Incorrect Product version Value" – in both the Project Options window and the Project Properties in the designer. So I didn’t tried to compile.
But it works.

Thank you for your patients!

Posted: Thu Dec 14, 2006 1:53 pm
by MichaelNesmith
That's a valid issue, seems like the confusion was at least partially our fault.

Does version 7 of InstallAware support this?

Posted: Fri Jul 20, 2007 6:02 am
by binkle
Does version 7 of InstallAware support getting the setup version from a file(version)?