ISWiProject Object

InstallShield 2018 » Automation Interface

Project • This information applies to the following project types:

Basic MSI
DIM
InstallScript
InstallScript MSI
InstallScript Object
Merge Module

Project-specific differences are noted where appropriate.

Note • The examples provided in the Automation Objects subsections use Visual Basic sample code, not VBScript.

ISWiProject contains the interface for opening, closing, and saving an InstallShield project file (.ism or .dim). When InstallShield is installed on your system, you can instantiate a copy of ISWiProject with the following VB and VBScript syntax:

    Set m_ISWiProject = CreateObject("IswiAutoAutomation Interface Version.ISWiProject")

To open an installation project, call the OpenProject method, as follows:

    ' Build path to the .ism file

    strFile = "C:\InstallShield 2016 Projects\Test.ism"

    m_ISWiProject.OpenProject strFile

Important • If you are using the automation interface on a 64-bit machine, you may need to load the automation interface through a 32-bit executable file. Otherwise, you may encounter an error when you instantiate a copy of ISWiProject, or any other object. For more information, see Using the Automation Interface on a 64-Bit System.

Build Status Events

The ISWiProject object raises the following status events:

Public Event ProgressIncrement(ByVal lIncrement As Long, pbCancel As Boolean)
Public Event ProgressMax(ByVal lMax As Long, pbCancel As Boolean)
Public Event StatusMessage(ByVal sMessage As String, pbCancel As Boolean)

These events are raised during the build process and provide status updates. You can set pbCancel to stop the build. For sample code that demonstrates how to use these events, see Using Build Status Events.

Many feature properties and attributes are available in the automation interface through this object’s methods, properties, and collections. The following table lists the ISWiProject Object members. Remember that some methods, properties, and collections are only available for a particular project type.

Members

ISWiProject Object Members

Name

Project

Type

Description

ActiveLanguage

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object

Read-Write Property

Gets or sets the default language of the project. Specify a single language as a language ID.

The automation interface uses the default language whenever you get or set a localizable property, such as ISWiShortcut's DisplayName. In InstallShield, localizable properties must use a string entry. If the property has a string identifier, the string that you enter for the property becomes the string entry’s value for the default language.

AddAdvancedFile

Basic MSI, InstallScript, InstallScript MSI, InstallScript Object

Method

Creates an advanced file with the specified name and (optionally) in the specified disk image in the current project.

AddAutomaticUpgradeEntry

Basic MSI, InstallScript MSI

Method

Creates a new ISWiAutomaticUpgradeEntry item and returns a handle to that object.

AddComponent

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Method

Creates an ISWiComponent object in the current project.

AddCustomAction

Basic MSI, InstallScript MSI

Method

Creates an ISWiCustomAction object in the current project.

AddFeature

Basic MSI, InstallScript, InstallScript MSI

Method

Creates an ISWiFeature object in the current project.

AddLanguage

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Method

Adds a language to the current project.

AddPathVariable

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Method

Adds a path variable to the current project.

AddProductConfig

Basic MSI, InstallScript MSI

Method

Creates an ISWiProductConfig object in the current project.

AddProperty

Basic MSI, InstallScript MSI

Method

Creates a new ISWiProperty item and returns a handle to that object.

AddSetupFile

Basic MSI, InstallScript, InstallScript MSI, InstallScript Object

Method

Creates a support file with the specified name in the current project.

AddSetupType

InstallScript, InstallScript Object

Method

Creates a setup type with the specified name in the current project.

AddSqlServerConnection

Basic MSI, DIM, InstallScript, InstallScript MSI

Method

Adds a new server connection to the current project.

AddUpgradeTableEntry

Basic MSI, InstallScript MSI

Method

Creates a new ISWiUpgradeTableEntry item and returns a handle to that object.

AdminExecuteSequence

Basic MSI, InstallScript MSI

Read-only Property

Returns an ISWiSequence collection representing the Administration Execute sequence in the current project.

AdminUISequence

Basic MSI, InstallScript MSI

Read-only Property

Returns an ISWiSequence collection representing the Administration User Interface sequence in the current project.

AdvtExecuteSequence

Basic MSI, InstallScript MSI

Read-only Property

Returns an ISWiSequence collection representing the Advertisement Execute sequence in the current project.

AdvtUISequence

Basic MSI, InstallScript MSI

Read-only Property

Returns an ISWiSequence collection representing the Advertisement User Interface sequence in the current project. (Note that validation rule ICE78 requires the Advertisement User Interface sequence to be empty. For more information, see ICEs.)

BuildPatchConfiguration

Basic MSI, InstallScript MSI

Method

Calling this method builds the patch configuration identified by the strPatchConfiguration variable. This action has the same effect as right-clicking on a patch configuration in the Patch Design view and then selecting 'Build Patch'.

BuildPCPFile

Basic MSI, InstallScript MSI

Method

Builds a patch package based on a .pcp file.

CloseProject

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Method

Closes an InstallShield installation project.

CompanyName

Basic MSI, InstallScript, InstallScript MSI

Read-Write Property

Specifies the company name.

Project • In Basic MSI and InstallScript MSI projects, this property corresponds with the Publisher setting in the General Information view.

In InstallScript projects, this property corresponds with the Company Name setting in the General Information view.

CompanyPhone

Basic MSI, InstallScript, InstallScript MSI

Read-Write Property

Specifies the phone number that you would like end users to call for technical support. This phone number is displayed on the Support Information dialog of Add or Remove Programs.

This property corresponds with the Support Phone Number setting in the General Information view.

CompanyURL

Basic MSI, InstallScript, InstallScript MSI

Read-Write Property

Specifies the URL that you would like end users to visit for technical support. This URL is used as a hyperlink on the Support Information dialog of Add or Remove Programs.

This property corresponds with the Publisher/Product URL setting in the General Information view.

CreatePatch

Basic MSI, InstallScript MSI

Method

Caution • The CreatePatch method is deprecated for new development. It has been replaced with the BuildPCPFile and BuildPatchConfiguration methods.

CreateProject

Basic MSI, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Method

Creates a new project file (.ism or .dim).

DeleteAdvancedFile

Basic MSI, InstallScript, InstallScript MSI, InstallScript Object

Method

Deletes the specified advanced file from the current project.

DeleteComponent

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Method

Deletes the specified component from the project.

DeleteCustomAction

Basic MSI, InstallScript MSI

Method

Deletes an ISWiCustomAction object in the current project.

DeleteMergeModule

Basic MSI, InstallScript MSI

Method

Deletes a merge module from the current project.

DeletePathVariable

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Method

Deletes a path variable from the current project.

DeleteProductConfig

Basic MSI, InstallScript MSI

Method

Deletes an ISWiProductConfig object from the current project.

DeleteProperty

Basic MSI, InstallScript MSI

Method

Deletes a property from the Property table.

DeleteSetupFile

Basic MSI, InstallScript, InstallScript MSI, InstallScript Object

Method

Deletes the specified support file from the current project.

DeleteSetupType

InstallScript, InstallScript Object

Method

Deletes the specified setup type from the current project.

DeleteSQLConnection

Basic MSI, DIM, InstallScript, InstallScript MSI

Method

Remove a SQL Server connection from the current project.

DeselectLanguage

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Method

Deselects a language from the current project.

DotNetFrameworkPath

Basic MSI, InstallScript MSI

Read-Write Property

Specifies the path to the Microsoft .NET Framework. This parameter is optional.

EnableSwidtag

Basic MSI

Read-Write Property

Enables or disables the creation of a software identification tag for an installation. Following is sample code that disables tag creation:

pProject.EnableSwidtag = False

For more information about software tagging, see Including a Software Identification Tag for Your Product.

ExportProject

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Method

Causes the project file to use the XML representation, which is better suited for source code integration.

ExportStrings

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Method

Exports string entries to a text file.

ForceUpgrade

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Method

Upgrades the project from an earlier version of InstallShield to the current version.

GenerateGUID

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Method

Generates a new, unique GUID that is returned as a string.

ImportProject

Basic MSI

Method

Converts an .isv file (a text file kept in a source code integration program) to an InstallShield .ism project file.

Note • The .isv file format has been deprecated to version 2.x of InstallShield for Windows Installer and versions of InstallShield Developer prior to 8.x.

ImportStrings

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Method

Imports string entries from a text file.

INSTALLDIR

Basic MSI, InstallScript MSI

Read-Write Property

Sets the INSTALLDIR property for the project. A typical value is “[ProgramFilesFolder]CompanyName\ProductName”.

InstallExecuteSequence

Basic MSI, InstallScript MSI

Read-only Property

Returns an ISWiSequence collection representing the Installation Execute sequence in the current project.

InstallUISequence

Basic MSI, InstallScript MSI

Read-only Property

Returns an ISWiSequence collection representing the Installation User Interface sequence in the current project.

ISWiAdvancedFiles

Basic MSI, InstallScript, InstallScript MSI, InstallScript Object

Collection

Contains every advanced file (as an ISWiAdvancedFile object) in your project.

ISWiAutomaticUpgradeEntries

Basic MSI, InstallScript MSI

Collection

Returns a collection of ISWiAutomaticUpgradeEntry items. This collection presents a list of Automatic Upgrade Items as they are defined in the IDE.

ISWiComponents

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Collection

Contains all of the components in this project.

ISWiCustomActions

Basic MSI, InstallScript MSI

Collection

Contains all of the custom actions in this project.

ISWiFeatures

Basic MSI, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Collection

Contains all features’ names and their components.

ISWiLanguages

Basic MSI, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Collection

Contains all of the languages included in the current project.

ISWiPathVariables

Basic MSI, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Collection

Contains all of the path variables that are associated with the current project.

ISWiProductConfigs

Basic MSI, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Collection

Contains all of the product configurations in this project.

ISWiProperties

Basic MSI, DIM, InstallScript MSI, Merge Module

Collection

Contains all of the Windows Installer properties in this project.

ISWiSetupFiles

Basic MSI, InstallScript, InstallScript MSI, InstallScript Object

Collection

Contains every support file (as an ISWiSetupFile object) in your project.

ISWiSetupTypes

InstallScript, InstallScript Object

Collection

Contains every setup type (as an ISWiSetupType object) in your project.

ISWiSISProperties

Basic MSI, DIM, InstallScript MSI, Merge Module

Collection

Contains all of the Summary Information Stream properties in this project.

ISWiSQLConnections

Basic MSI, DIM, InstallScript, InstallScript MSI

Collection

Contains all of the SQL Server connections in the current project.

ISWiUpgradeTableEntries

Basic MSI, InstallScript MSI

Collection

Returns a collection of ISWiUpgradeTableEntry items. This collection presents a list of static major upgrade items, as defined in the IDE.

MergeModuleSearchPath

Basic MSI, InstallScript MSI

Read-Write Property

Specifies one or more comma-delimited folders that contain the merge module (.msm) files referenced by your project.

Note • If you plan to use the ISWiRelease.Build method, you should set this property.

MinimumTargetDotNetVersion

Basic MSI, InstallScript MSI

Read-Write Property

Specifies the minimum version of the .NET Framework that the installation requires on the target system. This parameter is optional. The default is the latest version of the .NET Framework the InstallShield interface supports.

MinimumTargetMSIVersion

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

Specifies the minimum version of Windows Installer that the installation requires on the target system. This parameter is optional. The default is the latest version of Windows Installer that the InstallShield interface supports.

ModuleID and ModuleIDGUID

Merge Module

Read-Write String Properties

These properties are used only with merge module projects. Every merge module has a record in the ModuleSignature table. The ModuleID field of the ModuleSignature table is composed of two sections: ModuleID.ModuleIDGUID.

For example, for a ModuleID value of IDID.019880FB_04F2_4D4B_99C9_9A0A12185229, the ModuleID and ModuleIDGUID properties of the ISWiProject object enable the following:

The ModuleID property gets or sets IDID.
The ModuleIDGUID property gets or sets 019880FB_04F2_4D4B_99C9_9A0A12185229.

OnUpgrade

Basic MSI, InstallScript MSI

Read-Write Property

Gets or sets the value for the Small/Minor/Upgrade Settings options on the Common tab in the Upgrades view. This property lets you specify whether you want end users to be prompted before proceeding with the upgrade. A Setup.exe setup launcher is required for this functionality. Available options are:

eouPrompt (1)— Prompt.
eouUpgrade (2)—Do not prompt the end user; just install the upgrade.
eouNoOp (0)—Disable any prompts. Your installation should detect the upgrade scenario and run the installation in upgrade mode.

OpenProject

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Method

Opens an InstallShield installation project file (.ism or .dim).

This method fails if the project is open in the InstallShield user interface.

PackageCode

Basic MSI, InstallScript MSI

Read-Write Property

Gets or sets the package code as a string GUID. The GUID must be surrounded by braces—{12345678-1234-1234-1234-1234567890AB}, for example.

ProductCode

Basic MSI, InstallScript, InstallScript MSI, InstallScript Object

Read-Write Property

Gets or sets the product code as a string GUID. The GUID must be surrounded by braces—{12345678-1234-1234-1234-1234567890AB}, for example.

This property is not available for merge module projects.

ProductName

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Read-Write Property

Gets or sets the product name.

ProductVersion

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Read-Write Property

Contains the version number of the project as a string.

RemoveFeature

Basic MSI, InstallScript, InstallScript MSI, InstallScript Object

Method

Deletes a feature from the project.

SaveProject

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Method

Saves an InstallShield installation project.

SelfRegistrationMethod

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

Specifies the self-registration method that should be used for files that are designated as self-registering. Valid options are:

esrISSelfReg (0)—Use the InstallShield self-registration table (ISSelfReg) for all self-registering files.
esrSelfReg (1)—Use the Windows Installer self-registration table (SelfReg) for all self-registering files.

SkipUpgradeValidators

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

Enables you to skip the upgrade validators that normally run at the end of the build.

SwidtagProperty

Basic MSI

Read-Write Property

Gets or sets value for the software identification tag settings in the General Information view. This property takes one of the following options for the first parameter:

eswtpUniqueId (0)—This parameter specifies the value for the Unique ID setting in the General Information view.
eswtpTagCreatorName (2)—This parameter specifies the value for the Tag Creator setting in the General Information view.
eswtpTagCreatorRegid (3)—This parameter specifies the value for the Tag Creator ID setting in the General Information view.
eswtpSfwCreatorName (4)—This parameter specifies the value for the Software Creator setting in the General Information view.
eswtpSfwCreatorRegid (5)—This parameter specifies the value for the Software Creator ID setting in the General Information view.
eswtpSfwLicensorName (6)—This parameter specifies the value for the Software Licensor setting in the General Information view.
eswtpSfwLicensorRegid (7)—This parameter specifies the value for the Software Licensor ID setting in the General Information view.
eswtpEntitlementRequired (8)—This parameter specifies whether your product requires users to have a corresponding software entitlement in order for software reconciliation to be considered successful.

Following is sample code that uses this property:

pProject.SwidtagProperty(eswtpTagCreatorRegid) = "regid.1986-12.com.mycompany"

UpgradeCode

Basic MSI, InstallScript MSI

Read-Write Property

Gets or sets the Upgrade Code property as a string GUID. The GUID must be surrounded by braces—{12345678-1234-1234-1234-1234567890AB}, for example.

This property is not available for merge module projects.

UseXMLProjectFormat

Basic MSI, DIM, InstallScript, InstallScript MSI, InstallScript Object, Merge Module

Read-Write Boolean Property

Specifies whether the project file should use the XML file format.