Skip to content
Permalink
Browse files

Merge pull request #1522 from onovotny/msix

Add MSIX support
  • Loading branch information...
christophwille committed Jun 9, 2019
2 parents 962a036 + 8869f69 commit 76d5320d42a4206070abf42e132c427cf8c5cb62
Showing with 802 additions and 44 deletions.
  1. +3 −1 .editorconfig
  2. +2 −1 .gitignore
  3. +40 −0 BuildTools/pipelines-install.ps1
  4. +35 −1 BuildTools/update-assemblyinfo.ps1
  5. +1 −0 ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
  6. +7 −12 ICSharpCode.Decompiler.Tests/RoundtripAssembly.cs
  7. +1 −6 ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj
  8. +92 −0 ILSpy.Package/ILSpy.Package.wapproj
  9. BIN ILSpy.Package/ILSpy.png
  10. BIN ILSpy.Package/Images/LargeTile.scale-100.png
  11. BIN ILSpy.Package/Images/LargeTile.scale-125.png
  12. BIN ILSpy.Package/Images/LargeTile.scale-150.png
  13. BIN ILSpy.Package/Images/LargeTile.scale-200.png
  14. BIN ILSpy.Package/Images/LargeTile.scale-400.png
  15. BIN ILSpy.Package/Images/LockScreenLogo.scale-200.png
  16. BIN ILSpy.Package/Images/SmallTile.scale-100.png
  17. BIN ILSpy.Package/Images/SmallTile.scale-125.png
  18. BIN ILSpy.Package/Images/SmallTile.scale-150.png
  19. BIN ILSpy.Package/Images/SmallTile.scale-200.png
  20. BIN ILSpy.Package/Images/SmallTile.scale-400.png
  21. BIN ILSpy.Package/Images/SplashScreen.scale-100.png
  22. BIN ILSpy.Package/Images/SplashScreen.scale-125.png
  23. BIN ILSpy.Package/Images/SplashScreen.scale-150.png
  24. BIN ILSpy.Package/Images/SplashScreen.scale-200.png
  25. BIN ILSpy.Package/Images/SplashScreen.scale-400.png
  26. BIN ILSpy.Package/Images/Square150x150Logo.scale-100.png
  27. BIN ILSpy.Package/Images/Square150x150Logo.scale-125.png
  28. BIN ILSpy.Package/Images/Square150x150Logo.scale-150.png
  29. BIN ILSpy.Package/Images/Square150x150Logo.scale-200.png
  30. BIN ILSpy.Package/Images/Square150x150Logo.scale-400.png
  31. BIN ILSpy.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png
  32. BIN ILSpy.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png
  33. BIN ILSpy.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png
  34. BIN ILSpy.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png
  35. BIN ILSpy.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png
  36. BIN ILSpy.Package/Images/Square44x44Logo.altform-unplated_targetsize-16.png
  37. BIN ILSpy.Package/Images/Square44x44Logo.altform-unplated_targetsize-256.png
  38. BIN ILSpy.Package/Images/Square44x44Logo.altform-unplated_targetsize-32.png
  39. BIN ILSpy.Package/Images/Square44x44Logo.altform-unplated_targetsize-48.png
  40. BIN ILSpy.Package/Images/Square44x44Logo.scale-100.png
  41. BIN ILSpy.Package/Images/Square44x44Logo.scale-125.png
  42. BIN ILSpy.Package/Images/Square44x44Logo.scale-150.png
  43. BIN ILSpy.Package/Images/Square44x44Logo.scale-200.png
  44. BIN ILSpy.Package/Images/Square44x44Logo.scale-400.png
  45. BIN ILSpy.Package/Images/Square44x44Logo.targetsize-16.png
  46. BIN ILSpy.Package/Images/Square44x44Logo.targetsize-24.png
  47. BIN ILSpy.Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png
  48. BIN ILSpy.Package/Images/Square44x44Logo.targetsize-256.png
  49. BIN ILSpy.Package/Images/Square44x44Logo.targetsize-32.png
  50. BIN ILSpy.Package/Images/Square44x44Logo.targetsize-48.png
  51. BIN ILSpy.Package/Images/StoreLogo.backup.png
  52. BIN ILSpy.Package/Images/StoreLogo.scale-100.png
  53. BIN ILSpy.Package/Images/StoreLogo.scale-125.png
  54. BIN ILSpy.Package/Images/StoreLogo.scale-150.png
  55. BIN ILSpy.Package/Images/StoreLogo.scale-200.png
  56. BIN ILSpy.Package/Images/StoreLogo.scale-400.png
  57. BIN ILSpy.Package/Images/Wide310x150Logo.scale-100.png
  58. BIN ILSpy.Package/Images/Wide310x150Logo.scale-125.png
  59. BIN ILSpy.Package/Images/Wide310x150Logo.scale-150.png
  60. BIN ILSpy.Package/Images/Wide310x150Logo.scale-200.png
  61. BIN ILSpy.Package/Images/Wide310x150Logo.scale-400.png
  62. +58 −0 ILSpy.Package/Package-CI.appxmanifest
  63. +58 −0 ILSpy.Package/Package-Local.appxmanifest
  64. +15 −0 ILSpy.Package/Package.appinstaller
  65. +58 −0 ILSpy.Package/Package.appxmanifest
  66. +295 −0 ILSpy.WithPackage.sln
  67. +10 −3 ILSpy/AboutPage.cs
  68. +10 −0 ILSpy/Commands/CheckForUpdatesCommand.cs
  69. +3 −12 ILSpy/ILSpy.csproj
  70. +6 −0 ILSpy/MainWindow.xaml.cs
  71. +3 −5 SharpTreeView/ICSharpCode.TreeView.csproj
  72. +1 −2 TestPlugin/TestPlugin.csproj
  73. +100 −0 azure-pipelines.yml
  74. +4 −1 global.json
@@ -8,7 +8,9 @@ indent_size = 4
[*.il]
indent_style = space
indent_size = 2

[*.{yml,yaml}]
indent_style = space
indent_size = 2
[*.csproj]
indent_style = space
indent_size = 2
@@ -1,6 +1,7 @@
bin/
obj/

AppPackages/
BundleArtifacts/
/ICSharpCode.Decompiler/Properties/AssemblyInfo.cs
/ILSpy/Properties/AssemblyInfo.cs
/ILSpy/app.config
@@ -0,0 +1,40 @@
$ErrorActionPreference = "Stop"

$baseCommit = "d779383cb85003d6dabeb976f0845631e07bf463";
$baseCommitRev = 1;

# make sure this list matches artifacts-only branches list in azure-pipelines.yml!
$masterBranches = @("master", "3.2.x");

$globalAssemblyInfoTemplateFile = "ILSpy/Properties/AssemblyInfo.template.cs";

$versionParts = @{};
Get-Content $globalAssemblyInfoTemplateFile | where { $_ -match 'string (\w+) = "?(\w+)"?;' } | foreach { $versionParts.Add($Matches[1], $Matches[2]) }

$major = $versionParts.Major;
$minor = $versionParts.Minor;
$build = $versionParts.Build;
$versionName = $versionParts.VersionName;

if ($versionName -ne "null") {
$versionName = "-$versionName";
} else {
$versionName = "";
}
if ($masterBranches -contains $env:BUILD_SOURCEBRANCHNAME) {
$branch = "";
} else {
$branch = "-$env:BUILD_SOURCEBRANCHNAME";
}
if ($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) {
$suffix = "-pr$env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER";
} else {
$suffix = "";
}

$revision = [Int32]::Parse((git rev-list --count "$baseCommit..HEAD")) + $baseCommitRev;

$newVersion="$major.$minor.$build.$revision";
$env:ILSPY_VERSION_NUMBER="$newVersion$branch$versionName$suffix";
Write-Host "##vso[build.updatebuildnumber]$newVersion$branch$versionName$suffix";
Write-Host "new version: $newVersion$branch$versionName$suffix";
@@ -57,8 +57,10 @@ function gitBranch() {
return "no-branch";
}

if ($env:APPVEYOR_REPO_BRANCH -ne $null) {
if ($env:APPVEYOR_REPO_BRANCH -ne $null) {
return $env:APPVEYOR_REPO_BRANCH;
} elseif ($env:BUILD_SOURCEBRANCHNAME -ne $null) {
return $env:BUILD_SOURCEBRANCHNAME;
} else {
return ((git branch --no-color).Split([System.Environment]::NewLine) | where { $_ -match "^\* " } | select -First 1).Substring(2);
}
@@ -71,6 +73,12 @@ $templateFiles = (
@{Input="ILSpy/Properties/app.config.template"; Output = "ILSpy/app.config"},
@{Input="ILSpy.AddIn/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn/source.extension.vsixmanifest"}
);

$appxmanifestFiles = (
@{Input="ILSpy.Package/Package.appxmanifest"; Output="ILSpy.Package/Package.appxmanifest"},
@{Input="ILSpy.Package/Package-CI.appxmanifest"; Output="ILSpy.Package/Package-CI.appxmanifest"}
);

[string]$mutexId = "ILSpyUpdateAssemblyInfo" + (Get-Location).ToString().GetHashCode();
Write-Host $mutexId;
[bool]$createdNew = $false;
@@ -142,6 +150,32 @@ try {
$out | Out-File -Encoding utf8 $file.Output;
}
}

# Only update these on the Build Agent when ReleaseChannel is set
if($Env:ReleaseChannel -ne '' -and $Env:ReleaseChannel -ne $null) {
foreach ($file in $appxmanifestFiles) {
[string]$in = (Get-Content $file.Input) -Join [System.Environment]::NewLine;

$out = $in.Replace('$INSERTVERSION$', $fullVersionNumber);
$out = $out.Replace('$INSERTMAJORVERSION$', $major);
$out = $out.Replace('$INSERTMINORVERSION$', $minor);
$out = $out.Replace('$INSERTREVISION$', $revision);
$out = $out.Replace('$INSERTCOMMITHASH$', $gitCommitHash);
$out = $out.Replace('$INSERTSHORTCOMMITHASH$', $gitCommitHash.Substring(0, 8));
$out = $out.Replace('$INSERTDATE$', [System.DateTime]::Now.ToString("MM/dd/yyyy"));
$out = $out.Replace('$INSERTYEAR$', [System.DateTime]::Now.Year.ToString());
$out = $out.Replace('$INSERTBRANCHNAME$', $branchName);
$out = $out.Replace('$INSERTBRANCHPOSTFIX$', $postfixBranchName);
$out = $out.Replace('$INSERTVERSIONNAME$', $versionName);
$out = $out.Replace('$INSERTVERSIONNAMEPOSTFIX$', $postfixVersionName);
$out = $out.Replace('$INSERTBUILDCONFIG$', $buildConfig);

if (((Get-Content $file.Input) -Join [System.Environment]::NewLine) -ne $out) {
$out | Out-File -Encoding utf8 $file.Output;
}
}
}

} finally {
$mutex.ReleaseMutex();
$mutex.Close();
@@ -41,6 +41,7 @@

<ItemGroup>
<PackageReference Include="DiffLib" Version="2017.7.26.1241" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.2.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.0.0-beta4-final" />
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic" Version="3.0.0-beta4-final" />
<PackageReference Include="Microsoft.DiaSymReader.Converter.Xml" Version="1.1.0-beta1-63314-01" />
@@ -26,6 +26,7 @@
using ICSharpCode.Decompiler.CSharp;
using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.Tests.Helpers;
using Microsoft.Build.Locator;
using Microsoft.Win32;
using NUnit.Framework;

@@ -188,22 +189,16 @@ static void ClearDirectory(string dir)
File.Delete(file);
}
}

static string FindVS2017()
{
using (var key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32)) {
using (var subkey = key.OpenSubKey(@"SOFTWARE\Microsoft\VisualStudio\SxS\VS7")) {
return subkey?.GetValue("15.0") as string;
}
}
}

static string FindMSBuild()
{
string vsPath = FindVS2017();
string vsPath = MSBuildLocator.QueryVisualStudioInstances(new VisualStudioInstanceQueryOptions { DiscoveryTypes = DiscoveryType.VisualStudioSetup })
.OrderByDescending(i => i.Version)
.FirstOrDefault()
?.MSBuildPath;
if (vsPath == null)
throw new InvalidOperationException("Could not find VS2017");
return Path.Combine(vsPath, @"MSBuild\15.0\bin\MSBuild.exe");
throw new InvalidOperationException("Could not find MSBuild");
return Path.Combine(vsPath, "msbuild.exe");
}

static void Compile(string projectFile, string outputDir)
@@ -7,7 +7,7 @@
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>

<EnableDefaultItems>false</EnableDefaultItems>
<ExtrasEnableWpfProjectSetup>true</ExtrasEnableWpfProjectSetup>
<UseWpf>true</UseWpf>
<ExtrasEnableDefaultPageItems>false</ExtrasEnableDefaultPageItems>
<ExtrasEnableDefaultResourceItems>false</ExtrasEnableDefaultResourceItems>
</PropertyGroup>
@@ -45,24 +45,19 @@
<Compile Include="BamlTestRunner.cs" />
<Compile Include="Cases\AttachedEvent.xaml.cs">
<DependentUpon>AttachedEvent.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Cases\CustomControl.cs" />
<Compile Include="Cases\MyControl.xaml.cs">
<DependentUpon>MyControl.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Cases\Resources.xaml.cs">
<DependentUpon>Resources.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Cases\Simple.xaml.cs">
<DependentUpon>Simple.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Cases\SimpleNames.xaml.cs">
<DependentUpon>SimpleNames.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Mocks\AvalonDock.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '15.0'">
<VisualStudioVersion>15.0</VisualStudioVersion>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|AnyCPU">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU">
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup>
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
</PropertyGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
<PropertyGroup>
<ProjectGuid>bab51a23-9c15-42cc-8465-eb732bf9a932</ProjectGuid>
<TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<DefaultLanguage>en-US</DefaultLanguage>
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
<EntryPointProjectUniqueName>..\ILSpy\ILSpy.csproj</EntryPointProjectUniqueName>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>neutral</AppxBundlePlatforms>
<UapAppxPackageBuildMode Condition="'$(ReleaseChannel)' == 'Store'">CI</UapAppxPackageBuildMode>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
</PropertyGroup>
<PropertyGroup Condition="'$(ReleaseChannel)' == 'CI'">
<GenerateAppInstallerFile>true</GenerateAppInstallerFile>
<AppInstallerUri>https://some.location/tbd</AppInstallerUri>
<AppInstallerUpdateFrequency>0</AppInstallerUpdateFrequency>
<AppInstallerCheckForUpdateFrequency>OnApplicationRun</AppInstallerCheckForUpdateFrequency>
</PropertyGroup>
<ItemGroup>
<AppxManifest Include="Package-Local.appxmanifest" Condition="'$(ReleaseChannel)' == ''">
<SubType>Designer</SubType>
</AppxManifest>
<AppxManifest Include="Package-CI.appxmanifest" Condition="'$(ReleaseChannel)' == 'CI'">
<SubType>Designer</SubType>
</AppxManifest>
<AppxManifest Include="Package.appxmanifest" Condition="'$(ReleaseChannel)' == 'Store'">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="*.appxmanifest" />
</ItemGroup>
<ItemGroup>
<Content Include="Images\*" />
<None Include="Package.appinstaller" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ILSpy\ILSpy.csproj" SkipGetTargetFrameworkProperties="true" />
</ItemGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
</Project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">

<Identity
Name="ICSharpCode.ILSpy.CI"
Publisher="CN=ICSharpCode"
Version="$INSERTMAJORVERSION$.$INSERTMINORVERSION$.$INSERTREVISION$.0" />

<Properties>
<DisplayName>ILSpy (CI)</DisplayName>
<PublisherDisplayName>ICSharpCode</PublisherDisplayName>
<Logo>Images\StoreLogo.png</Logo>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.16299.0" MaxVersionTested="10.0.17763.0" />
</Dependencies>

<Resources>
<Resource Language="x-generate"/>
</Resources>

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="ILSpy (CI)"
Description=".NET assembly inspector and decompiler"
BackgroundColor="transparent"
Square150x150Logo="Images\Square150x150Logo.png"
Square44x44Logo="Images\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" Square71x71Logo="Images\SmallTile.png" Square310x310Logo="Images\LargeTile.png"/>
<uap:SplashScreen Image="Images\SplashScreen.png" />
</uap:VisualElements>

<Extensions>
<uap3:Extension Category="windows.appExecutionAlias" Executable="ILSpy\ILSpy.exe" EntryPoint="Windows.FullTrustApplication">
<uap3:AppExecutionAlias>
<desktop:ExecutionAlias Alias="ilspyc.exe" />
</uap3:AppExecutionAlias>
</uap3:Extension>
</Extensions>
</Application>
</Applications>

<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>

0 comments on commit 76d5320

Please sign in to comment.
You can’t perform that action at this time.