cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Suite Package and Feature Detection Condition using Automation Interface

Suite Package and Feature Detection Condition using Automation Interface

Summary 

 We can use Installshield Automation Interface to Add or Remove Detection condition in Suite project for a feature or a package

Symptoms

In a Suite Project if we have multiple package added instead of adding condition manually to all the packages, we can use automation layer interface to add Detection condition 

Resolution

It is possible to use Install shields Automation Interface functionality to automate this process.  The example below uses  vbscript code to add a package and then set the feature condition and package Detection condition for registry comparsion

You can run the script using vbs editor or you can run the script using “wscript.exe” or Cscript.exe in an administrator cmdlet.

Path to wscript.exe “C:\Windows\System32>wscript.exe”

 

 'Change ISWiAutoSuite dll version based installshield installed
 Set proj = CreateObject("ISWiAutoSuite27.ISWiProject")

'Project Creation path
ProjectPath = "C:\InstallShield 2021 Projects\Suite_Sample.issuite"

'Suite Project creating 
proj.CreateProject ProjectPath, 16

proj.OpenProject "C:\InstallShield 2021 Projects\Suite_Sample.issuite",False

'Suite Package details
proj.ProductVersion = "2.00.000"

proj.SuiteGuid="{3807CD86-6C1C-4D16-B881-DC4CDADE5128}"

'Adding a Package an MSI Package
Set Addpackage = proj.AddSuitePackage(1, "C:\Users\Administrator\Desktop\Test Data\Orca.msi", 0)

'Adding an EXE Package

Set Addpackage1 = proj.AddSuitePackage(3, "C:\Windows\notepad.exe", 0)
Addpackage1.DisplayName="Test"

'Create Feature and Link Package
proj.AddSuiteFeature("Feature").AttachPackage(Addpackage)
proj.AddSuiteFeature("Feature").AttachPackage(Addpackage1)
'Adding Detection Condition
Set DetectionCondition  = Addpackage.AddDetectCondition()
'FileExists Condition
Set FileExistsCondition = DetectionCondition.AddCondition("FileExists")
Set FileExistsParameters = FileExistsCondition.ISWiSuiteConditionParameters
FileExistsParameters.Item("Path").Content = "C:\Windows\notepad.exe"

'Adding Detection Registry Condition
Set DetectionCondition1  = Addpackage.AddDetectCondition()
Set FileExistsCondition1 = DetectionCondition1.AddCondition("RegistryValue")
Set FileExistsParameters1 = FileExistsCondition1.ISWiSuiteConditionParameters


FileExistsParameters1.Item(1).Content="HKLM\"
FileExistsParameters1.Item(2).Content="Test"
FileExistsParameters1.Item(3).Content="TRUE"
FileExistsParameters1.Item(4).Content="DWORD"
FileExistsParameters1.Item(5).Content="Less than or Equal To"
FileExistsParameters1.Item(6).Content="123"

Set rel =proj.AddSuiteRelease("Release")

'rel.Build
proj.SaveProject

 

 

Reference

BMSI Project Automation 

Automation Objects for Advanced UI and Suite/Advanced UI Projects 

Suite Registry Compare Settings 

ISWiSuiteCondition Object 

Use Python with the Installshield Automation 

 

Labels (1)
Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Jan 31, 2022 12:42 AM
Updated by:
Contributors