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

How to use ISWiAutoUpgradeEntries method

am using InstallShield Automation Interface to automate my packaging process. I am tryng to use ISWiAutoUpgradeEntries method of ISWiProject object from VBscript to get the details of specific auto upgrade item entry from upgrade items list. I used the code given in install shield automation interface help library but it fails to find the upgrade item and return the "Automation Error: Element not found" error message.
Sample VBScript code:


Set m_ISWiProj = CreateObject("IswiAuto19.ISWiProject")
m_ISWiProj.OpenProject("C:\Installer\MyApp.ism")
Set m_AutomaticUpgradeEntries = m_ISWiProj.ISWiAutoUpgradeEntries("SearchItem")

Error message on execution:

c:\Installer\test.vbs(17, 1) ISWiAuto19: Automation error
Element not found.
> ISWiAutomation.IswiAutomaticUpgradeEntries.Initialize
> ISWiAutomation.IswiProject.IswiAutoUpgradeEntries

Can anyone explain me how to solve this or what is wrong here?
Labels (1)
0 Kudos
1 Reply
Highlighted
Pilgrim

Re: How to use ISWiAutoUpgradeEntries method

I think that is because the "SearchItem" upgrade item doesn't exist in the ISUpgradeMsiItem table. You may want to iterate through the ISWiAutoUpgradeEntries collection to find an item that you are looking for.

Set m_ISWiProj = CreateObject("IswiAuto19.ISWiProject")
m_ISWiProj.OpenProject("C:\Installer\MyApp.ism")

For Each pISWiAutoUpgradeEntry In m_ISWiProj.ISWiAutoUpgradeEntries
If pISWiAutoUpgradeEntry.Name = "SearchItem" Then
' Do some work
EndIf
Next
0 Kudos