We should staple notarization to the .app and not the .zip

This commit is contained in:
Caelan Sayler
2022-07-05 22:49:49 +01:00
parent 095c5d3fdf
commit 262e3435cb
2 changed files with 8 additions and 1 deletions

View File

@@ -129,6 +129,8 @@ namespace Squirrel.CommandLine.OSX
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.");
@@ -177,6 +179,7 @@ namespace Squirrel.CommandLine.OSX
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.");

View File

@@ -156,7 +156,11 @@ namespace Squirrel.CommandLine.OSX
}
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));
}