PDA

View Full Version : How to make Product Version property match executable's version number automatically



circ905
10-29-2010, 04:14 PM
I'm using IS 2011 Professional and I have an InstallShield project with 2 executable's. How do I change the product version property in General Information of InstallShield to match one of my executable's version number. I'm doing auto builds using TFS.

Thanks in advance!!

Alpesh
10-30-2010, 07:34 PM
Hi,

You can use Automation Interface or the ISCmdBld.exe command line to do so. Basically, you will use some Windows api to query the exe version and then using Automation Interface or ISCmdBld.exe command line (-y), you will set the ProductVersion property.

I hope this helps.

Thanks!

LanceRas
11-02-2010, 04:06 PM
I use FinalBuilder and use it's actions to build the IS projects, grabbing the version numbers and passing it on to the automation building.

CodeGuru
11-16-2010, 12:35 AM
Hi,

You can use Automation Interface or the ISCmdBld.exe command line to do so. Basically, you will use some Windows api to query the exe version and then using Automation Interface or ISCmdBld.exe command line (-y), you will set the ProductVersion property.

I hope this helps.

Thanks!

Can you elaborate on how this is done using the Automation Interface?

I'm using TFS 2010 team build with Installshield integrated into my Visual Studio Solution and have found 0 information and i've been searching for weeks.

Cary R
11-16-2010, 03:01 PM
Hi There,

Let's say you want to do this via a VBScript that kicks off the build of your project after tweaking the version number of the main executable.

--Open the InstallShield Project with the ISWiProject object's "Open" method
--Grab the named feature from the ISWiFeatures collection
--Grab the named component from the ISWiComponents collection under the feature
--Grab the named file from the ISWiFiles collection under the component
--Grab the full path to the source file from the ISWiFile object's FullPath property.

--Use the Scripting.FileSystemObject's GetFileVersion method to get the Version number

--At this point, you can use WSHell.Run to kick off iscmdbld.exe, or you can assign to the ISWiProject's ProductVersion property followed by SaveProject(), and/or go through the ISWiProductConfigs / ISWiReleases collections and finally call the Build() method of the appropriate ISWiRelease object.

Sounds confusing, but you get used to it once you get the hang of everything being stored in collections that hang off of the ISWiProject object:

http://kb.flexerasoftware.com/doc/Helpnet/InstallShield2011/IHelpAutoISWiProject.htm

Hope this points you in the right direction,

Cary

CodeGuru
11-16-2010, 04:02 PM
Thanks Cary but using Installshield 2011 and TFS 2010, we shouldn't have to do it that way. Installshield advertises integration with TFS 2010.

I've tried it the integrated way using the Automation Interface as displayed here: http://community.flexerasoftware.com/showthread.php?t=195743

Using the automation interface works on my dev box, but not using TFS build.

Cary R
11-16-2010, 11:10 PM
I apologize; I didn't realize that there was more context to the problem you were describing (it must seem rather obvious, the information I posted).

In any case, my best guess as to what's happening on your TFS server is perhaps due to the user context in which the build is trying to kick off.

Perchance, is the TFS build running in the context of the SYSTEM account? I feel like I ran into something a bit like this some years back, and that was somehow the source of the issue.