diff --git a/src/Squirrel.CommandLine/OSX/Commands.cs b/src/Squirrel.CommandLine/OSX/Commands.cs index f6c0ce1a3..ac65f7a06 100644 --- a/src/Squirrel.CommandLine/OSX/Commands.cs +++ b/src/Squirrel.CommandLine/OSX/Commands.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -38,6 +38,9 @@ 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."); appBundlePath = Path.Combine(releaseDir.FullName, options.packId + ".app"); @@ -68,14 +71,13 @@ private static void Pack(PackOptions options) var appleId = $"com.{options.packAuthors ?? options.packId}.{options.packId}"; var escapedAppleId = Regex.Replace(appleId, @"[^\w\.]", "_"); - var appleSafeVersion = NuGetVersion.Parse(options.packVersion).Version.ToString(); var info = new AppInfo { CFBundleName = options.packTitle ?? options.packId, CFBundleDisplayName = options.packTitle ?? options.packId, CFBundleExecutable = options.mainExe, - CFBundleIdentifier = escapedAppleId, + CFBundleIdentifier = options.appleId ?? escapedAppleId, CFBundlePackageType = "APPL", CFBundleShortVersionString = appleSafeVersion, CFBundleVersion = options.packVersion, diff --git a/src/Squirrel.CommandLine/OSX/Options.cs b/src/Squirrel.CommandLine/OSX/Options.cs index 2c97d9005..f4560a726 100644 --- a/src/Squirrel.CommandLine/OSX/Options.cs +++ b/src/Squirrel.CommandLine/OSX/Options.cs @@ -24,6 +24,7 @@ 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 PackOptions() { @@ -38,6 +39,7 @@ public PackOptions() 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("noDelta", "Skip the generation of delta packages", v => noDelta = true); + Add("appleId", "Override the apple bundle ID for generated bundles", v => appleId = v); if (SquirrelRuntimeInfo.IsOSX) { Add("signAppIdentity=", "The {SUBJECT} name of the cert to use for app code signing", v => signAppIdentity = v);