Browse Source

Merge pull request #2558 from Rpinski/installer

Introduce MSI-based installer
pull/2560/head
Siegfried Pammer 4 years ago committed by GitHub
parent
commit
1ce435bdc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      .github/workflows/build-ilspy.yml
  2. 4
      .gitignore
  3. 3
      BuildTools/update-assemblyinfo.ps1
  4. 18
      ILSpy.Installer.slnf
  5. 9
      ILSpy.Installer/AppPackage.cs.template
  6. 14
      ILSpy.Installer/ILSpy.Installer.csproj
  7. 53
      ILSpy.Installer/setup.cs
  8. 11
      ILSpy.sln

8
.github/workflows/build-ilspy.yml

@ -125,3 +125,11 @@ jobs: @@ -125,3 +125,11 @@ jobs:
name: ILSpy ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ${{ env.StagingDirectory }}\ILSpy_binaries.zip
if-no-files-found: error
- name: Upload installer artifact
if: matrix.channel == 'zip' && matrix.configuration == 'release'
uses: actions/upload-artifact@v2
with:
name: ILSpy Installer ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ILSpy.Installer\wix\*.msi
if-no-files-found: error

4
.gitignore vendored

@ -18,4 +18,6 @@ _ReSharper*/ @@ -18,4 +18,6 @@ _ReSharper*/
/ICSharpCode.Decompiler.Tests/TestCases/Correctness/*.exe
/ICSharpCode.Decompiler.Tests/TestCases/Correctness/*.exe.config
/ICSharpCode.Decompiler/ICSharpCode.Decompiler.nuspec
multitargeting.props
multitargeting.props
ILSpy.Installer/wix/
ILSpy.Installer/AppPackage.cs

3
BuildTools/update-assemblyinfo.ps1

@ -76,7 +76,8 @@ $templateFiles = ( @@ -76,7 +76,8 @@ $templateFiles = (
@{Input="ICSharpCode.Decompiler/ICSharpCode.Decompiler.nuspec.template"; Output="ICSharpCode.Decompiler/ICSharpCode.Decompiler.nuspec"},
@{Input="ILSpy/Properties/app.config.template"; Output = "ILSpy/app.config"},
@{Input="ILSpy.AddIn/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn/source.extension.vsixmanifest"},
@{Input="ILSpy.AddIn.VS2022/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn.VS2022/source.extension.vsixmanifest"}
@{Input="ILSpy.AddIn.VS2022/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn.VS2022/source.extension.vsixmanifest"},
@{Input="ILSpy.Installer/AppPackage.cs.template"; Output = "ILSpy.Installer/AppPackage.cs"}
);
$appxmanifestFiles = (

18
ILSpy.Installer.slnf

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
{
"solution": {
"path": "ILSpy.sln",
"projects": [
"ICSharpCode.Decompiler.PdbProvider.Cecil\\ICSharpCode.Decompiler.PdbProvider.Cecil.csproj",
"ICSharpCode.Decompiler.Tests\\ICSharpCode.Decompiler.Tests.csproj",
"ICSharpCode.Decompiler\\ICSharpCode.Decompiler.csproj",
"ILSpy.BamlDecompiler.Tests\\ILSpy.BamlDecompiler.Tests.csproj",
"ILSpy.BamlDecompiler\\ILSpy.BamlDecompiler.csproj",
"ILSpy.ReadyToRun\\ILSpy.ReadyToRun.csproj",
"ILSpy.Tests\\ILSpy.Tests.csproj",
"ILSpy\\ILSpy.csproj",
"ILSpy.Installer\\ILSpy.Installer.csproj",
"SharpTreeView\\ICSharpCode.TreeView.csproj",
"TestPlugin\\TestPlugin.csproj"
]
}
}

9
ILSpy.Installer/AppPackage.cs.template

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
using System;
namespace ILSpy.Installer
{
internal static class AppPackage
{
public static Version Version = new Version("$INSERTVERSION$");
}
}

14
ILSpy.Installer/ILSpy.Installer.csproj

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net472</TargetFramework>
<StartupObject>ILSpy.Installer.Builder</StartupObject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="WixSharp" Version="1.19.0" />
<PackageReference Include="WixSharp.wix.bin" Version="3.11.2" />
</ItemGroup>
</Project>

53
ILSpy.Installer/setup.cs

@ -0,0 +1,53 @@ @@ -0,0 +1,53 @@
using System;
using System.IO;
using System.Linq;
using WixSharp;
namespace ILSpy.Installer
{
internal class Builder
{
static public void Main()
{
Compiler.AutoGeneration.IgnoreWildCardEmptyDirectories = true;
#if DEBUG
var buildConfiguration = "Debug";
#else
var buildConfiguration = "Release";
#endif
var buildOutputDir = $@"ILSpy\bin\{buildConfiguration}\net472";
var project = new Project("ILSpy",
new InstallDir(@"%LocalAppData%\Programs\ILSpy",
new DirFiles(Path.Combine(buildOutputDir, "*.dll")),
new DirFiles(Path.Combine(buildOutputDir, "*.exe")),
new DirFiles(Path.Combine(buildOutputDir, "*.config")),
new Files(Path.Combine(buildOutputDir, "ILSpy.resources.dll")),
new Files(Path.Combine(buildOutputDir, "ILSpy.ReadyToRun.Plugin.resources.dll"))));
project.GUID = new Guid("a12fdab1-731b-4a98-9749-d481ce8692ab");
project.Version = AppPackage.Version;
project.SourceBaseDir = Path.GetDirectoryName(Environment.CurrentDirectory);
project.InstallScope = InstallScope.perUser;
project.InstallPrivileges = InstallPrivileges.limited;
project.ControlPanelInfo.ProductIcon = @"..\ILSpy\Images\ILSpy.ico";
project.MajorUpgrade = new MajorUpgrade {
Schedule = UpgradeSchedule.afterInstallInitialize,
AllowSameVersionUpgrades = true,
DowngradeErrorMessage = "A newer release of ILSpy is already installed on this system. Please uninstall it first to continue."
};
project.UI = WUI.WixUI_ProgressOnly;
project.ResolveWildCards().FindFile(f => f.Name.EndsWith("ILSpy.exe")).First()
.Shortcuts = new[] {
new FileShortcut("ILSpy", @"%ProgramMenu%")
};
Compiler.BuildMsi(project, Path.Combine(Environment.CurrentDirectory, "wix", $"ILSpy-{AppPackage.Version}.msi"));
}
}
}

11
ILSpy.sln

@ -47,6 +47,13 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ILSpy.AddIn.Shared", "ILSpy @@ -47,6 +47,13 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ILSpy.AddIn.Shared", "ILSpy
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy.AddIn.VS2022", "ILSpy.AddIn.VS2022\ILSpy.AddIn.VS2022.csproj", "{09A03980-D14A-4705-A38C-741AD7166DEE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILSpy.Installer", "ILSpy.Installer\ILSpy.Installer.csproj", "{A4BA0771-DA4A-4A94-A5EC-5BA10B52816F}"
ProjectSection(ProjectDependencies) = postProject
{0313F581-C63B-43BB-AA9B-07615DABD8A3} = {0313F581-C63B-43BB-AA9B-07615DABD8A3}
{A6BAD2BA-76BA-461C-8B6D-418607591247} = {A6BAD2BA-76BA-461C-8B6D-418607591247}
{1E85EFF9-E370-4683-83E4-8A3D063FF791} = {1E85EFF9-E370-4683-83E4-8A3D063FF791}
EndProjectSection
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
ILSpy.AddIn.Shared\ILSpy.AddIn.Shared.projitems*{09a03980-d14a-4705-a38c-741ad7166dee}*SharedItemsImports = 5
@ -114,6 +121,10 @@ Global @@ -114,6 +121,10 @@ Global
{09A03980-D14A-4705-A38C-741AD7166DEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09A03980-D14A-4705-A38C-741AD7166DEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09A03980-D14A-4705-A38C-741AD7166DEE}.Release|Any CPU.Build.0 = Release|Any CPU
{A4BA0771-DA4A-4A94-A5EC-5BA10B52816F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A4BA0771-DA4A-4A94-A5EC-5BA10B52816F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4BA0771-DA4A-4A94-A5EC-5BA10B52816F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4BA0771-DA4A-4A94-A5EC-5BA10B52816F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Loading…
Cancel
Save