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
Automation Objects for Advanced UI and Suite/Advanced UI Projects
Suite Registry Compare Settings
Use Python with the Installshield Automation
Related Articles
Automation Interface: How to Change the Package GUID of all the Packages Included in a Suite Project 4Number of Views How to Update All Components Using the Automation Interface 10Number of Views Using the Automation Interface With VB .NET 3Number of Views Using InstallShield Automation Interface In C# 3Number of Views Using the Automation Interface to Build a Project 5Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago