Fix osx command like arguments

This commit is contained in:
Caelan Sayler
2022-07-06 16:21:29 +01:00
parent 336919ba9b
commit 0fe9f8a904
2 changed files with 19 additions and 16 deletions

View File

@@ -39,8 +39,8 @@ namespace Squirrel.CommandLine.OSX
if (options.mainExe != null)
Log.Warn("--exeName is ignored if the pack directory is a '.app' bundle.");
if (options.appleId != null)
Log.Warn("--appleId is ignored if the pack directory is a '.app' bundle.");
if (options.bundleId != null)
Log.Warn("--bundleId is ignored if the pack directory is a '.app' bundle.");
appBundlePath = Path.Combine(releaseDir.FullName, options.packId + ".app");
@@ -77,7 +77,7 @@ namespace Squirrel.CommandLine.OSX
CFBundleName = options.packTitle ?? options.packId,
CFBundleDisplayName = options.packTitle ?? options.packId,
CFBundleExecutable = options.mainExe,
CFBundleIdentifier = options.appleId ?? escapedAppleId,
CFBundleIdentifier = options.bundleId ?? escapedAppleId,
CFBundlePackageType = "APPL",
CFBundleShortVersionString = appleSafeVersion,
CFBundleVersion = options.packVersion,
@@ -177,18 +177,20 @@ namespace Squirrel.CommandLine.OSX
ReleaseEntry.WriteReleaseFile(releases, releaseFilePath);
// create installer package, sign and notarize
if (SquirrelRuntimeInfo.IsOSX) {
var pkgPath = Path.Combine(releaseDir.FullName, options.packId + ".pkg");
HelperExe.CreateInstallerPkg(appBundlePath, pkgTitle, options.pkgContent, pkgPath, options.signInstallIdentity);
if (!String.IsNullOrEmpty(options.signInstallIdentity) && !String.IsNullOrEmpty(options.notaryProfile)) {
HelperExe.Notarize(pkgPath, options.notaryProfile);
HelperExe.Staple(pkgPath);
if (!options.noPkg) {
if (SquirrelRuntimeInfo.IsOSX) {
var pkgPath = Path.Combine(releaseDir.FullName, options.packId + ".pkg");
HelperExe.CreateInstallerPkg(appBundlePath, pkgTitle, options.pkgContent, pkgPath, options.signInstallIdentity);
if (!String.IsNullOrEmpty(options.signInstallIdentity) && !String.IsNullOrEmpty(options.notaryProfile)) {
HelperExe.Notarize(pkgPath, options.notaryProfile);
HelperExe.Staple(pkgPath);
} else {
Log.Warn("Package installer (.pkg) will not be Notarized. " +
"This is supported with the --signInstallIdentity and --notaryProfile arguments.");
}
} else {
Log.Warn("Package installer (.pkg) will not be Notarized. " +
"This is supported with the --signInstallIdentity and --notaryProfile arguments.");
Log.Warn("Package installer (.pkg) will not be created - this is only supported on OSX.");
}
} else {
Log.Warn("Package installer (.pkg) will not be created - this is only supported on OSX.");
}
Log.Info("Done.");

View File

@@ -24,7 +24,8 @@ namespace Squirrel.CommandLine.OSX
public string signInstallIdentity { get; private set; }
public string signEntitlements { get; private set; }
public string notaryProfile { get; private set; }
public string appleId { get; private set; }
public string bundleId { get; private set; }
public bool noPkg { get; private set; }
public KeyValuePair<string, string>[] pkgContent => _pkgContent.ToArray();
private Dictionary<string, string> _pkgContent = new Dictionary<string, string>();
@@ -41,9 +42,9 @@ namespace Squirrel.CommandLine.OSX
Add("releaseNotes=", "{PATH} to file with markdown notes for version", v => releaseNotes = v);
Add("e=|mainExe=", "The file {NAME} of the main executable", v => mainExe = v);
Add("i=|icon=", "{PATH} to the .icns file for this bundle", v => icon = v);
Add("bundleId=", "Override the apple unique {ID} when generating bundles", v => bundleId = v);
Add("noDelta", "Skip the generation of delta packages", v => noDelta = true);
Add("appleId", "Override the apple bundle ID for generated bundles", v => appleId = v);
Add("noPkg", "Skip generating a .pkg installer", v => appleId = v);
Add("noPkg", "Skip generating a .pkg installer", v => noPkg = true);
Add("pkgContent=", "Add content files (eg. readme, license) to pkg installer.", (v1, v2) => _pkgContent.Add(v1, v2));
if (SquirrelRuntimeInfo.IsOSX) {