PDA

View Full Version : Install "Windows Installer"



arshun2
09-23-2003, 05:11 AM
Hi,
Because my installation program needs to run some msi files, I must ensure that the computer can run these files. However, in some old OS like win98, they can not run these files so I need to install "Windows Installer".
My problem is that after installshield copying all files and start to run "Windows Installer" in win98, "Windows Installer" alert that installshield need to be close in order to run itself! I am totally frustrated by it....Did anyone encounter this problem before? Can anyone give me any advice? REALLY THANK YOU VERY MUCH!!

mikegillow
09-25-2003, 07:07 AM
I was facing the same problem - here is what worked for me:

I added the InstMSIA and InstMSIW executables to the Setup Files/Language Independent/OS Independent folder.

I added this code to OnBegin:

// Check for the Windows Installer Engine
bUpdateMSI = TRUE;
if !(VerFindFileVersion ( "msiexec.exe" , svPath , svVersionNumber ) = 0) then //not found
MessageBox ("Windows Installer Engine must be installed first.", INFORMATION);
else
szVersionInfo = "2.0.0.0";
if (VerCompare ( svVersionNumber , szVersionInfo , VERSION ) = LESS_THAN) then
MessageBox ("Windows Installer Engine must be updated first.", INFORMATION);
else
bUpdateMSI = FALSE;
endif;
endif;
if bUpdateMSI then
MessageBox ("The Windows Installer Engine V2 must be installed\n"+
"before this installation can continue.\n\n"+
"Installation of the Windows Installer Engine may require a reboot.\n\n"+
"If the Windows Installer installation program restarts\n"+
"your computer, you will need to restart the MyProduct install program\n"+
"in order to complete this installation.", INFORMATION);
if bIsNT || bIs2000 then
LaunchAppAndWait (SUPPORTDIR^"instmsiw.exe", "", WAIT);
else
LaunchAppAndWait (SUPPORTDIR^"instmsia.exe", "", WAIT);
endif;
endif;


Mike

arshun2
09-25-2003, 11:12 PM
Thank you very much!
I have solved the problem~
And I add more function to it to make it run the setup after reboot

Here is the code added when Windows Installer is absent:

RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
RegDBSetKeyValueEx("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\", "RunSetup", REGDB_STRING, SRCDIR^ "Setup.exe", -1);

Thomas