Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Add apple id override parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay committed Jul 5, 2022
1 parent 09cd6b4 commit a1c6376
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Squirrel.CommandLine/OSX/Commands.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions src/Squirrel.CommandLine/OSX/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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);
Expand Down

0 comments on commit a1c6376

Please sign in to comment.