--msi is now just a boolean flag now that we ask for runtime architecture

This commit is contained in:
Caelan Sayler
2022-12-15 00:11:33 +00:00
parent 2584e1bd00
commit ece754f45d
4 changed files with 7 additions and 21 deletions

View File

@@ -61,7 +61,7 @@ namespace Squirrel.CommandLine.Commands
public string AppIcon { get; private set; }
public string BuildMsi { get; private set; }
public bool BuildMsi { get; private set; }
public string MsiVersion { get; private set; }
@@ -126,9 +126,8 @@ namespace Squirrel.CommandLine.Commands
.RequiresExtension(".ico");
if (SquirrelRuntimeInfo.IsWindows) {
AddOption<string>((v) => BuildMsi = v, "--msi")
.SetDescription("Compile a .msi machine-wide deployment tool with the specified bitness.")
AddOption<bool>((v) => BuildMsi = v, "--msi")
.SetDescription("Compile a .msi machine-wide deployment tool.")
.SetArgumentHelpName("BITNESS");
AddOption<string>((v) => MsiVersion = v, "--msiVersion")

View File

@@ -254,10 +254,9 @@ namespace Squirrel.CommandLine.Windows
Log.Warn($"DEBUG OPTION: Setup bundle copied on top of '{options.DebugSetupExe}'. Recompile before creating a new bundle.");
}
if (!String.IsNullOrEmpty(options.BuildMsi)) {
if (options.BuildMsi) {
if (SquirrelRuntimeInfo.IsWindows) {
bool x64 = options.BuildMsi.Equals("x64");
var msiPath = createMsiPackage(targetSetupExe, bundledzp, x64, options.MsiVersion);
var msiPath = createMsiPackage(targetSetupExe, bundledzp, options.TargetRuntime.Architecture == RuntimeCpu.x64, options.MsiVersion);
setupFilesToSign.Add(msiPath);
} else {
Log.Warn("Unable to create MSI (only supported on windows).");

View File

@@ -1,4 +1,5 @@
// https://github.com/dotnet/runtime/tree/main/src/libraries/Microsoft.NETCore.Platforms
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
// https://github.com/dotnet/runtime/tree/main/src/libraries/Microsoft.NETCore.Platforms
using System;
using System.Diagnostics;

View File

@@ -193,19 +193,6 @@ namespace Squirrel.CommandLine.Tests.Commands
//Assert.Equal(command.AppIcon, parseResult.Errors[0].SymbolResult?.Symbol.Parents.Single());
Assert.Contains(file, parseResult.Errors[0].Message);
}
[WindowsOnlyTheory]
[InlineData("x86")]
[InlineData("x64")]
public void BuildMsi_WithBitness_ParsesValue(string bitness)
{
var command = new T();
string cli = GetRequiredDefaultOptions() + $"--msi \"{bitness}\"";
ParseResult parseResult = command.ParseAndApply(cli);
Assert.Equal(bitness, command.BuildMsi);
}
}
public class ReleasifyWindowsCommandTests : ReleaseCommandTests<ReleasifyWindowsCommand>