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

Commit

Permalink
We should staple notarization to the .app and not the .zip
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay committed Jul 5, 2022
1 parent 095c5d3 commit 262e343
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Squirrel.CommandLine/OSX/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ private static void Pack(PackOptions options)
HelperExe.CodeSign(options.signAppIdentity, options.signEntitlements, appBundlePath);
HelperExe.CreateDittoZip(appBundlePath, zipPath);
HelperExe.Notarize(zipPath, options.notaryProfile);
HelperExe.Staple(appBundlePath);
File.Delete(zipPath);
} else if (SquirrelRuntimeInfo.IsOSX && !String.IsNullOrEmpty(options.signAppIdentity)) {
HelperExe.CodeSign(options.signAppIdentity, options.signEntitlements, appBundlePath);
Log.Warn("Package was signed but will not be notarized or verified. Must supply the --notaryProfile option.");
Expand Down Expand Up @@ -177,6 +179,7 @@ private static void Pack(PackOptions options)
HelperExe.CreateInstallerPkg(appBundlePath, 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.");
Expand Down
6 changes: 5 additions & 1 deletion src/Squirrel.CommandLine/OSX/HelperExe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ public static void Notarize(string filePath, string keychainProfileName)
}

Log.Info("Notarization completed successfully");

}

[SupportedOSPlatform("osx")]
public static void Staple(string filePath)
{
Log.Info($"Stapling Notarization to '{filePath}'");
Console.WriteLine(InvokeAndThrowIfNonZero("xcrun", new[] { "stapler", "staple", filePath }, null));
}
Expand Down

0 comments on commit 262e343

Please sign in to comment.