This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Can't MsiGetProperty() in OnFirstUIAfter() as expected
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Sep 19, 2009
11:51 AM
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...
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...
(4) Replies
‎Sep 21, 2009
08:34 AM
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?
‎Sep 21, 2009
09:34 AM
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. 😞
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. 😞
‎Sep 21, 2009
06:26 PM
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
http://community.acresso.com/showthread.php?t=188490
‎Sep 22, 2009
02:42 AM
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.