Browse Source

NT6-proof PhysX_Setup.exe launch

CreateProcessW on PhysX_Setup.exe will probably cause
ERROR_ELEVATION_REQUIRED. That is NOT my idea of a successful install.
Adam Johnson 11 years ago
parent
commit
625319f99d
  1. 23
      Sources/Plasma/Apps/plClient/winmain.cpp

23
Sources/Plasma/Apps/plClient/winmain.cpp

@ -497,22 +497,18 @@ bool InitPhysX()
return false; return false;
// launch the PhysX installer // launch the PhysX installer
STARTUPINFOW startupInfo; SHELLEXECUTEINFOW info;
PROCESS_INFORMATION processInfo; memset(&info, 0, sizeof(info));
memset(&startupInfo, 0, sizeof(startupInfo)); info.cbSize = sizeof(info);
memset(&processInfo, 0, sizeof(processInfo)); info.lpFile = s_physXSetupExeName;
startupInfo.cb = sizeof(startupInfo); info.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NOASYNC;
if(!CreateProcessW(NULL, s_physXSetupExeName, NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &processInfo)) ShellExecuteExW(&info);
{
hsMessageBox("Failed to launch PhysX installer.\nPlease re-run URU to ensure you have the latest version.", "Error", hsMessageBoxNormal);
return false;
}
// let the user know what's going on // let the user know what's going on
HWND waitingDialog = ::CreateDialog(gHInst, MAKEINTRESOURCE(IDD_LOADING), NULL, WaitingForPhysXDialogProc); HWND waitingDialog = ::CreateDialog(gHInst, MAKEINTRESOURCE(IDD_LOADING), NULL, WaitingForPhysXDialogProc);
// run a loop to wait for it to quit, pumping the windows message queue intermittently // run a loop to wait for it to quit, pumping the windows message queue intermittently
DWORD waitRet = WaitForSingleObject(processInfo.hProcess, 100); DWORD waitRet = WaitForSingleObject(info.hProcess, 100);
MSG msg; MSG msg;
while (waitRet == WAIT_TIMEOUT) while (waitRet == WAIT_TIMEOUT)
{ {
@ -521,12 +517,11 @@ bool InitPhysX()
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg); DispatchMessage(&msg);
} }
waitRet = WaitForSingleObject(processInfo.hProcess, 100); waitRet = WaitForSingleObject(info.hProcess, 100);
} }
// cleanup // cleanup
CloseHandle(processInfo.hThread); CloseHandle(info.hProcess);
CloseHandle(processInfo.hProcess);
::DestroyWindow(waitingDialog); ::DestroyWindow(waitingDialog);
} }
else else

Loading…
Cancel
Save