Hello!
I eliminate that simultaneously can exist only one session object in install.
Session object provide some handy opportunities.
Next code written in VBScript will show UpgradeCode values for every product, installed in target system:
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Retrieve UpgradeCode in CA
Started by
AntonS
, Oct 02 2004 15:30
6 replies to this topic
Posted 02 October 2004 - 15:30
CODE |
Dim oInstaller, sProduct, oSession Set oInstaller = CreateObject(“WindowsInstaller.Installer”) For each sProduct in oInstaller.Products Set oSession = oInstaller.OpenProduct(sProduct) MsgBox oSession.ProductProperty(“UpgradeCode”) Next |
But how I can retrieve it from CA?
Posted 04 October 2004 - 11:02
It’s simple to receive ProductCode value.
Automation interface provide
I can perform it with code:
Automation interface provide
I can perform it with code:
CODE |
Dim oInstaller, sProduct Set oInstaller = CreateObject(“WindowsInstaller.Installer”) For each sProduct in oInstaller.Products MsgBox oInstaller.ProductInfo(sProdCode,"InstalledProductName") Next |
Where "InstalledProductName" is specified attribute, which provide ProductName.
Can I receive UpgradeCode without Session object?
Posted 05 October 2004 - 08:03
I don't think the upgrade code gets registered in the installer info similar to the product code for installed products. I guess you would have to open the MSI and read the contents of the property table.
Stefan Krüger
InstallSite.org twitter facebook
Posted 05 October 2004 - 11:40
But what I shall do if previous MSI file not available on target system?
I still can acquire UpgradeCode from Automation Interface by Session.PropertyName("UpgradeCode").
Thereby, UpgradeCode value stored somewhere in Windows Installer repository on target computer.
I suppose it possible to access UpgradeCode in this repository directly?
Thank you.
I still can acquire UpgradeCode from Automation Interface by Session.PropertyName("UpgradeCode").
Thereby, UpgradeCode value stored somewhere in Windows Installer repository on target computer.
I suppose it possible to access UpgradeCode in this repository directly?
Thank you.
Posted 05 October 2004 - 12:03
Problem I work on state, that I never know UpgradeCode before my MSI arrive at target computers.
Posted 05 October 2004 - 12:14
Calling Session.PropertyName("UpgradeCode") in a custom action will give you the value of the UpgradeCode property of the running install,not of any other msi file on the machine. But if the setup isn't running and you don't have a session, you can't get property values this way. Instead I believe you would have to use Installer SQL to read the UpgradeCode property from the Property table in the msi file.
Stefan Krüger
InstallSite.org twitter facebook
Posted 05 October 2004 - 12:48
Thank you.
I hope MSI 3.0 provided with functionality that allow avoiding this limitation.
I hope MSI 3.0 provided with functionality that allow avoiding this limitation.