cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
CChong
Level 11 Flexeran
Level 11 Flexeran

Can't MsiGetProperty() in OnFirstUIAfter() as expected

Please help me somebody to figure out my blunder or what's wrong with my expectation:
I MsiSetProperty() a public property early in OnFirstUIBefore(), checking it at the end of this event proofs that it successfully was set, but when I try to MsiGetProperty() it later in OnFirstUIAfter() I'm just retrieving an empty string (i.e. my initial value from the Property table), somehow the value seems to be lost in between?! Did anyone see something similar so far?

The environment is IShield 2009 Premier SP2, InstallScript MSI, MajorUpgrade is taking place under Vista64. More specificly, what I want to do is to pipe through the ProductGUID of the version being upgraded which I retrieve via a SecureCustomProperty OLDPRODUCTS in the beginning. When trying to read this out after the upgrade took place - in order to clean up certain relicts of the old version - the property is empty, and to my big surprise also storing it in another property doesn't help :confused: The ISMSI_HANDLE still seems to be valid, I'm aware of related hurdles with ISCript CAs in Basic MSI and their changing MSI handles, but here it's InstallScript MSI project type. Using a global IScript string variable for storage works very fine, but I wanted to get rid of this global variable...
Labels (1)
0 Kudos
(4) Replies
KathyMorey
Level 10

If I remember correctly, OnFirstUIAfter is called by the script engine after the MSI finishes, so you can't access MSI properties by then. Have you tried setting a global variable in OnFirstUIBefore, and using that in OnFirstUIAfter?
0 Kudos
CChong
Level 11 Flexeran
Level 11 Flexeran

Yes, with a global variable all worked fine before, and currently it looks like I need to stick with it; what is a pity since I'm no friend of global variables. The way through the registry is also no option (too unsafe) as well as isn't to call things earlier (user might cancel in-between).
What makes me really wonder about this issue why I can get other properties (e.g. from the Directory table) correctly by the same time, reflecting their dynamic runtime changes, not just the default value. 😞
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

This is a limitation of InstallScript MSI projects. Please see my post in the following thread for additional details.

http://community.acresso.com/showthread.php?t=188490
0 Kudos
CChong
Level 11 Flexeran
Level 11 Flexeran

Ah I see, thanks Josh. Please consider to point the manual writers to this limitation, I would have been glad to read about e.g. in the chapters dealing with CustomActionData, global variables in deferred CAs or similar.
0 Kudos