diff --git a/src/Squirrel.CommandLine/OSX/Commands.cs b/src/Squirrel.CommandLine/OSX/Commands.cs index c8214ea96..1fbd07bbe 100644 --- a/src/Squirrel.CommandLine/OSX/Commands.cs +++ b/src/Squirrel.CommandLine/OSX/Commands.cs @@ -39,8 +39,8 @@ private static void Pack(PackOptions options) 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 @@ private static void Pack(PackOptions options) 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 @@ private static void Pack(PackOptions options) 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."); diff --git a/src/Squirrel.CommandLine/OSX/Options.cs b/src/Squirrel.CommandLine/OSX/Options.cs index bc4281d77..683c15d4e 100644 --- a/src/Squirrel.CommandLine/OSX/Options.cs +++ b/src/Squirrel.CommandLine/OSX/Options.cs @@ -24,7 +24,8 @@ internal class PackOptions : BaseOptions 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[] pkgContent => _pkgContent.ToArray(); private Dictionary _pkgContent = new Dictionary(); @@ -41,9 +42,9 @@ public PackOptions() 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) {