Commit c4e031e
committed
Fix duplicate window and cancel dialog bugs
Bug Fixes:
1. Fixed cancel button opening new window instead of exiting
- Changed ShowInstallationScopeDialog to return bool
- Return false on cancel, true on continue
- Close form immediately in constructor when cancelled
- Prevents form from showing after user cancels
2. Fixed duplicate windows when selecting system-wide installation
- Changed from Application.Exit() to Environment.Exit(0)
- Ensures immediate process termination after starting elevated instance
- Prevents non-elevated instance from continuing to run
- Only elevated instance remains open
Technical Changes:
- ShowInstallationScopeDialog now returns bool success status
- Constructor checks return value and closes form if cancelled
- Use Environment.Exit(0) for successful elevation restart
- Use Environment.Exit(1) for failed elevation
- Immediate termination prevents race conditions1 parent ddca811 commit c4e031e
1 file changed
+11
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
| |||
330 | 335 | | |
331 | 336 | | |
332 | 337 | | |
333 | | - | |
| 338 | + | |
334 | 339 | | |
335 | 340 | | |
336 | 341 | | |
| |||
433 | 438 | | |
434 | 439 | | |
435 | 440 | | |
| 441 | + | |
436 | 442 | | |
437 | 443 | | |
438 | 444 | | |
439 | 445 | | |
440 | | - | |
| 446 | + | |
441 | 447 | | |
442 | 448 | | |
443 | 449 | | |
| |||
463 | 469 | | |
464 | 470 | | |
465 | 471 | | |
466 | | - | |
| 472 | + | |
467 | 473 | | |
468 | 474 | | |
469 | 475 | | |
470 | 476 | | |
471 | 477 | | |
472 | 478 | | |
473 | 479 | | |
474 | | - | |
| 480 | + | |
475 | 481 | | |
476 | 482 | | |
477 | 483 | | |
| |||
0 commit comments