Fixed: Mac Update to another 0.X package

Qstick 4 years ago
parent 62173c5258
commit e29e962bd5

@ -263,7 +263,7 @@ namespace NzbDrone.Common.Test
[Test]
public void GetUpdateClientExePath()
{
GetIAppDirectoryInfo().GetUpdateClientExePath().Should().BeEquivalentTo(@"C:\Temp\radarr_update\Radarr.Update.exe".AsOsAgnostic());
GetIAppDirectoryInfo().GetUpdateClientExePath(new Version("0.2.0.1480")).Should().BeEquivalentTo(@"C:\Temp\radarr_update\Radarr.Update.exe".AsOsAgnostic());
}
[Test]

@ -192,12 +192,12 @@ namespace NzbDrone.Common.Extensions
return directories;
}
public static string ProcessNameToExe(this string processName)
private static string ProcessNameToExe(this string processName, Version version)
{
// Windows always has exe (but is shunted to net core)
// Linux is kept on mono pending manual upgrade to net core so has .exe
// macOS is shunted to net core and does not have .exe
if (OsInfo.IsWindows || OsInfo.IsLinux)
if (OsInfo.IsWindows || OsInfo.IsLinux || version.Major == 0)
{
processName += ".exe";
}
@ -272,9 +272,9 @@ namespace NzbDrone.Common.Extensions
}
}
public static string GetUpdateClientExePath(this IAppFolderInfo appFolderInfo)
public static string GetUpdateClientExePath(this IAppFolderInfo appFolderInfo, Version version)
{
return Path.Combine(GetUpdateSandboxFolder(appFolderInfo), UPDATE_CLIENT_EXE_NAME).ProcessNameToExe();
return Path.Combine(GetUpdateSandboxFolder(appFolderInfo), UPDATE_CLIENT_EXE_NAME).ProcessNameToExe(version);
}
public static string GetBackupFolder(this IAppFolderInfo appFolderInfo)

@ -131,13 +131,13 @@ namespace NzbDrone.Core.Update
// Set executable flag on update app
if (OsInfo.IsOsx)
{
_diskProvider.SetPermissions(_appFolderInfo.GetUpdateClientExePath(), "0755", null, null);
_diskProvider.SetPermissions(_appFolderInfo.GetUpdateClientExePath(updatePackage.Version), "0755", null, null);
}
_logger.Info("Starting update client {0}", _appFolderInfo.GetUpdateClientExePath());
_logger.Info("Starting update client {0}", _appFolderInfo.GetUpdateClientExePath(updatePackage.Version));
_logger.ProgressInfo("Radarr will restart shortly.");
_processProvider.Start(_appFolderInfo.GetUpdateClientExePath(), GetUpdaterArgs(updateSandboxFolder));
_processProvider.Start(_appFolderInfo.GetUpdateClientExePath(updatePackage.Version), GetUpdaterArgs(updateSandboxFolder));
}
private void EnsureValidBranch(UpdatePackage package)

Loading…
Cancel
Save