Skip to content

Commit 585baae

Browse files
committed
fix restart exceptions
1 parent 1a8aabd commit 585baae

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

FlashpointSecurePlayer/FlashpointSecurePlayerGUI.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ private void RestartApplication(bool runAsAdministrator, ref Mutex applicationMu
243243
LogExceptionToLauncher(ex);
244244
Show();
245245
ShowErrorFatal(Properties.Resources.ProcessUnableToStart);
246-
throw new Exceptions.ApplicationRestartRequiredException("The application failed to restart.");
246+
throw new ApplicationRestartRequiredException("The application failed to restart.");
247247
}
248248
}
249249

@@ -280,11 +280,16 @@ the program to enter an infinite restart loop
280280

281281
RestartApplication(true, ref applicationMutex);
282282
}
283+
} catch (InvalidModificationException ex) {
284+
// abort the operation
285+
LogExceptionToLauncher(ex);
286+
throw;
283287
} catch (Exception ex) {
288+
// failed to restart
284289
LogExceptionToLauncher(ex);
285290
}
286291

287-
// we're already running as admin?
292+
// we're already running as admin or failed to restart
288293
ShowError(String.Format(Properties.Resources.GameUnableToLaunch, Properties.Resources.AsAdministratorUser));
289294
throw new InvalidModificationException("The Modification failed to run as Administrator User.");
290295
}
@@ -294,7 +299,12 @@ private void AskLaunchWithCompatibilitySettings() {
294299
AskLaunch(Properties.Resources.WithCompatibilitySettings);
295300

296301
RestartApplication(false, ref applicationMutex);
302+
} catch (InvalidModificationException ex) {
303+
// abort the operation
304+
LogExceptionToLauncher(ex);
305+
throw;
297306
} catch (Exception ex) {
307+
// failed to restart
298308
LogExceptionToLauncher(ex);
299309
}
300310

@@ -360,7 +370,12 @@ private void AskLaunchWithOldCPUSimulator() {
360370
HideWindow(ref processStartInfo);
361371

362372
RestartApplication(false, ref applicationMutex, processStartInfo);
373+
} catch (InvalidModificationException ex) {
374+
// abort the operation
375+
LogExceptionToLauncher(ex);
376+
throw;
363377
} catch (Exception ex) {
378+
// failed to restart
364379
LogExceptionToLauncher(ex);
365380
}
366381

0 commit comments

Comments
 (0)