diff --git a/Blueberry/UpdateManager.cs b/Blueberry/UpdateManager.cs index bfa268e..78d2042 100644 --- a/Blueberry/UpdateManager.cs +++ b/Blueberry/UpdateManager.cs @@ -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);