fix update script error

This commit is contained in:
2025-12-15 13:57:33 +01:00
parent 76cfb440b9
commit 4eadf368f2

View File

@@ -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);