aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs30
1 files changed, 29 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
index af3473a98..83790a56f 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
@@ -64,6 +64,11 @@ namespace Tango.PPC.UI.PPCApplication
public event EventHandler SystemRestartRequired;
/// <summary>
+ /// Occurs when the updater utility has failed to perform the last update.
+ /// </summary>
+ public event EventHandler UpdaterFailed;
+
+ /// <summary>
/// Occurs when the application has started.
/// </summary>
public event EventHandler ApplicationStarted;
@@ -140,6 +145,11 @@ namespace Tango.PPC.UI.PPCApplication
/// </summary>
public bool IsAfterUpdate { get; private set; }
+ /// <summary>
+ /// Gets a value indicating whether the updater utility has failed to perform the last update.
+ /// </summary>
+ public bool IsUpdateFailed { get; private set; }
+
private bool _isScreenLocked;
/// <summary>
/// Gets or sets a value indicating whether the screen is currently locked.
@@ -264,6 +274,18 @@ namespace Tango.PPC.UI.PPCApplication
}
}
+ if (App.StartupArgs.Contains("-update_failed"))
+ {
+ LogManager.Log("Application started with '-update_failed' startup arguments. The updater utility has failed.");
+
+ IsUpdateFailed = true;
+
+ settings.ApplicationState = ApplicationStates.Ready;
+ settings.Save();
+ UpdaterFailed?.Invoke(this, new EventArgs());
+ return;
+ }
+
if (settings.ApplicationState == ApplicationStates.Ready)
{
LogManager.Log("Initializing ObservablesStaticCollections...");
@@ -616,7 +638,13 @@ namespace Tango.PPC.UI.PPCApplication
}
LogManager.Log($"Executing '{updaterPath}' with arguments '{arguments}'...");
- Process.Start(updaterPath, arguments);
+
+ Process p = new Process();
+ p.StartInfo.FileName = updaterPath;
+ p.StartInfo.Arguments = arguments;
+ p.StartInfo.LoadUserProfile = true;
+ p.StartInfo.UseShellExecute = true;
+ p.Start();
LogManager.Log("Terminating application...");
Environment.Exit(0);