Skip to content

Commit

Permalink
removed reference to Squirrel.Windows installer
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianSuess committed Aug 15, 2022
1 parent a9cd421 commit c4bad8d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 54 deletions.
80 changes: 40 additions & 40 deletions source/Xeno.ToolsHub/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Xeno.ToolsHub
using System.Threading.Tasks;
using System.Windows.Forms;
#if USE_SQUIRREL
using Squirrel;
////using Squirrel;
#endif
using Xeno.ToolsHub.Config;
using Xeno.ToolsHub.Services.Logging;
Expand Down Expand Up @@ -78,45 +78,45 @@ private static async Task SquirrelAutoUpdateAsync()
await Task.Yield();

#if USE_SQUIRREL
try
{
ReleaseEntry release = null;

// TODO: Network creds https://github.com/Squirrel/Squirrel.Windows/issues/946
using (var mgr = new UpdateManager(Constants.RemoteUpdateStablePath))
{
SquirrelAwareApp.HandleEvents(
onInitialInstall: _ => mgr.CreateShortcutForThisExe(),
onAppUpdate: _ => mgr.CreateShortcutForThisExe(),
onAppUninstall: _ => mgr.RemoveShortcutForThisExe(),
onFirstRun: SquirrelWelcomeMessage);

UpdateInfo updateInfo = await mgr.CheckForUpdate();
if (updateInfo.ReleasesToApply.Any())
{
Log.Debug("Update found! Applying it to application...");
release = await mgr.UpdateApp();
}
else
{
Log.Debug("No updates found in repository.");
}
}

if (release != null)
{
Log.Debug("Restarting application...");
UpdateManager.RestartApp();
}
else
{
Log.Debug("No updates are required.");
}
}
catch (Exception exUpdate)
{
Log.Error($"Issue looking for updates. {exUpdate.Message}");
}
////try
////{
//// ReleaseEntry release = null;
////
//// // TODO: Network creds https://github.com/Squirrel/Squirrel.Windows/issues/946
//// using (var mgr = new UpdateManager(Constants.RemoteUpdateStablePath))
//// {
//// SquirrelAwareApp.HandleEvents(
//// onInitialInstall: _ => mgr.CreateShortcutForThisExe(),
//// onAppUpdate: _ => mgr.CreateShortcutForThisExe(),
//// onAppUninstall: _ => mgr.RemoveShortcutForThisExe(),
//// onFirstRun: SquirrelWelcomeMessage);
////
//// UpdateInfo updateInfo = await mgr.CheckForUpdate();
//// if (updateInfo.ReleasesToApply.Any())
//// {
//// Log.Debug("Update found! Applying it to application...");
//// release = await mgr.UpdateApp();
//// }
//// else
//// {
//// Log.Debug("No updates found in repository.");
//// }
//// }
////
//// if (release != null)
//// {
//// Log.Debug("Restarting application...");
//// UpdateManager.RestartApp();
//// }
//// else
//// {
//// Log.Debug("No updates are required.");
//// }
////}
////catch (Exception exUpdate)
////{
//// Log.Error($"Issue looking for updates. {exUpdate.Message}");
////}
#else
Log.Debug($"Squirrel Updater is not enabled.");
#endif
Expand Down
13 changes: 0 additions & 13 deletions source/Xeno.ToolsHub/Xeno.ToolsHub.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\squirrel.windows.2.0.1\build\squirrel.windows.props" Condition="Exists('..\packages\squirrel.windows.2.0.1\build\squirrel.windows.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -64,18 +63,12 @@
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\squirrel.windows.2.0.1\lib\Net45\NuGet.Squirrel.dll</HintPath>
</Reference>
<Reference Include="SharpCompress, Version=0.17.1.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
<HintPath>..\packages\SharpCompress.0.17.1\lib\net45\SharpCompress.dll</HintPath>
</Reference>
<Reference Include="Splat, Version=1.6.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Splat.1.6.2\lib\Net45\Splat.dll</HintPath>
</Reference>
<Reference Include="Squirrel, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\squirrel.windows.2.0.1\lib\Net45\Squirrel.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand Down Expand Up @@ -239,10 +232,4 @@
<Analyzer Include="..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\squirrel.windows.2.0.1\build\squirrel.windows.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\squirrel.windows.2.0.1\build\squirrel.windows.props'))" />
</Target>
</Project>
1 change: 0 additions & 1 deletion source/Xeno.ToolsHub/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ Copyright Xeno Innovations, Inc. 2018
<package id="NuGet.CommandLine" version="4.9.4" targetFramework="net461" developmentDependency="true" />
<package id="SharpCompress" version="0.17.1" targetFramework="net461" />
<package id="Splat" version="1.6.2" targetFramework="net461" />
<package id="squirrel.windows" version="2.0.1" targetFramework="net461" />
<package id="StyleCop.Analyzers" version="1.1.118" targetFramework="net461" developmentDependency="true" />
</packages>

0 comments on commit c4bad8d

Please sign in to comment.