cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Kovalenko
Level 6

Pre-build event to increment AssemblyFileVersion

Hello,

I need to auto-increment AssemblyFileVersion before the setup project is built. In visual Studio there are pre- and post-build events. Are there analogues in IS Setup project?

PS I could use some other project that could be built the first in the solution, but I do not want to add it, because Setup project is only built on the server, while the rest development team see it as unloaded. Thus they do no need to build this additional project and modifications made by it.
Labels (1)
0 Kudos
(2) Replies
Not applicable

There are no predefined sets of functionality for prebuild and postbuild events in InstallShield. However, information on what one other member of the community got to work for him can be found in his blog. Christopher Painter is one of the more knowledgable people in the community, so while I haven't tested any of what he suggests, I imagine it will work:

http://community.macrovision.com/archive/index.php?t-168511.html
0 Kudos
Christopher_Pai
Level 16

My first question would be do you need to increment AssemblyVersion / AssemblyFileVersion or do you need to increment ProductVersion ( MSI Property ).

Normally I don't define AssemblyFileVersion, I let it just default to AssemblyVersion. The only real case where you want to increment one but not the other is when hotfixing strong named assemblies and you want costing to work properly.

ProductVersion is what you need to do to version the setup project.

I'm using MSBuild/TFS these days. For .NET projects, I use the AssemblyVersionTask and for InstallShield I use a little piece of custom code to do an XPath against my ISM XML document.

The best way I've found is to attrib all AssemblyInfo.cs files to +R before the `get` so TFS doesn't complain about writable files and then attrib them all back to -R after the get so they can be written.

Then I subscribe each individual .csproj ( or others ) to the task. This is to work around the fact that .NET prebuild events always fire whether or not the targets are actually out of date and anything even needs to be compiled.


The result is a perfect incremental build pattern that is compatible with MSI costing for minor upgrades. I've written about this patten in the past and you can find it here:

http://blog.deploymentengineering.com/2007/04/tfs-build-automation-with-vs2005-and.html
0 Kudos