PDA

View Full Version : InstallShield 12 - InstallScript MSI Project - reseted global variables



mduchacek
07-20-2006, 07:58 AM
Hi all,

We have migrated from Installshield X to Installshield 12 and have recognized following problem in Installscript MSI Projects.

I tested it on a blank project on Windows Server 2003 and Windows Server 2000, on both platforms it has the same behavior.

The problem is following. I have this installscript code:

export prototype testCustomAction(HWND);

STRING testString;

function OnFirstUIBefore()
begin
testString = "Test value";
MessageBox("OnFirstUIBefore - Test string contains:" + testString, WARNING);
end;

function testCustomAction(hMSI)
begin
MessageBox("testCustomAction - Test string contains:" + testString, WARNING);
end;

testCustomAction is placed as the first action in install exec sequence. If I run the setup, so in messageBox in OnFirstUIBefore I see correctly OnFirstUIBefore - Test string contains: Test value", but after them in the testCustomAction method the variable testString is reseted and I see the messagebox with "testCustomAction - Test string contains:".
Such a behavior is same by all global variables, every changes made in OnFirstUIBefore are in next methods reseted.
(such practicies worked without any problems in Installshield X)

Were there any changes made in Installscript logic that can cause such errors or is there any other possibility how to get values from OnFirstUIBefore to following methods?

Thanks for any hints or answers.

Martin Duchacek
CSC Computer Sciences

Christopher Painter
07-20-2006, 08:16 AM
Checkout the sticky in this forum:

http://community.installshield.com/showthread.php?t=159794

I also talk about this on my blog:

http://chrpai.blogspot.com/2006/04/installshield-12-beta2.html

http://chrpai.blogspot.com/2006/06/installscript-meet-customactiondata.html

http://chrpai.blogspot.com/2006/06/installscript-ca-performance-issue.html

mduchacek
07-20-2006, 08:47 AM
Thanks, I found reply to my question in the first link.

Best Regards Martin