Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

_LaunchAppEx


2 replies to this topic

trutmrol

trutmrol
  • Members
  • 94 posts

Posted 09 May 2001 - 10:46

Problem:
Aus einem Setup heraus ein MSI-Packe installieren
unter Windows 2000 mit _LauchAppEx.
Fehler:
WaitForSingleObject(piData.hProcess, nTimeOut);
Kommt nie mehr zurück. Und die GUI's des MSI
werden nicht angezeigt.
Hinweis:
Wenn ich das Setup debugge läuft das Setup einwandfrei.

-------------------------------------------------------------------
//Sorce von InstallShield
//
//Extended Version of LaunchAppAndWait
//Written by Stefan Krueger
//LauchAppEx.zip File size: 2.598 bytes   Last update: 2000-11-29


//Aufruf------------------------------------------------------------------------------------

_LaunchAppEx(WINSYSDIR ^ "msiexec.exe", "\i xx.msi", WAIT, SW_SHOWNORMAL, -1, nvExitCode)
//------------------------------------------------------------------------------------------

function _LaunchAppEx(szProgram, szCmdLine, nWait, nShow, nTimeOut, nvExitCode)
   STARTUPINFO siData;
   PROCESS_INFORMATION piData;

begin

  siData.cb = 68;
siData.lpReserved = NULL;
siData.lpDesktop = NULL;
siData.lpTitle = NULL;
siData.dwX = 0;
siData.dwY = 0;
siData.dwXSize = 0;
siData.dwYSize = 0;
siData.dwXCountChars = 0;
siData.dwYCountChars = 0;
siData.dwFillAttribute = 0;
siData.dwFlags = 1;  //STARTF_USESHOWWINDOW
siData.wShowWindow = nShow;
siData.lpReserved2 = NULL;
siData.hStdInput = NULL;
siData.hStdOutput = NULL;
siData.hStdError = NULL;

   if (CreateProcessA(NULL, szProgram + " " + szCmdLine, NULL, NULL,
                      TRUE, 0, NULL, NULL, &siData, &piData) = 0) then
      return (-1);
   endif;


if ( nWait != WAIT ) then
      nvExitCode = 0;
      return 0;
endif;

   WaitForSingleObject(piData.hProcess, nTimeOut); <----Problem

   GetExitCodeProcess(piData.hProcess, &nvExitCode);
 return 0
end;

Frage:
Weis jemand wieso sich der Prozess unter Windows
2000 mit msiexec.exe bei der RunTime Version anders verhaelt.

Danke fuer die Hinweise!!



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 09 May 2001 - 11:03

Quote
_LaunchAppEx(WINSYSDIR ^ "msiexec.exe", "\i xx.msi", WAIT, SW_SHOWNORMAL, -1, nvExitCode)

Ich nehme an, das ist ein Tippfehler, jedenfalls muss es "/i xx.msi" heissen, nicht "\i xx.msi"

Das Probelm ist, dass MSI Setups in mehreren Prozessen ablaufen, und einer davon läuft als Service und endet nie. Wahrscheinlich wäre es besser, die API-Funktion MsiInstallProduct() auzurufen.