Browse Source

Remove MSIX-specific code paths in ILSpy

pull/2642/head
Christoph Wille 3 years ago
parent
commit
a4ecc5e81c
  1. 9
      ILSpy/AboutPage.cs
  2. 5
      ILSpy/Commands/CheckForUpdatesCommand.cs
  3. 1
      ILSpy/ILSpy.csproj
  4. 6
      ILSpy/MainWindow.xaml.cs
  5. 26
      ILSpy/StorePackageHelper.cs

9
ILSpy/AboutPage.cs

@ -65,12 +65,6 @@ namespace ICSharpCode.ILSpy
string prodVersion = System.Diagnostics.FileVersionInfo.GetVersionInfo(typeof(Uri).Assembly.Location).ProductVersion; string prodVersion = System.Diagnostics.FileVersionInfo.GetVersionInfo(typeof(Uri).Assembly.Location).ProductVersion;
output.WriteLine(Resources.NETFrameworkVersion + prodVersion); output.WriteLine(Resources.NETFrameworkVersion + prodVersion);
if (StorePackageHelper.HasPackageIdentity)
{
output.WriteLine($"Package Name: {StorePackageHelper.GetPackageFamilyName()}");
}
else
{// if we're running in an MSIX, updates work differently
output.AddUIElement( output.AddUIElement(
delegate { delegate {
StackPanel stackPanel = new StackPanel(); StackPanel stackPanel = new StackPanel();
@ -97,7 +91,6 @@ namespace ICSharpCode.ILSpy
}; };
}); });
output.WriteLine(); output.WriteLine();
}
foreach (var plugin in App.ExportProvider.GetExportedValues<IAboutPageAddition>()) foreach (var plugin in App.ExportProvider.GetExportedValues<IAboutPageAddition>())
plugin.Write(output); plugin.Write(output);
@ -303,7 +296,7 @@ namespace ICSharpCode.ILSpy
UpdateSettings s = new UpdateSettings(spySettings); UpdateSettings s = new UpdateSettings(spySettings);
// If we're in an MSIX package, updates work differently // If we're in an MSIX package, updates work differently
if (s.AutomaticUpdateCheckEnabled && !StorePackageHelper.HasPackageIdentity) if (s.AutomaticUpdateCheckEnabled)
{ {
// perform update check if we never did one before; // perform update check if we never did one before;
// or if the last check wasn't in the past 7 days // or if the last check wasn't in the past 7 days

5
ILSpy/Commands/CheckForUpdatesCommand.cs

@ -26,11 +26,6 @@ namespace ICSharpCode.ILSpy
{ {
public override bool CanExecute(object parameter) public override bool CanExecute(object parameter)
{ {
if (StorePackageHelper.HasPackageIdentity)
{
return false;
}
return base.CanExecute(parameter); return base.CanExecute(parameter);
} }

1
ILSpy/ILSpy.csproj

@ -45,7 +45,6 @@
<PackageReference Include="Microsoft.VisualStudio.Composition" Version="16.9.20" /> <PackageReference Include="Microsoft.VisualStudio.Composition" Version="16.9.20" />
<PackageReference Include="System.Composition" Version="$(SystemCompositionVersion)" /> <PackageReference Include="System.Composition" Version="$(SystemCompositionVersion)" />
<PackageReference Include="Mono.Cecil" Version="$(MonoCecilVersion)" /> <PackageReference Include="Mono.Cecil" Version="$(MonoCecilVersion)" />
<PackageReference Include="OSVersionHelper" Version="1.1.24" />
<PackageReference Include="DataGridExtensions" Version="2.5.13" /> <PackageReference Include="DataGridExtensions" Version="2.5.13" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" /> <PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
<PackageReference Include="TomsToolbox.Wpf.Styles" Version="$(WpfStylesToolboxVersion)" /> <PackageReference Include="TomsToolbox.Wpf.Styles" Version="$(WpfStylesToolboxVersion)" />

6
ILSpy/MainWindow.xaml.cs

@ -932,12 +932,6 @@ namespace ICSharpCode.ILSpy
public async Task ShowMessageIfUpdatesAvailableAsync(ILSpySettings spySettings, bool forceCheck = false) public async Task ShowMessageIfUpdatesAvailableAsync(ILSpySettings spySettings, bool forceCheck = false)
{ {
// Don't check for updates if we're in an MSIX since they work differently
if (StorePackageHelper.HasPackageIdentity)
{
return;
}
string downloadUrl; string downloadUrl;
if (forceCheck) if (forceCheck)
{ {

26
ILSpy/StorePackageHelper.cs

@ -1,26 +0,0 @@
using OSVersionHelper;
namespace ICSharpCode.ILSpy
{
// The Store package is ever only built for net472
public static class StorePackageHelper
{
public static bool HasPackageIdentity {
get {
#if NET472
return WindowsVersionHelper.HasPackageIdentity;
#else
return false;
#endif
}
}
public static string GetPackageFamilyName()
{
#if NET472
return WindowsVersionHelper.GetPackageFamilyName();
#else
return "";
#endif
}
}
}
Loading…
Cancel
Save