fix update script error
This commit is contained in:
@@ -110,7 +110,10 @@ namespace Blueberry
|
|||||||
string currentExe = Process.GetCurrentProcess().MainModule.FileName;
|
string currentExe = Process.GetCurrentProcess().MainModule.FileName;
|
||||||
string appDir = AppDomain.CurrentDomain.BaseDirectory;
|
string appDir = AppDomain.CurrentDomain.BaseDirectory;
|
||||||
|
|
||||||
string psScript = Constants.UpdateScript;
|
string psScript = Constants.UpdateScript
|
||||||
|
.Replace("{currentExe}", $"{currentExe}")
|
||||||
|
.Replace("{tempZip}", $"{tempZip}")
|
||||||
|
.Replace("{appDir}", $"{appDir}");
|
||||||
string psPath = Path.Combine(Path.GetTempPath(), "blueberry_updater.ps1");
|
string psPath = Path.Combine(Path.GetTempPath(), "blueberry_updater.ps1");
|
||||||
File.WriteAllText(psPath, psScript);
|
File.WriteAllText(psPath, psScript);
|
||||||
|
|
||||||
@@ -119,9 +122,9 @@ namespace Blueberry
|
|||||||
{
|
{
|
||||||
FileName = "powershell.exe",
|
FileName = "powershell.exe",
|
||||||
Arguments = $"-NoProfile -ExecutionPolicy Bypass -File \"{psPath}\"",
|
Arguments = $"-NoProfile -ExecutionPolicy Bypass -File \"{psPath}\"",
|
||||||
UseShellExecute = false,
|
UseShellExecute = true,
|
||||||
CreateNoWindow = true,
|
CreateNoWindow = false,
|
||||||
WindowStyle = ProcessWindowStyle.Hidden
|
WindowStyle = ProcessWindowStyle.Normal
|
||||||
};
|
};
|
||||||
|
|
||||||
Process.Start(startInfo);
|
Process.Start(startInfo);
|
||||||
|
|||||||
Reference in New Issue
Block a user