- Timestamp:
- Jan 18, 2022 10:35:21 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp
r93243 r93333 159 159 int rc = RTProcWait(Process, RTPROCWAIT_FLAGS_NOBLOCK, pProcSts); 160 160 if (rc == VERR_PROCESS_RUNNING) 161 continue;161 Sleep(1); /* Don't spin uncontrolled. duh. */ 162 162 else if (RT_FAILURE(rc)) 163 163 return rc; 164 165 if ( pProcSts->iStatus != 0 166 || pProcSts->enmReason != RTPROCEXITREASON_NORMAL) 167 { 168 rc = VERR_GENERAL_FAILURE; /** @todo Fudge! */ 169 } 170 171 return VINF_SUCCESS; 164 else 165 { 166 if ( pProcSts->iStatus != 0 167 || pProcSts->enmReason != RTPROCEXITREASON_NORMAL) 168 { 169 /** @todo r=bird: This isn't returned, so what's the point here? */ 170 rc = VERR_GENERAL_FAILURE; /** @todo Fudge! */ 171 } 172 return VINF_SUCCESS; 173 } 172 174 } 173 175 … … 180 182 * @returns VBox status code. 181 183 * @param hModule Windows installer module handle. 182 * @param p csExeAbsolute path of executable to run.183 * @param pap cszArgsPointer to command line arguments to use for calling the executable.184 * @param cArgs Number of command line arguments in \a pap cszArgs.184 * @param pszImage Absolute path of executable to run. 185 * @param papszArgs Pointer to command line arguments to use for calling the executable. 186 * @param cArgs Number of command line arguments in \a papszArgs. 185 187 */ 186 static int procRun(MSIHANDLE hModule, const char *p cszImage, const char **papcszArgs, size_t cArgs)188 static int procRun(MSIHANDLE hModule, const char *pszImage, const char * const *papszArgs, size_t cArgs) 187 189 { 188 190 RT_NOREF(cArgs); … … 191 193 RT_ZERO(Process); 192 194 193 uint32_t fProcess 195 uint32_t fProcess = 0; 194 196 #ifndef DEBUG 195 197 fProcess |= RTPROC_FLAGS_HIDDEN; 196 198 #endif 197 199 198 int rc = RTProcCreate(p cszImage, papcszArgs, RTENV_DEFAULT, fProcess, &Process);200 int rc = RTProcCreate(pszImage, papszArgs, RTENV_DEFAULT, fProcess, &Process); 199 201 if (RT_SUCCESS(rc)) 200 202 { … … 205 207 206 208 if (RT_FAILURE(rc)) 207 logStringF(hModule, "procRun: Waiting for process \"%s\" failed with %Rrc (process status: %d, reason: %d)\n", 208 pcszImage, rc, ProcSts.iStatus, ProcSts.enmReason); 209 logStringF(hModule, "procRun: Waiting for process \"%s\" failed with %Rrc (process status: %d (%#x), reason: %d)\n", 210 pszImage, rc, ProcSts.iStatus, ProcSts.iStatus, ProcSts.enmReason); 211 else if ( ProcSts.iStatus != 0 212 || ProcSts.enmReason != RTPROCEXITREASON_NORMAL) 213 logStringF(hModule, "procRun: Process \"%s\" terminated with iStatus=%d (%#x) and enmReason=%d\n", 214 pszImage, ProcSts.iStatus, ProcSts.iStatus, ProcSts.enmReason); 209 215 } 210 216 else 211 logStringF(hModule, "procRun: Creating process for \"%s\" failed with %Rrc\n", p cszImage, rc);217 logStringF(hModule, "procRun: Creating process for \"%s\" failed with %Rrc\n", pszImage, rc); 212 218 213 219 return rc; … … 288 294 289 295 if (RT_FAILURE(rc)) 290 {291 296 RTStrFree(pszPythonPath); 292 }293 297 else 294 298 *ppszPath = pszPythonPath; … … 346 350 logStringF(hModule, "checkPythonDependencies: Checking for win32api extensions ..."); 347 351 348 const char *papszArgs[ 4] = { pcszPythonExe, "-c", "import win32api", NULL};352 const char *papszArgs[] = { pcszPythonExe, "-c", "import win32api", NULL}; 349 353 350 354 int rc = procRun(hModule, pcszPythonExe, papszArgs, RT_ELEMENTS(papszArgs)); 351 355 if (RT_SUCCESS(rc)) 352 {353 356 logStringF(hModule, "checkPythonDependencies: win32api found\n"); 354 }355 357 else 356 358 logStringF(hModule, "checkPythonDependencies: Importing win32api failed with %Rrc\n", rc); … … 473 475 logStringF(hModule, "InstallPythonAPI: Invoking vboxapisetup.py in \"%s\" ...\n", pszVBoxSDKPath); 474 476 475 const char *papszArgs[ 4] = { pszPythonExe, "vboxapisetup.py", "install", NULL};477 const char *papszArgs[] = { pszPythonExe, "vboxapisetup.py", "install", NULL}; 476 478 477 479 rc = procRun(hModule, pszPythonExe, papszArgs, RT_ELEMENTS(papszArgs)); 478 480 if (RT_SUCCESS(rc)) 479 481 logStringF(hModule, "InstallPythonAPI: Installation of vboxapisetup.py successful\n"); 480 481 if (RT_FAILURE(rc)) 482 else 482 483 logStringF(hModule, "InstallPythonAPI: Calling vboxapisetup.py failed with %Rrc\n", rc); 483 484 } … … 500 501 logStringF(hModule, "InstallPythonAPI: Validating VBox API ...\n"); 501 502 502 const char *papszArgs[ 4] = { pszPythonExe, "-c", "from vboxapi import VirtualBoxManager", NULL};503 const char *papszArgs[] = { pszPythonExe, "-c", "from vboxapi import VirtualBoxManager", NULL}; 503 504 504 505 rc = procRun(hModule, pszPythonExe, papszArgs, RT_ELEMENTS(papszArgs)); 505 506 if (RT_SUCCESS(rc)) 506 507 logStringF(hModule, "InstallPythonAPI: VBox API looks good.\n"); 507 508 if (RT_FAILURE(rc)) 508 else 509 509 logStringF(hModule, "InstallPythonAPI: Validating VBox API failed with %Rrc\n", rc); 510 510 }
Note:
See TracChangeset
for help on using the changeset viewer.