ISWiComponent Object

InstallShield 2022 » 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.

ISWiComponent represents a component in the InstallShield user interface. You can retrieve a component by specifying an item in the ISWiComponents collection. The component can be one created in the IDE or as a result of calling AddComponent.

Many component attributes are available in the automation interface through this object’s methods and properties. Refer to the following table to see which methods, properties, and collections are available for your project type.

Members

ISWiComponent Object Members

Name

Project

Type

Description

AddComponentSubFolder 

InstallScript, InstallScript Object

Method

Adds a subfolder to the current ISWiComponent.

AddDynamicFileLinking 

Basic MSI, InstallScript, InstallScript MSI, Merge Module

Method

Adds a dynamic file link to the current component.

AddEnvironmentVar 

Basic MSI, InstallScript MSI, Merge Module

Method

Adds an environment variable to the current component.

AddFile 

All

Method

Adds a file to the current component.

AddRemoveFile 

Basic MSI, InstallScript MSI, Merge Module

Method

Adds a file or folder removal entry to the current component.

Attrib64BitComponent

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

Set this property to True to have the component registered as 64-bit. Setting this property to False causes the component to be registered as 32-bit. If the component is 64-bit and is replacing a 32-bit component, be sure to provide a new GUID via the GUID property.

Note that 64-bit support requires version 2.0 of the Windows Installer service.

Comments

All

Read-Write Property

Gets or sets the comments for this component.

Compressed

InstallScript, InstallScript Object

Read-Write Property

This Boolean property gets or sets the component's Compressed property, which specifies whether to compress the component's files (True) or leave them uncompressed (False) when the files are stored in a cabinet file by the release builder.

Condition

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

Contains any condition associated with the component.

Destination

All

Read-Write Property

Gets or sets the component’s destination. The following formats are valid:

(Windows Installer based projects only:) [INSTALLDIR]
(Windows Installer based projects only:) [ProgramFilesFolder]Subfolder
(InstallScript projects only:) <TARGETDIR>
(InstallScript projects only:) <WINDIR>\Subfolder
C:\FolderName

Important:Setting the Destination property for the ISWiComponent object resets the object’s SourceLocation property. Therefore, any code that sets the SourceLocation property should be placed after any code that sets the Destination property.

DeviceDriverFlags

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

This property is no longer supported.

DeviceDriverFlagsEx 

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

This property enables you to specify the flag settings for device drivers and run-time options directly from the automation layer.

DeviceDriverSetRedist 

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

This property sets the .dll used at run time for all device driver installations.

DeviceDriverUse64BitRedist

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

This property is no longer supported.

DeviceDriverUseLocalizedRedist

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

This property is no longer supported.

Difference

InstallScript, InstallScript Object

Read-Write Property

This Boolean property gets or sets the component's Difference property, which specifies whether to accept (True) or override (False) the default behavior of the media builder when building a differential media—which is to exclude a file in this component from the differential media if the same file (with the same date and time, size, and attributes) exists in each of the specified comparison media.

DotNetApplicationFile

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

To install your assembly as private, set this attribute to the FileKey of the file that contains your assembly. If this property is set to NULL, your assembly will be installed to the Global Assembly Cache.

DotNetAssembly

InstallScript, InstallScript Object

Read-Write Property

This Boolean property gets or sets the component's .NET Assembly property, which specifies whether the component's files are installed as local .NET assemblies (True) or not installed as assemblies (False).

DotNetCOMInterop

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

Set this to True if your .NET assembly needs to be available from COM calls.

DotNetInstallerClass

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

Set this to True if your assembly implements methods from the .NET Installer namespace.

DotNetInstallerClassArgCommit

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

This property allows you to specify argument lists for the Installer class when the Commit method is called.

DotNetInstallerClassArgInstall

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

This property allows you to specify the argument lists for the Install execution context for the Installer class.

DotNetInstallerClassArgRollback

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

This property allows you to specify argument lists for the Installer class when the Rollback method is called.

DotNetInstallerClassArgUninstall

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

This property allows you to specify the argument lists for the Uninstall execution context for the Installer class.

DotNetPrecompile

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

If this property is set to True, at installation the setup creates a native image from the .NET assembly and installs it to the native image cache on the target system. This allows the assembly to load and execute faster, because it restores code and data structures from the native image cache rather than from just-in-time (JIT) compilation.

DotNetScanAtBuild

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

This property instructs the build engine on how to handle your assembly. Set it to one of the following values:

ednbNone (0)—Build does nothing.
ednbProps (1)—Build scans your assembly for properties.
ednbDepAndProps (2)—Build scans your assembly for properties and dependencies.

ExtractAtBuild

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

Gets or sets the component's COM Extract at Build setting. Possible values are True and False.

FTPLocation

InstallScript, InstallScript Object

Read-Write Property

Gets or sets the component's FTP Location property, which specifies an FTP location for the component.

GUID

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

Holds a string GUID, also known as the Component Code property, surrounded by braces—{12345678-1234-1234-1234-1234567890AB}, for example.

HTTPLocation

InstallScript, InstallScript Object

Read-Write Property

Gets or sets the component's HTTP Location property, which specifies an HTTP location for the component.

ImportINIFile 

All

Method

Imports INI files from the automation layer.

ImportRegFile 

All

Method

Merges the contents of a REG file with the registry data for this component.

IsDeviceDriver

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

If this Boolean property is true, the key file for this component is a device driver package; if the property is false, the key file is not a device driver package.

IsPlatformSelected

InstallScript, InstallScript Object

Read-Write Property

In conjunction with the PlatformSuiteCheck property, gets or sets the component's Platform Suite(s) property, which specifies to what platform suites, if any, the component is specific.

Use the following constants to set this property:

epsMSBackOffice = 32 (&H20)
epsMSSmallBusinessServer = 256 (&H100)
epsMSSmallBusinessServerWithRestrictiveLiscenses = 512 (&H200)
epsTerminalServices = 16 (&H10)
epsWin2kAdvSvrOrWinDotNetEnterpriseServer = 128 (&H80)
epsWin2kOrWinDotNetDatacenterServer = 64 (&H40)
epsWinServer = 4
epsWinWorkstation = 8
epsWinXPHome = 2
epsWinXPPro = 1
epsArchIa64 = 1024 (&H400)
epsArchAmd64 = 2048 (&H800)
epsArchIntel32 = 4096 (&H1000)
epsWinServer2003R2 = 8192 (&H2000)

For example:

pFeature.IsPlatformSelected(epsWinXPHome) = True

ISWiComponentSubFolders 

InstallScript, InstallScript Object

Collection

Contains all of the subfolders associated with this component.

ISWiDynamicFileLinkings 

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

Collection

Contains all of the dynamic file links that are associated with a specified component.

ISWiEnvironmentVars 

Basic MSI, DIM, InstallScript MSI, Merge Module

Collection

Contains all of the environment variables that are associated with this component.

ISWiFiles 

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

Collection

Contains all of the files associated with this component.

ISWiFolders 

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

Collection

Contains all of the folders associated with this component.

ISWiRemoveFiles 

Basic MSI, DIM, InstallScript MSI, Merge Module

Method

Returns an ISWiRemoveFiles collection that contains all of the file and folder removal entries that are associated with the current component.

KeyPath

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

Note:ISWiComponent.KeyPathType must be set before setting ISWiComponent.KeyPath. Errors result if this is done in the reverse order.

Contains the file or registry entry that serves as this component's key path. The exact type is indicated by the KeyPathType property, below.

When the key path is a key file, it contains the file key. You can view this value in the Key column of a component's file list, but be aware that file keys are subject to change when the files are dynamically linked. The file key is the same as the Name property of an ISWiFile object.

When the key path is a registry value, there is a specially formatted string that contains the registry key. The path to the registry key is enclosed in square brackets and separated from the value name with a vertical bar (or pipe character). For example, the following lines set the key path for the component m_MyComponent to the value MyName under HKEY_LOCAL_MACHINE\Software\MyCompany\Settings:

    m_MyComponent.KeyPathType = kptRegistry

    m_MyComponent.KeyPath = "[HKEY_LOCAL_MACHINE\Software\MyCompany\Settings]|MyName"

A file cannot serve as the key file if it is dynamically linked.

KeyPathType

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

ISWiComponent.KeyPathType must be set before setting ISWiComponent.KeyPath. Errors result if this is done in the reverse order.Stores a value that points to the precise type of key path contained in the KeyPath property. Specify one of the following types:

kptRegistry (1)
kptFile (2)
kptFolder (3)
kptODBC (4)

Note that the automation interface can set the key path type only to kptRegistry or kptFile, but the other values are possible return values if you are reading the current key path type.

Miscellaneous

InstallScript, InstallScript Object

Read-Write Property

Gets or sets the component's Miscellaneous property, which associates a text string with the component.

Name

All

Read-Only Property

Component name of the current item in the collection.

NeverOverwrite

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

Instructs the installer whether to replace an existing component. Specify True to leave the existing component or False to replace it.

OSFilter

InstallScript, InstallScript MSI, InstallScript Object

Read-Write Property

Gets or sets the component's Operating Systems setting. If the target machine’s operating system does not match one of the operating systems that are specified for this setting, the component is not installed. By default, components are operating system independent, meaning that none of the component’s data are specific to certain operating systems.

OSFilter (cont.)

 

 

Use the following constants to set this property:

eosOSIndepedent = 0
eosWin95 = &H10 (16)
eosWin98 = &H40 (64)
eosWinMe = &H80 (128)
eosWinNT4 = &H10000 (65536)
eosWin2000 = &H100000 (1048576)
eosWinXP = &H400000 (4194304)
eosWinServer2003 = &H800000 (8388608)
eosWinVista = &H1000000 (16777216)—These constants are for Windows Vista and Windows Server 2008.
eosWin7 = &H2000000 (33554432)—These constants are for Windows 7 and Windows Server 2008 R2.
eosWin8 = &H4000000 (67108864)—These constants are for Windows 8 and Windows Server 2012.
eosWin81 = &H8000000 (134217728)—These constants are for Windows 8.1 and Windows Server 2012 R2.
eosAll = &HFD100D0 (265355472)

You can specify multiple platforms; for example, eosWin7 Or eosWinServer2008 Or eosWinVista Or eosWinServer2003.

Tip:Use this property with the IsPlatformSelected property to distinguish between Windows Vista and Windows Server 2008, or between Windows 7 and Windows Server 2008 R2, or between Windows 8 and Windows Server 2012, or between Windows 8.1 and Windows Server 2012 R2.

OverwriteMainOptions

InstallScript, InstallScript Object

Read-Write Property

In conjunction with the OverwriteSubOptionsVersion and OverwriteSubOptionsDate properties, gets or sets the component's Overwrite property, which specifies whether the component's files overwrite already-existing versions on the target system always, never, or conditionally based on date/time stamp or version number. Use the following constants to set this property:

ecomoAlways (0)—Files on the target system are always overwritten.
ecomoByDate (1)—Files on the target system are conditionally overwritten based on date/time stamp as specified by the OverwriteSubOptionsDate property.
ecomoByVersion (2)—Files on the target system are conditionally overwritten based on version number as specified by the OverwriteSubOptionsVersion property.
ecomoByVersionThenDate (3)—Files on the target system are conditionally overwritten based on version number or, if the file on your distribution media and the file on the target system have the same version number or if neither file has a version number, by date/time stamp as specified by the OverwriteSubOptionsVersion and OverwriteSubOptionsDate properties.
ecomoNever (4)—Files on the target system are never overwritten.

OverwriteSubOptionsDate

InstallScript, InstallScript Object

Read-Write Property

In conjunction with the OverwriteMainOptions and OverwriteSubOptionsVersion properties, gets or sets the component's Overwrite property, which specifies whether the component's files overwrite already-existing versions on the target system always, never, or conditionally based on date/time stamp or version number. Ignored if OverwriteMainOptions is set to ecomoAlways, ecomoByVersion, or ecomoNever. Use the following constants to set this property:

ecomsoNewer (0)—A file on the target system is overwritten if the file on your distribution media has a more recent date and time stamp.
ecomsoNewerOrSame (1)—A file on the target system is overwritten if the file on your distribution media has a more recent or the same date and time stamp.
ecomsoOlder (2)—A file on the target system is overwritten if the file on your distribution media has a less recent date and time stamp.

OverwriteSubOptionsVersion

InstallScript, InstallScript Object

Read-Write Property

In conjunction with the OverwriteMainOptions and OverwriteSubOptionsDate properties, gets or sets the component's Overwrite property, which specifies whether the component's files overwrite already-existing versions on the target system always, never, or conditionally based on date/time stamp or version number. Ignored if OverwriteMainOptions is set to ecomoAlways, ecomoByDate, or ecomoNever. Use the following constants to set this property:

ecomsoNewer (0)—A file on the target system is overwritten if the file on your distribution media has a higher version number.
ecomsoNewerOrSame (1)—A file on the target system is overwritten if the file on your distribution media has a higher or the same version number.
ecomsoOlder (2)—A file on the target system is overwritten if the file on your distribution media has a lower version number.

Permanent

All

Read-Write Property

This property corresponds to the Permanent component property in the IDE. Set Permanent to True to make sure the component is never removed; False otherwise.

PlatformSuiteCheck

InstallScript, InstallScript Object

Read-Write Property

In conjunction with the IsPlatformSelected property, gets or sets the component's Platform Suite(s) property, which specifies to what platform suites, if any, the component is specific. Use the following constants to set this property:

ecpscAll (0)—The setup installs the component's files only if all of the suites that are specified by the IsPlatformSelected property exist on the target system.
ecpscAtLeastOne (1)—The setup installs the component's files only if at least one of the suites that are specified by the IsPlatformSelected property exist on the target system.
ecpscSuiteIndependent (2)—Installation of the component's files does not depend on the target system's suite.

PotentiallyLocked

InstallScript, InstallScript Object

Read-Write Property

This Boolean property gets or sets the component's Potentially Locked property, which specifies whether already-installed versions of the component's files may be locked—that is, in use by another application—during setup.

RegFileToMergeAtBuild

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

Provides the complete path to a .reg file to have it merged with the component's registry entries at build time.

RegistrationType

Basic MSI, InstallScript MSI, Merge Module

Property

The following options are available for determining the source of the registration information for this component:

rgtNone (0)InstallShield will not dynamically extract the data or mark the component as self-registering, but any information in the COM Registration advanced setting will be registered.
rgtSelfReg (-1)—The files in this component will have their self-registration routines invoked by the installer.
rgtExtractAtBuild (-2)—Dynamically extracts COM registration information when you build a release.

Because the Registration Type property has been removed from the component views in the IDE, setting the RegistrationType property in the automation interface has the following effects:

Using rgtNone sets the component's COM Extract at Build property to No.
Using rgtSelfReg sets the component's COM Extract at Build property to No, and sets each file in the component to use self-registration.
Using rgtExtractAtBuild sets the component's COM Extract at Build property to Yes, and sets each file in the component not to use self-registration.

RemoteInstallation

Basic MSI, InstallScript MSI, Merge Module

Read-Write Property

Use one of the following options to install the component's files locally or leave them on the distribution medium:

rfsLocal (0)—Installs the files to the folder stored in the component's Destination property.
rfsSource (1)—Leaves the files on the distribution medium.
rfsOptional (2)—The component follows the feature's property.

RemoveComponentSubFolder 

InstallScript, InstallScript Object

Method

Removes a subfolder to the current ISWiComponent.

RemoveDynamicFileLinking 

Basic MSI, InstallScript, InstallScript MSI, Merge Module

Method

Removes a dynamic file link from the current component.

RemoveEnvironmentVar 

Basic MSI, InstallScript MSI, Merge Module

Method

Removes an environment variable from the current component.

RemoveFile 

All

Method

Removes a file from the current component.

RemoveRemoveFile 

Basic MSI, DIM, InstallScript MSI, Merge Module

Method

Removes a file or folder removal entry from the current component. To remove a file or folder removal entry from the project, pass the ISWiRemoveFile object.

SelfRegister

InstallScript, InstallScript Object

Read-Write Property

This Boolean property gets or sets the component's Self-Register property, which specifies whether the component's files are self-registering.

SharedDLLRefCount

All

Read-Write Property

True indicates that the installer should increment a reference count for each file in this component when it is installed, False otherwise.

SourceLocation

All

Read-Write Property

Provides the name of a folder in the compressed setup package or in the release location where this component’s files are stored when you build a release. This property is identical to a component’s Source Location setting in InstallShield.

Important:Setting the Destination property for the ISWiComponent object resets the object’s SourceLocation property. Therefore, any code that sets the SourceLocation property should be placed after any code that sets the Destination property.

Transitive

All

Read-Write Property

Set this property to True to have the installer re-evaluate the condition when this component is reinstalled, False otherwise.

Applies To

ISWiFeature