mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
AutoUpdate improvements
This commit is contained in:
@@ -355,7 +355,7 @@ public static class AppConfig
|
|||||||
|
|
||||||
public static bool IsStrixLimitedRGB()
|
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()
|
public static bool IsStrixNumpad()
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ namespace GHelper.AutoUpdate
|
|||||||
|
|
||||||
string exeLocation = Application.ExecutablePath;
|
string exeLocation = Application.ExecutablePath;
|
||||||
string exeDir = Path.GetDirectoryName(exeLocation);
|
string exeDir = Path.GetDirectoryName(exeLocation);
|
||||||
|
string exeName = Path.GetFileName(exeLocation);
|
||||||
string zipLocation = exeDir + "\\" + zipName;
|
string zipLocation = exeDir + "\\" + zipName;
|
||||||
|
|
||||||
using (WebClient client = new WebClient())
|
using (WebClient client = new WebClient())
|
||||||
@@ -114,15 +115,27 @@ namespace GHelper.AutoUpdate
|
|||||||
client.DownloadFile(uri, zipLocation);
|
client.DownloadFile(uri, zipLocation);
|
||||||
|
|
||||||
Logger.WriteLine(requestUri);
|
Logger.WriteLine(requestUri);
|
||||||
Logger.WriteLine(zipLocation);
|
Logger.WriteLine(exeDir);
|
||||||
Logger.WriteLine(exeLocation);
|
Logger.WriteLine(zipName);
|
||||||
|
Logger.WriteLine(exeName);
|
||||||
|
|
||||||
var cmd = new Process();
|
string command = $"Start-Sleep -Seconds 1; Expand-Archive \"{zipName}\" -DestinationPath . -Force; Remove-Item \"{zipName}\" -Force; \".\\{exeName}\"; ";
|
||||||
cmd.StartInfo.UseShellExecute = false;
|
Logger.WriteLine(command);
|
||||||
cmd.StartInfo.CreateNoWindow = true;
|
|
||||||
cmd.StartInfo.FileName = "powershell";
|
try
|
||||||
cmd.StartInfo.Arguments = $"Start-Sleep -Seconds 1; Expand-Archive {zipLocation} -DestinationPath {exeDir} -Force; Remove-Item {zipLocation} -Force; {exeLocation}";
|
{
|
||||||
cmd.Start();
|
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();
|
Application.Exit();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user