Jump to content


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.
Photo

FindRelatedProducts and Installscript


2 replies to this topic

omnicognate

omnicognate
  • Members
  • 2 posts

Posted 13 October 2004 - 15:16

Hello,

I have a package which needs to display different dialogs in OnFirstUIBefore(), depending on whether a major upgrade is in progress or a first time install.

I have no problems getting the major upgrade to occur, but I am having difficulty making the InstallScript aware that it is happening.

I have set up the Upgrade table so that the product codes of the related products are put into a property called OLDPRODUCTCODES, which has been added to SecureCustomProperties.

The FindRelatedProducts action is in both the Install UI Sequence and the Install Execute Sequence.

I had understood that the installshield runtime causes the UI sequence to be run in full before any script is executed, so I would have expected OLDPRODUCTCODES to have been filled by the time OnFirstUIBefore is called. However, OLDPRODUCTCODES is still empty at this point.

By the time OnMoving is called, OLDPRODUCTCODES has been populated with the old product code, but this is too late to change the UI.

Does anyone know how to do this properly? It seems like it would be a fairly common thing to do.

Thanks,
Tom

KathyMorey

KathyMorey
  • Full Members
  • 111 posts

Posted 14 October 2004 - 13:47

I solved that problem by defining a global flag, searching in OnBegin for either a file or a registry entry that will be present if the product is already installed, setting the flag to TRUE if found, and using the flag to determine my UI in OnFirstUIBefore.

(And it was my understanding the the UI sequence is not run with an Installscript MSI project.)

HTH
Kathy Morey
Synergy Software Engineer
ProfitStars, a Jack Henry Company
kmorey@profitstars.com

omnicognate

omnicognate
  • Members
  • 2 posts

Posted 14 October 2004 - 14:54

Hmmm. It was the book "Getting started with InstallShield Developer and Windows Installer Setups" by Bob Baker that made me believe the UI sequence actions get executed. On page 165 there is a diagram which shows the steps in a standard project fresh install. Two of the steps taken by the IDriver.exe process are shown, in order, as:
QUOTE
"Process all the actions in the InstallUISequence table skipping any actions with negative sequence numbers and skipping the ExecuteAction action. This will extrace any setup files and any billboards included in the installation to SUPPORTDIR"

Followed by:
QUOTE
"Initialize Setup.inx by loading it into memory, setting system constants, etc. Enable a connection with the Msiexec process."

Maybe this is incorrect.
I've solved the problem by using the product code of the previous version and MsiGetProductInfo to get the version string of the old installed version (which I need for the gui). For each new major upgrade I do, I'll have to add a line like this to the script:
QUOTE
CheckProductInstalled("{xxxxxx-xxx-xxx-xxxxx}")

I wanted to use the Windows Installer API function MsiEnumRelatedProducts to check against the upgrade code, so I didn't need to do this, but it doesn't seem to be available from Installshield Developer 7.
(Bites tongue to keep from ranting about how simple a task like retrieving the version string of the product you are upgrading from should be)
Thanks very much for for your help.
Tom