diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index e1f6ec655..f99ff8623 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -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" diff --git a/Wox.Core/Configuration/Portable.cs b/Wox.Core/Configuration/Portable.cs index ee916001b..e84e51f9c 100644 --- a/Wox.Core/Configuration/Portable.cs +++ b/Wox.Core/Configuration/Portable.cs @@ -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); } } diff --git a/Wox.Core/Wox.Core.csproj b/Wox.Core/Wox.Core.csproj index a1e12c40d..904a8693c 100644 --- a/Wox.Core/Wox.Core.csproj +++ b/Wox.Core/Wox.Core.csproj @@ -54,7 +54,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Wox.Infrastructure/Constant.cs b/Wox.Infrastructure/Constant.cs index 78a08ca69..18d693186 100644 --- a/Wox.Infrastructure/Constant.cs +++ b/Wox.Infrastructure/Constant.cs @@ -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"); diff --git a/Wox/PublicAPIInstance.cs b/Wox/PublicAPIInstance.cs index 6c17be5c5..7dfd4dbf7 100644 --- a/Wox/PublicAPIInstance.cs +++ b/Wox/PublicAPIInstance.cs @@ -63,7 +63,7 @@ namespace Wox // which will cause ungraceful exit SaveAppAllSettings(); - UpdateManager.RestartApp(); + UpdateManager.RestartApp(Constant.ApplicationFileName); } public void CheckForNewUpdate()