InstallShield 2019
Access to installation projects stored in a source control system can be achieved through a combination of command-line calls to your source control application and limited use of the InstallShield Automation Interface—which gives you command-line-type access to much of InstallShield’s functionality. Checking in, checking out, and getting the latest version of the project is handled through your source control’s command-line support, if any.
Below are two examples of how you might use this functionality. Both examples use Microsoft Visual SourceSafe as the source control application and are written using VBScript.
You can copy and paste either example into a .vbs file, change the paths so that they are valid for your environment, and run them.
Note • With earlier versions of InstallShield products, you were required to convert the source control (.isv) files to InstallShield project (.ism) files, and then back to .isv files. However, with the latest versions of InstallShield products, this is no longer necessary because you can save .ism files as text files for your source control application.
Getting the Latest Version and Building Your Installation
Const VSSFLAG_USERRONO = 1
Const VSSFLAG_TIMEMOD = 8
Const VSSFLAG_REPREPLACE = 128
Const PROJECT_SCC_INI_LOC = "\\Server\srcsafe.ini"
Const PROJECT_SCC_FOLDER = "$/MyFiles/"
Const PROJECT_SCC_BASE_NAME = "MyProject"
Const PROJECT_SCC_LOCAL_FOLDER = "C:\Project"
' Create a ref to Microsoft Visual SourceSafe
Set VSS = CreateObject("SourceSafe")
' Point to the VSS database
VSS.open PROJECT_SCC_INI_LOC
' Get the project file
Set VSSISVFile = VSS.VSSItem (PROJECT_SCC_FOLDER + PROJECT_SCC_BASE_NAME + ".ism")
VSSISVFile.Get PROJECT_SCC_LOCAL_FOLDER + PROJECT_SCC_BASE_NAME + ".ism", SSFLAG_TIMEMOD + VSSFLAG_USERRONO + VSSFLAG_REPREPLACE
'Get all remaining files
Set VSSIDTFolder = VSS.VSSItem (PROJECT_SCC_FOLDER + PROJECT_SCC_BASE_NAME)
VSSIDTFolder.LocalSpec = PROJECT_SCC_LOCAL_FOLDER + PROJECT_SCC_BASE_NAME
For Each VSSObj In VSSIDTFolder.Items(False)
VSSObj.Get , VSSFLAG_TIMEMOD + VSSFLAG_USERRONO + VSSFLAG_REPREPLACE
Next
strFileBasePath = PROJECT_SCC_LOCAL_FOLDER + PROJECT_SCC_BASE_NAME + ".ism"
strCmdLine = "ISCmdBld.exe -p """ + strFileBasePath + ".ism"""
' Build your installation
Set wshshell = CreateObject("Wscript.Shell")
RunCmdLine = wshshell.Run(strCmdLine, 1, True)
Checking Out, Making Changes, and Checking In
Const VSSFLAG_USERRONO = 1
Const VSSITEM_FILE = 1
Const PROJECT_SCC_INI_LOC = "\\Server\srcsafe.ini"
Const PROJECT_SCC_FOLDER = "$/MyFiles/"
Const PROJECT_SCC_BASE_NAME = "MyProject"
Const PROJECT_SCC_LOCAL_FOLDER = "C:\Project"
' Create a ref to Microsoft Visual SourceSafe
Set VSS = CreateObject("SourceSafe")
' Point to the VSS database
VSS.open PROJECT_SCC_INI_LOC
' Check out the project file
Set VSSISVFile = VSS.VSSItem (PROJECT_SCC_FOLDER + PROJECT_SCC_BASE_NAME + ".ism")
VSSISVFile.CheckOut , PROJECT_SCC_LOCAL_FOLDER + PROJECT_SCC_BASE_NAME + ".ism", VSSFLAG_USERRONO
'Check out all remaining files
Set VSSIDTFolder = VSS.VSSItem (PROJECT_SCC_FOLDER + PROJECT_SCC_BASE_NAME)
VSSIDTFolder.LocalSpec = PROJECT_SCC_LOCAL_FOLDER + PROJECT_SCC_BASE_NAME
For Each VSSObj In VSSIDTFolder.Items(False)
If VSSObj.Type = VSSITEM_FILE Then
VSSObj.CheckOut , , VSSFLAG_USERRONO
End If
Next
' Create a reference to the InstallShield Automation Interface
Set m_ISWiProject = CreateObject("IswiAutoAutomation Interface Version.ISWiProject")
strFileBasePath = PROJECT_SCC_LOCAL_FOLDER + PROJECT_SCC_BASE_NAME + ".ism"
' Open your project
m_ISWiProject.OpenProject strFileBasePath
' Add a feature
m_ISWiProject.AddFeature "Robofeature1"
' Save the project
m_ISWiProject.SaveProject
' Close the project
m_ISWiProject.CloseProject
' Check in the project file
Set VSSISVFile = VSS.VSSItem (PROJECT_SCC_FOLDER + PROJECT_SCC_BASE_NAME + ".ism")
VSSISVFile.CheckIn
'Check in all remaining files
Set VSSIDTFolder = VSS.VSSItem (PROJECT_SCC_FOLDER + PROJECT_SCC_BASE_NAME)
For Each VSSObj In VSSIDTFolder.Items(False)
If VSSObj.Type = VSSITEM_FILE Then
VSSObj.CheckIn "Check In Comment"
End If
Next
InstallShield 2019 Help LibraryApril 2019 |
Copyright Information | Flexera |