diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-12-17 16:22:49 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-12-17 16:22:49 +0200 |
| commit | 50433ea885a3ebdc6a55f733c9083b6e07c2cb3e (patch) | |
| tree | 878e54f684fa24aae504b9dda006f4068bb86353 /Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs | |
| parent | 39cf804612a97dfb848ac308a1b40bafc3780783 (diff) | |
| parent | f0f46e7e560cf5e9999e5ba9904634f01176f27e (diff) | |
| download | Tango-50433ea885a3ebdc6a55f733c9083b6e07c2cb3e.tar.gz Tango-50433ea885a3ebdc6a55f733c9083b6e07c2cb3e.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs | 30 |
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); |
