This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: How to set Product Version automatically using AssemblyInfo
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 26, 2018
03:46 AM
How to set Product Version automatically using AssemblyInfo
I'm using InstallShield 2015 Limited Edition in Visual Studio 2015.
I would like that when building SingleImage setup releases, the Product Version in General Information (see image) is set to the version given in AssemblyInfo.cs in the main project. Is this possible? If so, how?
I would like that when building SingleImage setup releases, the Product Version in General Information (see image) is set to the version given in AssemblyInfo.cs in the main project. Is this possible? If so, how?
(7) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 26, 2018
12:19 PM
I suppose there a lots of ways to do it depending on your build environment.
How are you changing your Assembly Info file?
What I do in a TFS environment for InstallScript MSI projects and Suite projects is have TFS set the build number automatically in the build definition.
Pass that x.y.BuildNumber.0 as a parameter to a prebuild script which uses TF.EXE to do checkin/checkout programatically. Have that script change any files that need to be changed.
1. For CommonAssemblyInfo .cs & .vb files Checkout file/Change version/Checkin file
2. For each ISM file: Checkout file/Change version/Checkin file (Search for and change the line that contains the string "ProductVersion"). Probably different for Basic MSI project.
3. For .ISSUITE file: Checkout file/Change version/Checkin file ( Search for and change the line that contains the string "")
The version number is changed in the source so if you do manual builds it is still at that version (advantage or disadvantage... depending on your perspective).
It is not a simple matter but it can be done.
How are you changing your Assembly Info file?
What I do in a TFS environment for InstallScript MSI projects and Suite projects is have TFS set the build number automatically in the build definition.
Pass that x.y.BuildNumber.0 as a parameter to a prebuild script which uses TF.EXE to do checkin/checkout programatically. Have that script change any files that need to be changed.
1. For CommonAssemblyInfo .cs & .vb files Checkout file/Change version/Checkin file
2. For each ISM file: Checkout file/Change version/Checkin file (Search for and change the line that contains the string "
3. For .ISSUITE file: Checkout file/Change version/Checkin file ( Search for and change the line that contains the string "
The version number is changed in the source so if you do manual builds it is still at that version (advantage or disadvantage... depending on your perspective).
It is not a simple matter but it can be done.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 16, 2018
06:09 AM
rguggisberg wrote:
I suppose there a lots of ways to do it depending on your build environment.
How are you changing your Assembly Info file?
What I do in a TFS environment for InstallScript MSI projects and Suite projects is have TFS set the build number automatically in the build definition.
Pass that x.y.BuildNumber.0 as a parameter to a prebuild script which uses TF.EXE to do checkin/checkout programatically. Have that script change any files that need to be changed.
1. For CommonAssemblyInfo .cs & .vb files Checkout file/Change version/Checkin file
2. For each ISM file: Checkout file/Change version/Checkin file (Search for and change the line that contains the string "ProductVersion"). Probably different for Basic MSI project.
3. For .ISSUITE file: Checkout file/Change version/Checkin file ( Search for and change the line that contains the string "")
The version number is changed in the source so if you do manual builds it is still at that version (advantage or disadvantage... depending on your perspective).
It is not a simple matter but it can be done.
I apologize for not getting back to you earlier.
My environment is very basic. I use the extension Automatic Versions to automatically increment version number attributes in AssemblyInfo.cs when building the main project.
And I set the same version number to AssemblyVersion and AssemblyFileVersion attributes.
I don't build the InstallShield setup project unless I want to build the installer. What I'd like is if it's possible to set a pre-build script or something on the setup project, that copies the version number from AssemblyInfo.cs and sets to the setup configuration prior to building the installer.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 16, 2018
01:43 PM
What type of project(s)?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 16, 2018
01:48 PM
rguggisberg wrote:
What type of project(s)?
C# WPF desktop application, using .NET version 4.6.1.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 16, 2018
02:44 PM
What type if InstallShield projects? InstallScriptMSI, Basic MSI, Suite?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 17, 2018
03:24 AM
rguggisberg wrote:
What type if InstallShield projects? InstallScriptMSI, Basic MSI, Suite?
To be honest, I'm not sure. I have just added a 'InstallShield Limited Edition Project' project to the Visual Studio 2015 solution. And when building a 'SingleImage' build, the output is a 'setup.exe' file. I'm adding a screen shot from the General Information view. Can you see from here what kind of InstallShield project? If not, how can I find out what kind of InstallShield project this is?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 17, 2018
08:00 AM
Can't tell project type from that. Oh well... just do this.
1. Make a copy of your .ism file
2. Edit .ism file with Notepad.
3. Search for the line that contains the string "ProductVersion" (You will only find that for InstallScript MSI projects.)
4. If you find that string, change the version,save the file and build. You should see version change.
5. Now you know what to do. Create a prebuild script that gets the version number from your AssemblyInfo file and replace the string in the ism file.
If you have a Basic MSI project you won't find the string. I would need to do some research if that is the case. Send me a private email if you want help with that.
1. Make a copy of your .ism file
2. Edit .ism file with Notepad.
3. Search for the line that contains the string "
4. If you find that string, change the version,save the file and build. You should see version change.
5. Now you know what to do. Create a prebuild script that gets the version number from your AssemblyInfo file and replace the string in the ism file.
If you have a Basic MSI project you won't find the string. I would need to do some research if that is the case. Send me a private email if you want help with that.