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: MsiOpenPackage in pure InstallScript crashes Setup.exe
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 30, 2008
05:49 PM
MsiOpenPackage in pure InstallScript crashes Setup.exe
Hi,
I have a pure InstallScript project that works as a wrapper to run several different installers, some MSI, some not. some 3rd Party and some of them ours.
In each OnInstalled() event that runs an MSI we have code that checks to see if the MSI is already installed or not. We use MsiOpenPackage to open the package and get it's ProductCode. After that we check with MsiQueryProductState if the Product is already installed or not.
Everything works fine until the first MergeModule is installed, after that a call to MsiOpenPackage will crash the Setup.exe.
To rule out that the MergeModules themselves introduce this bug, I removed them and added the ATL3.0 MSM. Same result.
When I remove all MergeModules from the Installer, all MsiOpenPackage calls succeed.
Any ideas for a workaround? Does anyone else see this bug?
It seems like a problem of the InstallShield MergeModule holder to me.
I'm using InstallShield 2009 Premier Edition SP2/SAB SP2. Pure InstallScript project.
Thanks,
Sandra
I have a pure InstallScript project that works as a wrapper to run several different installers, some MSI, some not. some 3rd Party and some of them ours.
In each OnInstalled() event that runs an MSI we have code that checks to see if the MSI is already installed or not. We use MsiOpenPackage to open the package and get it's ProductCode. After that we check with MsiQueryProductState if the Product is already installed or not.
Everything works fine until the first MergeModule is installed, after that a call to MsiOpenPackage will crash the Setup.exe.
To rule out that the MergeModules themselves introduce this bug, I removed them and added the ATL3.0 MSM. Same result.
When I remove all MergeModules from the Installer, all MsiOpenPackage calls succeed.
Any ideas for a workaround? Does anyone else see this bug?
It seems like a problem of the InstallShield MergeModule holder to me.
I'm using InstallShield 2009 Premier Edition SP2/SAB SP2. Pure InstallScript project.
Thanks,
Sandra
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 01, 2008
03:43 AM
Sandra,
here is some simple code that works for me even if a merge module has been installed before. Maybe it works for you too.
Holger 🙂
here is some simple code that works for me even if a merge module has been installed before. Maybe it works for you too.
function NewFeature1_Installed()
STRING szQuery, szProductCode;
OBJECT oMSI, oDatabase, oView, oRec;
begin
set oMSI = CreateObject("WindowsInstaller.Installer");
if (IsObject(oMSI)) then
try
set oDatabase = oMSI.OpenDatabase(TARGETDIR ^ "orca.msi", 0); //0=MSIDBOPEN_READONLY
if (IsObject(oDatabase)) then
szQuery = "select `Value` from `Property` where `Property` = 'ProductCode'";
set oView = oDatabase.OpenView(szQuery);
oView.Execute;
set oRec = oView.Fetch;
szProductCode = oRec.StringData(1);
SprintfBox (INFORMATION, "", "ProductCode: %s", szProductCode);
set oRec = NOTHING;
set oDatabase = NOTHING;
set oDatabase = NOTHING;
set oView = NOTHING;
endif;
catch
SprintfBox (WARNING, "OpenDatabase", "Database failed");
endcatch;
endif;
end;
Holger 🙂
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 01, 2008
02:48 PM
yep. works like a charm. Thanks Holger!
Sandra
Sandra