Index: main.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/main.cc,v retrieving revision 2.75 diff -u -r2.75 main.cc --- main.cc 18 Nov 2013 11:16:14 -0000 2.75 +++ main.cc 6 Mar 2014 12:02:16 -0000 @@ -295,6 +295,7 @@ sei.lpVerb = "runas"; sei.lpFile = exe_path; sei.nShow = SW_NORMAL; + sei.fMask |= SEE_MASK_NOCLOSEPROCESS; // Avoid another isRunAsAdmin check in the child. std::string command_line_cs (command_line); @@ -322,6 +323,11 @@ } else exit_msg = IDS_ELEVATED; + + // Wait until child process is finished + if (sei.hProcess != NULL) + WaitForSingleObject (sei.hProcess, INFINITE); + // Once we are set on course to privilege elevate, the parent // process is unnecessary. goto finish_up;