Skip to content

Commit 5428a9b

Browse files
Merge pull request #3456 from icsharpcode/feature/wixsharp
Update to _wix4 packages for installer
2 parents b50d68c + e83ea66 commit 5428a9b

File tree

6 files changed

+41
-54
lines changed

6 files changed

+41
-54
lines changed

.github/workflows/build-ilspy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ jobs:
4646
- name: Install dotnet-format
4747
run: dotnet tool install -g dotnet-format --version "8.3.546805" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json
4848

49+
- name: Install wix (locked version)
50+
run: dotnet tool install --global wix --version 6.0.0
51+
4952
- name: Get Version
5053
id: version
5154
shell: pwsh

ILSpy.Installer/ILSpy.Installer.csproj

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,21 @@
1515
</PropertyGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="WixSharp" Version="1.26.0" />
19-
<PackageReference Include="WixSharp.wix.bin" Version="3.14.1" />
18+
<None Remove="*.msi" />
19+
<None Remove="*.exe" />
20+
<None Remove="*.wxs" />
21+
<None Remove="*.wixpdb" />
22+
<None Remove="*.wixobj" />
2023
</ItemGroup>
2124

25+
<ItemGroup>
26+
<PackageReference Include="WixSharp_wix4" Version="2.6.1" />
27+
</ItemGroup>
28+
29+
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
30+
<Exec Command="cd .\&#xD;&#xA;set ide=true&#xD;&#xA;&quot;$(TargetPath)&quot;" />
31+
</Target>
32+
2233
<ItemGroup>
2334
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" />
2435
</ItemGroup>

ILSpy.Installer/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Building the Installer
22

3+
## Dependencies
4+
5+
See https://github.com/oleg-shilo/wixsharp/wiki#dependencies
6+
7+
```
8+
dotnet tool install --global wix
9+
```
10+
11+
GitHub runners installed software https://github.com/actions/runner-images/blob/main/images/windows/Windows2025-Readme.md at time
12+
of writing WiX Toolset 3.14.1.8722
13+
14+
15+
## ILSpy Binaries
16+
317
It is mandatory to first publish(.ps1) the respective target platforms, then setup can be built, eg
418

519
```

ILSpy.Installer/setup.cs

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ static public void Main()
4545
project.GUID = new Guid("a12fdab1-731b-4a98-9749-d481ce8692ab");
4646
project.Version = AppPackage.Version;
4747
project.SourceBaseDir = Path.GetDirectoryName(Environment.CurrentDirectory);
48-
project.InstallScope = InstallScope.perUser;
49-
project.InstallPrivileges = InstallPrivileges.limited;
48+
project.Scope = InstallScope.perUser;
5049
project.ControlPanelInfo.ProductIcon = @"..\ILSpy\Images\ILSpy.ico";
5150
project.ControlPanelInfo.Manufacturer = "ICSharpCode Team";
5251
project.LocalizationFile = Path.Combine(Environment.CurrentDirectory, "winui.wxl");
@@ -71,41 +70,7 @@ static public void Main()
7170
new FileShortcut("ILSpy", @"%ProgramMenu%")
7271
};
7372

74-
Compiler.WixLocation = GetWixBinLocationForPackage();
7573
Compiler.BuildMsi(project, Path.Combine(Environment.CurrentDirectory, "wix", $"ILSpy-{AppPackage.Version}-{buildPlatform}.msi"));
7674
}
77-
78-
// Copied from https://github.com/oleg-shilo/wixsharp/blob/c4f8615ce8e47c7162edb30656669d0d326f79ff/Source/src/WixSharp/Utilities/WixBinLocator.cs#L117
79-
private static string GetWixBinLocationForPackage()
80-
{
81-
//The global packages may be redirected with environment variable
82-
//https://docs.microsoft.com/en-us/nuget/consume-packages/managing-the-global-packages-and-cache-folders
83-
84-
string wixBinPackageDir;
85-
var nugetPackagesEnvironmentVariable = Environment.GetEnvironmentVariable("NUGET_PACKAGES");
86-
if (nugetPackagesEnvironmentVariable.IsNotEmpty() && Directory.Exists(nugetPackagesEnvironmentVariable))
87-
{
88-
wixBinPackageDir = Path.Combine(nugetPackagesEnvironmentVariable, "wixsharp.wix.bin");
89-
}
90-
else
91-
{
92-
wixBinPackageDir = @"%userprofile%\.nuget\packages\wixsharp.wix.bin".ExpandEnvVars();
93-
}
94-
95-
if (Directory.Exists(wixBinPackageDir))
96-
{
97-
Version greatestWixBinVersion = System.IO.Directory.GetDirectories(wixBinPackageDir)
98-
.Select(dirPath => new Version(dirPath.PathGetFileName()))
99-
.OrderDescending()
100-
.FirstOrDefault();
101-
102-
if (greatestWixBinVersion != null)
103-
{
104-
return wixBinPackageDir.PathJoin(greatestWixBinVersion.ToString(), @"tools\bin");
105-
}
106-
}
107-
108-
return "";
109-
}
11075
}
11176
}

ILSpy.Installer/winui.wxl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<WixLocalization Culture="en-US" xmlns="http://schemas.microsoft.com/wix/2006/localization">
3-
<String Id="VerifyReadyDlgInstallText" Overridable="yes">Click Install to begin the installation. Click Cancel to exit the wizard.
4-
5-
6-
ILSpy will be installed for current user into following directory:
7-
8-
[INSTALLDIR]
9-
</String>
2+
<WixLocalization Culture="en-US" xmlns="http://wixtoolset.org/schemas/v4/wxl">
3+
<String Id="VerifyReadyDlgInstallText" Overridable="yes" Value="Click Install to begin the installation. Click Cancel to exit the wizard.&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;ILSpy will be installed for current user into following directory:&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;[INSTALLDIR]"></String>
104
</WixLocalization>

publishlocaldev.ps1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# For local development of the VSIX package - build and publish (VS2022 also needs arm64)
22

3-
$output_x64 = "./ILSpy/bin/Debug/net8.0-windows/win-x64/publish/fwdependent"
3+
$output_x64 = "./ILSpy/bin/Release/net8.0-windows/win-x64/publish/fwdependent"
44

5-
dotnet publish ./ILSpy/ILSpy.csproj -c Debug --no-restore --no-self-contained -r win-x64 -o $output_x64
6-
dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c Debug --no-restore --no-self-contained -r win-x64 -o $output_x64
7-
dotnet publish ./ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj -c Debug --no-restore --no-self-contained -r win-x64 -o $output_x64
5+
dotnet publish ./ILSpy/ILSpy.csproj -c Release --no-restore --no-self-contained -r win-x64 -o $output_x64
6+
dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c Release --no-restore --no-self-contained -r win-x64 -o $output_x64
7+
dotnet publish ./ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj -c Release --no-restore --no-self-contained -r win-x64 -o $output_x64
88

9-
$output_arm64 = "./ILSpy/bin/Debug/net8.0-windows/win-arm64/publish/fwdependent"
9+
$output_arm64 = "./ILSpy/bin/Release/net8.0-windows/win-arm64/publish/fwdependent"
1010

11-
dotnet publish ./ILSpy/ILSpy.csproj -c Debug --no-restore --no-self-contained -r win-arm64 -o $output_arm64
12-
dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c Debug --no-restore --no-self-contained -r win-arm64 -o $output_arm64
13-
dotnet publish ./ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj -c Debug --no-restore --no-self-contained -r win-arm64 -o $output_arm64
11+
dotnet publish ./ILSpy/ILSpy.csproj -c Release --no-restore --no-self-contained -r win-arm64 -o $output_arm64
12+
dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c Release --no-restore --no-self-contained -r win-arm64 -o $output_arm64
13+
dotnet publish ./ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj -c Release --no-restore --no-self-contained -r win-arm64 -o $output_arm64

0 commit comments

Comments
 (0)