diff --git a/app/AppConfig.cs b/app/AppConfig.cs index ce849678..63e70f1c 100644 --- a/app/AppConfig.cs +++ b/app/AppConfig.cs @@ -355,7 +355,7 @@ public static class AppConfig public static bool IsStrixLimitedRGB() { - return ContainsModel("G614JV") || ContainsModel("G614JZ") || ContainsModel("G512LI") || ContainsModel("G513R") || ContainsModel("G713PV") || ContainsModel("G513IE") || ContainsModel("G513QM") || ContainsModel("G713RC"); + return ContainsModel("G614JV") || ContainsModel("G614JZ") || ContainsModel("G512LI") || ContainsModel("G513R") || ContainsModel("G713PV") || ContainsModel("G513IE") || ContainsModel("G713RC"); } public static bool IsStrixNumpad() diff --git a/app/AutoUpdate/AutoUpdateControl.cs b/app/AutoUpdate/AutoUpdateControl.cs index e0759e38..91207948 100644 --- a/app/AutoUpdate/AutoUpdateControl.cs +++ b/app/AutoUpdate/AutoUpdateControl.cs @@ -107,6 +107,7 @@ namespace GHelper.AutoUpdate string exeLocation = Application.ExecutablePath; string exeDir = Path.GetDirectoryName(exeLocation); + string exeName = Path.GetFileName(exeLocation); string zipLocation = exeDir + "\\" + zipName; using (WebClient client = new WebClient()) @@ -114,15 +115,27 @@ namespace GHelper.AutoUpdate client.DownloadFile(uri, zipLocation); Logger.WriteLine(requestUri); - Logger.WriteLine(zipLocation); - Logger.WriteLine(exeLocation); + Logger.WriteLine(exeDir); + Logger.WriteLine(zipName); + Logger.WriteLine(exeName); - var cmd = new Process(); - cmd.StartInfo.UseShellExecute = false; - cmd.StartInfo.CreateNoWindow = true; - cmd.StartInfo.FileName = "powershell"; - cmd.StartInfo.Arguments = $"Start-Sleep -Seconds 1; Expand-Archive {zipLocation} -DestinationPath {exeDir} -Force; Remove-Item {zipLocation} -Force; {exeLocation}"; - cmd.Start(); + string command = $"Start-Sleep -Seconds 1; Expand-Archive \"{zipName}\" -DestinationPath . -Force; Remove-Item \"{zipName}\" -Force; \".\\{exeName}\"; "; + Logger.WriteLine(command); + + try + { + var cmd = new Process(); + cmd.StartInfo.WorkingDirectory = exeDir; + cmd.StartInfo.UseShellExecute = false; + cmd.StartInfo.CreateNoWindow = true; + cmd.StartInfo.FileName = "powershell"; + cmd.StartInfo.Arguments = command; + cmd.Start(); + } + catch (Exception ex) + { + Logger.WriteLine(ex.Message); + } Application.Exit(); }