From 45416254e8699bd4e62b2b9b9cf9ee7b45b01a5c Mon Sep 17 00:00:00 2001 From: Nathan Crawford Date: Fri, 14 Sep 2007 20:24:39 +0000 Subject: [PATCH] Small updates to deployment classes/info --- embroideryReader/nc_Update.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/embroideryReader/nc_Update.cs b/embroideryReader/nc_Update.cs index 8228252..0275990 100644 --- a/embroideryReader/nc_Update.cs +++ b/embroideryReader/nc_Update.cs @@ -29,7 +29,7 @@ namespace UpdateTester //don't complain lastError = ex.Message; } - updateInfo = new nc_settings.IniFile (Path.Combine(Path.Combine(nc_settings.IniFile .appPath(), "update"), "update.ini")); + updateInfo = new nc_settings.IniFile(Path.Combine(Path.Combine(nc_settings.IniFile.appPath(), "update"), "update.ini")); } public string VersionAvailable() @@ -85,12 +85,19 @@ namespace UpdateTester filename = updateInfo.getValue("files", "file" + i.ToString()); downloader.DownloadFile(new Uri(updateURI, filename), Path.Combine(Path.Combine(nc_settings.IniFile.appPath(), "update"), filename)); } - if (!System.IO.File.Exists(System.IO.Path.Combine(nc_settings.IniFile.appPath(), "UpdateInstaller.exe"))) + if (updateInfo.getValue("files", "executeFile") != null) { - lastError = "UpdateInstaller.exe not found"; + System.Diagnostics.Process.Start(Path.Combine(nc_settings.IniFile.appPath(), updateInfo.getValue("executeFile"))); + } + else if (System.IO.File.Exists(Path.Combine(nc_settings.IniFile.appPath(), "UpdateInstaller.exe"))) + { + System.Diagnostics.Process.Start(Path.Combine(Path.Combine(nc_settings.IniFile.appPath(), "update"), "UpdateInstaller.exe"), System.Diagnostics.Process.GetCurrentProcess().Id.ToString()); + } + else + { + lastError = "The update didn't have an executable file and UpdateInstaller.exe was not found"; return false; } - System.Diagnostics.Process.Start(System.IO.Path.Combine(nc_settings.IniFile.appPath(), "UpdateInstaller.exe"), System.Diagnostics.Process.GetCurrentProcess().Id.ToString()); } catch (Exception ex) {