Change ppy.squirrel.windows back to squirrel.windows 1.5.2:

- ppy.squirrel is not fully .net core upgraded, so it is still showing restored using .net framework
- does not contain .net core runtime installer which is now required by Wox
- UpdateManager.RestartApp method is throwing an OSU application specific error which Wox is unable to resolve.
- Squirrel.Windows 1.5.2 still works and functionalities required by Wox are compatible. Tested RestartApp method, tested enable/disable protable mode methods and tested updating Wox to the latest version.
This commit is contained in:
Jeremy Wu 2020-04-08 18:51:35 +10:00
parent f1961e71dc
commit 530d2c0962
5 changed files with 14 additions and 14 deletions

View file

@ -40,7 +40,7 @@ function Copy-Resources ($path, $config) {
Copy-Item -Recurse -Force $path\Plugins\HelloWorldPython $target\Plugins\HelloWorldPython
Copy-Item -Recurse -Force $path\JsonRPC $target\JsonRPC
# making version static as multiple versions can exist in the nuget folder and in the case a breaking change is introduced.
Copy-Item -Force $env:USERPROFILE\.nuget\packages\ppy.squirrel.windows\1.9.0.4\tools\Squirrel.exe $output\Update.exe
Copy-Item -Force $env:USERPROFILE\.nuget\packages\squirrel.windows\1.5.2\tools\Squirrel.exe $output\Update.exe
}
function Delete-Unused ($path, $config) {
@ -98,7 +98,7 @@ function Pack-Squirrel-Installer ($path, $version, $output) {
$icon = "$path\Wox\Resources\app.ico"
Write-Host "icon: $icon"
# Squirrel.com: https://github.com/Squirrel/Squirrel.Windows/issues/369
New-Alias Squirrel $env:USERPROFILE\.nuget\packages\ppy.squirrel.windows\1.9.0.4\tools\Squirrel.exe -Force
New-Alias Squirrel $env:USERPROFILE\.nuget\packages\squirrel.windows\1.5.2\tools\Squirrel.exe -Force
# why we need Write-Output: https://github.com/Squirrel/Squirrel.Windows/issues/489#issuecomment-156039327
# directory of releaseDir in squirrel can't be same as directory ($nupkg) in releasify
$temp = "$output\Temp"

View file

@ -39,7 +39,7 @@ namespace Wox.Core.Configuration
MessageBox.Show("Wox needs to restart to finish disabling portable mode, " +
"after the restart your portable data profile will be deleted and roaming data profile kept");
UpdateManager.RestartApp();
UpdateManager.RestartApp(Constant.ApplicationFileName);
}
catch (Exception e)
{
@ -67,7 +67,7 @@ namespace Wox.Core.Configuration
MessageBox.Show("Wox needs to restart to finish enabling portable mode, " +
"after the restart your roaming data profile will be deleted and portable data profile kept");
UpdateManager.RestartApp();
UpdateManager.RestartApp(Constant.ApplicationFileName);
}
catch (Exception e)
{
@ -82,10 +82,9 @@ namespace Wox.Core.Configuration
{
using (var portabilityUpdater = NewUpdateManager())
{
var exeName = Constant.Wox + ".exe";
portabilityUpdater.RemoveShortcutsForExecutable(exeName, ShortcutLocation.StartMenu);
portabilityUpdater.RemoveShortcutsForExecutable(exeName, ShortcutLocation.Desktop);
portabilityUpdater.RemoveShortcutsForExecutable(exeName, ShortcutLocation.Startup);
portabilityUpdater.RemoveShortcutsForExecutable(Constant.ApplicationFileName, ShortcutLocation.StartMenu);
portabilityUpdater.RemoveShortcutsForExecutable(Constant.ApplicationFileName, ShortcutLocation.Desktop);
portabilityUpdater.RemoveShortcutsForExecutable(Constant.ApplicationFileName, ShortcutLocation.Startup);
}
}
@ -112,10 +111,9 @@ namespace Wox.Core.Configuration
{
using (var portabilityUpdater = NewUpdateManager())
{
var exeName = Constant.Wox + ".exe";
portabilityUpdater.CreateShortcutsForExecutable(exeName, ShortcutLocation.StartMenu, false);
portabilityUpdater.CreateShortcutsForExecutable(exeName, ShortcutLocation.Desktop, false);
portabilityUpdater.CreateShortcutsForExecutable(exeName, ShortcutLocation.Startup, false);
portabilityUpdater.CreateShortcutsForExecutable(Constant.ApplicationFileName, ShortcutLocation.StartMenu, false);
portabilityUpdater.CreateShortcutsForExecutable(Constant.ApplicationFileName, ShortcutLocation.Desktop, false);
portabilityUpdater.CreateShortcutsForExecutable(Constant.ApplicationFileName, ShortcutLocation.Startup, false);
}
}

View file

@ -54,7 +54,7 @@
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="ppy.squirrel.windows" Version="1.9.0.4" />
<PackageReference Include="squirrel.windows" Version="1.5.2" />
<PackageReference Include="PropertyChanged.Fody" Version="2.2.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

View file

@ -9,6 +9,8 @@ namespace Wox.Infrastructure
public const string Wox = "Wox";
public const string Plugins = "Plugins";
public const string ApplicationFileName = Wox + ".exe";
private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
public static readonly string ProgramDirectory = Directory.GetParent(Assembly.Location.NonNull()).ToString();
public static readonly string ExecutablePath = Path.Combine(ProgramDirectory, Wox + ".exe");

View file

@ -63,7 +63,7 @@ namespace Wox
// which will cause ungraceful exit
SaveAppAllSettings();
UpdateManager.RestartApp();
UpdateManager.RestartApp(Constant.ApplicationFileName);
}
public void CheckForNewUpdate()