Left: | ||
Right: |
OLD | NEW |
---|---|
1 #include <stdexcept> | 1 #include <stdexcept> |
2 #include <functional> | 2 #include <functional> |
3 #include <wctype.h> | 3 #include <wctype.h> |
4 // <thread> is C++11, but implemented in VS2012 | 4 // <thread> is C++11, but implemented in VS2012 |
5 #include <thread> | 5 #include <thread> |
6 | 6 |
7 #include "installer-lib.h" | 7 #include "installer-lib.h" |
8 #include "process.h" | 8 #include "process.h" |
9 #include "handle.h" | 9 #include "handle.h" |
10 #include "session.h" | 10 #include "session.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
271 case 3 : | 271 case 3 : |
272 { | 272 { |
273 /* | 273 /* |
274 * Send WM_CLOSE to every admissible window. | 274 * Send WM_CLOSE to every admissible window. |
275 */ | 275 */ |
276 send_message m( WM_CLOSE, 0, 0 ) ; | 276 send_message m( WM_CLOSE, 0, 0 ) ; |
277 iterate_our_windows( m ) ; | 277 iterate_our_windows( m ) ; |
278 } | 278 } |
279 break ; | 279 break ; |
280 | 280 |
281 default : | 281 case 4: |
282 /* | 282 /* |
283 * We're out of ways to try to shut down. | 283 * We're out of ways to try to shut down. Oh well. Take cover. It gets viol ent here. |
Eric
2015/03/20 08:53:16
Should restore the first half of the comment to it
| |
284 */ | 284 */ |
285 return false ; | 285 for (auto it = pid_set.begin(); it != pid_set.end(); ++it) |
286 { | |
287 HANDLE tmpHandle = OpenProcess(PROCESS_TERMINATE, FALSE, *it); | |
288 if (!tmpHandle) continue; | |
289 Windows_Handle procHandle(tmpHandle); | |
290 TerminateProcess(tmpHandle, 0); | |
Eric
2015/03/20 08:53:16
Given how unreliable it's turning out to be to shu
sergei
2015/04/02 08:04:09
Merely want to add that MSI is already configured
sergei
2015/04/02 08:04:09
As well as it would be good to log the state to be
Eric
2015/05/14 15:09:25
The process 'msiexec.exe' runs with elevated privi
| |
291 } | |
292 break; | |
293 | |
294 default: | |
295 return false; | |
286 } | 296 } |
287 | 297 |
288 /* | 298 /* |
289 * Wait loop. | 299 * Wait loop. |
290 */ | 300 */ |
291 for ( unsigned int j = 0 ; j < 50 ; ++ j ) | 301 for ( unsigned int j = 0 ; j < 50 ; ++ j ) |
292 { | 302 { |
293 std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) ) ; | 303 std::this_thread::sleep_for( std::chrono::milliseconds( 30 ) ) ; |
294 Refresh() ; | 304 Refresh() ; |
295 if ( ! IsRunning() ) | 305 if ( ! IsRunning() ) |
296 { | 306 { |
297 return true ; | 307 return true ; |
298 } | 308 } |
299 } | 309 } |
300 // Assert is_running() | 310 // Assert is_running() |
301 } | 311 } |
302 // No control path leaves the for-loop. | 312 // No control path leaves the for-loop. |
303 } ; | 313 } ; |
304 | 314 |
OLD | NEW |