PDA

View Full Version : Can't start msi



maziyar
06-09-2006, 09:41 AM
Hello,

I can't seem to launch an .msi package where the same code with .exe works perfectly..I checked the path and it finds the path correctly, I have some checks before this so I don't want to use custom actions directly..

//start installing apache
szPath = "C:\\Focus\\apache_2.0.55.msi";

if (LaunchAppAndWait (szPath, "/quiet",WAIT) < 0) then
MessageBox("Unable to start " + szPath, SEVERE);
abort;
endif;

anyone has come across this problem?

thanks

RobertDickau
06-09-2006, 09:47 AM
I think LaunchAppAndWait wants an EXE; perhaps launch WINSYSDIR^"msiexec.exe" with the path to the MSI database as an argument?

Christopher Painter
06-09-2006, 10:00 AM
I think LaunchAppAndWait wants an EXE; perhaps launch WINSYSDIR^"msiexec.exe" with the path to the MSI database as an argument?

Don't forget the "/i" in between msiexec and the path to your MSI database.

maziyar
06-09-2006, 10:01 AM
Brilliant!

Actually I just passed the msi database and all the optional parameters as parameter in LaunchAppAndWait...Thanks though!

My excuse --> I'm not a windows programmer.. :D

Christopher Painter
06-09-2006, 10:05 AM
I havn't used LaunchAppAndWait in a long time so I couldn't remember if MIME extensions were respected when call CreateProcess or ShellExecute internally.

RobertDickau
06-09-2006, 10:12 AM
Right, LaunchApp/AndWait uses CreateProcess, which I gather doesn't know about registered file types; if needed, one can explicitly prototype and call ShellExecute, which does.