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: Any way to auto increment the Version Number
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
‎Jan 18, 2008
07:53 AM
Any way to auto increment the Version Number
This seams like it would be something so basic that everyone would want but I don't see it anywhere. When I build a new release I want it to automatically increment up the minor version number in case I forget to do it just like VB 6.0 does.
Does anyone know of an Installshield Plug-in or anything that does this or am I missing something here?
Does anyone know of an Installshield Plug-in or anything that does this or am I missing something here?
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 18, 2008
09:18 AM
You can use the Automation interface to modify the version number before performing a build; please see, for example, this ancient newsletter tip: http://www.installshield.com/news/newsletter/archives/0104_ipwi-automation.asp. You'll need to update the ProgID you use in CreateObject, but the idea is the same.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 18, 2008
09:21 AM
Seems like something that you'd think Installshield would let you pass in through a command line parameter, doesn't it? Unfortunately, it doesn't. We created a vbscript file to do this.
Paste this into a vbs file (we call InstallShieldVersioner2008.vbs):
----------------------------------------------------------------
If Wscript.Arguments.Count < 2 Then
Wscript.Echo "InstallShield Product Version Update Utility " & _
vbNewLine & "1st argument is the full path to the .ism file" & _
vbNewLine & "2nd argument is the version number"
Wscript.Quit 1
End If
' Create the end-user automation object
Dim ISWIProject
Set ISWIProject = CreateObject("ISWiAuto14.ISWiProject"): CheckError
' Open the project specified at the command line
ISWIProject.OpenProject Wscript.Arguments(0) : CheckError
ISWIProject.ProductVersion = Wscript.Arguments(1) : CheckError
ISWIProject.ProductCode = ISWIProject.GenerateGUID : CheckError
ISWIProject.SaveProject: CheckError
ISWIProject.CloseProject: CheckError
Set ISWIProject = Nothing
Sub CheckError()
If Err = 0 Then Exit Sub
Dim message
message = Err.Source & " " & Hex(Err) & ": " & Err.Description
Wscript.Echo message
Wscript.Quit 2
End Sub
----------------------------------------------------------------
And we have multiple vbscript files that call the above file. These files look like so:
----------------------------------------------------------------
Option Explicit
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'edit the following entries
const INSTALL_VERSION_SP = "1.1.500"
const INSTALL_FILE = "D:\Build\Source\MyProduct.ism"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
const INSTALLSHLD_PATH = "C:\Program Files\Macrovision\IS2008\System"
const INSTALL_VERSIONER = "D:\build\buildmachine\InstallShieldVersioner2008.vbs"
'call Main subroutine
Call Main()
Sub Main()
Dim objShell, CmdLine
Set objShell = WScript.CreateObject("WScript.Shell")
CmdLine = objShell.Run("cmd /C c: && """ & INSTALL_VERSIONER & """ """ & INSTALL_FILE & """ """ & INSTALL_VERSION_SP & """" , 5, true)
If (CmdLine <> 0 and CmdLine <> 2) Then
WScript.Echo "Error occurred executing Versioner against project " & INSTALL_FILE
WScript.Quit(-1)
End If
...
End Sub
----------------------------------------------------------------
Good luck!
Matt
Paste this into a vbs file (we call InstallShieldVersioner2008.vbs):
----------------------------------------------------------------
If Wscript.Arguments.Count < 2 Then
Wscript.Echo "InstallShield Product Version Update Utility " & _
vbNewLine & "1st argument is the full path to the .ism file" & _
vbNewLine & "2nd argument is the version number"
Wscript.Quit 1
End If
' Create the end-user automation object
Dim ISWIProject
Set ISWIProject = CreateObject("ISWiAuto14.ISWiProject"): CheckError
' Open the project specified at the command line
ISWIProject.OpenProject Wscript.Arguments(0) : CheckError
ISWIProject.ProductVersion = Wscript.Arguments(1) : CheckError
ISWIProject.ProductCode = ISWIProject.GenerateGUID : CheckError
ISWIProject.SaveProject: CheckError
ISWIProject.CloseProject: CheckError
Set ISWIProject = Nothing
Sub CheckError()
If Err = 0 Then Exit Sub
Dim message
message = Err.Source & " " & Hex(Err) & ": " & Err.Description
Wscript.Echo message
Wscript.Quit 2
End Sub
----------------------------------------------------------------
And we have multiple vbscript files that call the above file. These files look like so:
----------------------------------------------------------------
Option Explicit
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'edit the following entries
const INSTALL_VERSION_SP = "1.1.500"
const INSTALL_FILE = "D:\Build\Source\MyProduct.ism"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
const INSTALLSHLD_PATH = "C:\Program Files\Macrovision\IS2008\System"
const INSTALL_VERSIONER = "D:\build\buildmachine\InstallShieldVersioner2008.vbs"
'call Main subroutine
Call Main()
Sub Main()
Dim objShell, CmdLine
Set objShell = WScript.CreateObject("WScript.Shell")
CmdLine = objShell.Run("cmd /C c: && """ & INSTALL_VERSIONER & """ """ & INSTALL_FILE & """ """ & INSTALL_VERSION_SP & """" , 5, true)
If (CmdLine <> 0 and CmdLine <> 2) Then
WScript.Echo "Error occurred executing Versioner against project " & INSTALL_FILE
WScript.Quit(-1)
End If
...
End Sub
----------------------------------------------------------------
Good luck!
Matt
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 18, 2008
09:26 AM
In InstallShield 2008, IsCmdBld apparently has a new -y switch you can use to pass in a version for a particular build; auto-incrementing the version is the somewhat tricky part...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 20, 2008
08:56 PM
And if your using MSBuild you just set the $(InstallShieldProductVersion) and it'll pass it to the build enginer for you.
So easy, thank you MichaelU!
So easy, thank you MichaelU!