fix update script error
This commit is contained in:
@@ -110,7 +110,10 @@ namespace Blueberry
|
||||
string currentExe = Process.GetCurrentProcess().MainModule.FileName;
|
||||
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");
|
||||
File.WriteAllText(psPath, psScript);
|
||||
|
||||
@@ -119,9 +122,9 @@ namespace Blueberry
|
||||
{
|
||||
FileName = "powershell.exe",
|
||||
Arguments = $"-NoProfile -ExecutionPolicy Bypass -File \"{psPath}\"",
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true,
|
||||
WindowStyle = ProcessWindowStyle.Hidden
|
||||
UseShellExecute = true,
|
||||
CreateNoWindow = false,
|
||||
WindowStyle = ProcessWindowStyle.Normal
|
||||
};
|
||||
|
||||
Process.Start(startInfo);
|
||||
|
||||
Reference in New Issue
Block a user