Getting Version Number from Application File

Got a problem you cannot solve? Try here.
fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Getting Version Number from Application File

Postby fletcherjames » Fri Mar 17, 2006 1:12 pm

It would really be nice if we could have the Version for the setup kit extracted from one selected file in the list of source files. I'm sure that almost everyone has had the experience of pushing out a new application version, and forgetting to update the Version value for IA.

If anyone knows of how to accomplish this with current features (other than by using the automation interface in the Admin version), please let the rest of us know!
Fletcher James

CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Postby CandiceJones » Fri Mar 17, 2006 1:15 pm

Hi Fletcher!

Automation is available with Studio and above, so both Studio and Studio Admin feature it.
Candice Jones
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Postby fletcherjames » Fri Mar 17, 2006 2:41 pm

I'm a bit frustrated...

1. I just looked into the documentation for the automation, for the 1st time. Unless I'm mistaken, this only allows you to generate a setup if you're willing to program every single step from scratch, and that seem to apply both to the Win32 API style and the COM style interfaces. I had hoped that your automation interface would be more of a "document" oriented structure (a document would be a project) so that you could simply say:

Set IA = New InstallAwareApplication
Set prj = IA.Open sPathToMyProject
prj.Version = "1.0.0.121"
prj.Build

Apparently, that's not possible.

2. I also looked into whether I could simply find the text file which included the spec for the version number, so that I could modify that file, and build from the command line. I have loads of utilities which allow me to modify XML or .INI-style files, so anything which said:

[ProjectProperties]
Version=1.0.0.121

would be a breeze to deal with. Unless I'm missing something, I don't think that this approach will work either, because I couldn't find any file in the entire folder, which had an ascii version of my version number.

3. I noticed that IanM had the same request on the 15th. Certainly one quick-and-dirty solution for THIS requirement, from your end would be to add a command line parameter to msibuild:

/v=1.0.0.121
Fletcher James

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Fri Mar 17, 2006 2:55 pm

You can edit the .MPR plain text file to directly inject version information. As long as you update the line that contains the version information, and preserve the rest of the file, this approach will work.

The .MPR file is a plain text file with an ASCII representation of the version number used in your project.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Postby fletcherjames » Fri Mar 17, 2006 3:09 pm

I'm viewing this file with UltraEdit, and can't find any such info. Perhaps there's a flaw in the way I'm looking at it. I also tried a Windows search on the folder, for text ".121" (my version number), and came up empty-handed.

File Attached:

Best Authority Setup.mpr
Fletcher James

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Fri Mar 17, 2006 5:18 pm

Your version number is right there - please look near the end of the file carefully.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Postby fletcherjames » Fri Mar 17, 2006 7:53 pm

Right you are ... looking VERY carefully, I realized that there were 223 blank lines, followed by more data!
Fletcher James

fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Postby fletcherjames » Fri Mar 17, 2006 7:57 pm

By the way... is there a reliable method to figure out which line has the version number on it? I do see that it follows 2 successive GUID's, but can I count on that all of the time (and, can I be sure that 2 successive GUID's never occur in any other place in a .mpr file)??
Fletcher James

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Fri Mar 17, 2006 8:03 pm

Yes, you can count on both :)
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 196 guests