Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
bug fix in update manager
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay committed Dec 26, 2023
1 parent 73e6b5e commit f7bd4c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
14 changes: 3 additions & 11 deletions src/Squirrel/UpdateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ await DownloadAndApplyDeltaUpdates(deltaStagingDir, updates, x => Utility.Calcul
/// <param name="silent"></param>
public void ApplyUpdatesAndExit(bool silent = false)
{
RunApplyUpdates(silent, false, null, null);
RunApplyUpdates(silent, false, null);
Environment.Exit(0);
}

Expand All @@ -256,7 +256,7 @@ public void ApplyUpdatesAndExit(bool silent = false)
/// <param name="restartArgs">The arguments to pass to the application when it is restarted.</param>
public void ApplyUpdatesAndRestart(string[] restartArgs = null)
{
RunApplyUpdates(false, true, null, restartArgs);
RunApplyUpdates(false, true, restartArgs);
Environment.Exit(0);
}

Expand All @@ -268,9 +268,8 @@ public void ApplyUpdatesAndRestart(string[] restartArgs = null)
/// a new framework dependency.</param>
/// <param name="restart">If true, restarts the application after updates are applied (or if they failed)</param>
/// <param name="restartArgs">The arguments to pass to the application when it is restarted.</param>
/// <param name="exeName">The name or relative path to the binary to restart.</param>
/// <exception cref="Exception"></exception>
protected virtual void RunApplyUpdates(bool silent, bool restart, string exeName, string[] restartArgs)
protected virtual void RunApplyUpdates(bool silent, bool restart, string[] restartArgs)
{
var psi = new ProcessStartInfo() {
CreateNoWindow = true,
Expand All @@ -283,13 +282,6 @@ protected virtual void RunApplyUpdates(bool silent, bool restart, string exeName
args.Add("apply");
args.Add("--wait");
if (restart) args.Add("--restart");

try {
args.Add(exeName ?? Locator.ThisExeRelativePath); // optional
} catch (Exception ex) {
Log.Error(ex, "Failed to find relative path to this executable.");
}

if (restart && restartArgs != null && restartArgs.Length > 0) {
args.Add("--");
foreach (var a in restartArgs) {
Expand Down
6 changes: 1 addition & 5 deletions test/Squirrel.Tests/Squirrel.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Condition =" '$(CurrentOsName)'=='Windows' ">
<TargetFrameworks>net8.0;net48</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition =" '$(CurrentOsName)'=='OSX' ">
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>

Expand Down

0 comments on commit f7bd4c6

Please sign in to comment.