@@ -545,6 +545,23 @@ private function escapeArg pArg
545545 return pArg
546546end escapeArg
547547
548+ -- Needed on MacOS Sierra
549+ private command clearExtendedAttributes pAppBundle
550+ -- make sure you have permission to clear extended attributes from bundle files
551+ get shell ("chmod -R u+w" && pAppBundle )
552+ if the result is not zero then
553+ builderLog "error" , "Setting permissions failed with error:" && it
554+ throw "failure"
555+ end if
556+
557+ -- clear extended attributes from bundle files
558+ get shell ("xattr -cr" && pAppBundle )
559+ if the result is not zero then
560+ builderLog "error" , "Clearing extended attributes failed with error:" && it
561+ throw "failure"
562+ end if
563+ end clearExtendedAttributes
564+
548565private function findSigningIdentity
549566 get shell ("/usr/bin/security -q find-identity -v" )
550567 filter it with "*Developer ID Application: Runtime Revolution Ltd*"
@@ -656,6 +673,8 @@ command toolsBuilderMakeAppBundle pVersion, pEdition, pPlatform
656673 get shell ("file" && escapeArg(tFullPath ))
657674 if tFile is "Standalone" or "Mach-O" is not among the words of it then next repeat
658675
676+ clearExtendedAttributes escapeArg(tFullPath )
677+
659678 -- Sign the extension
660679 -- The "--force" parameter strips the existing signature (which was
661680 -- made using a not-valid-for-distribution profile)
@@ -668,6 +687,8 @@ command toolsBuilderMakeAppBundle pVersion, pEdition, pPlatform
668687 end repeat
669688 end repeat
670689
690+ clearExtendedAttributes escapeArg(tAppBundle )
691+
671692 builderLog "message" , "Signing macosx app bundle" && "'" & tAppBundle & "'"
672693 wait 1 second
673694 get shell ("/usr/bin/codesign --sign" && word 2 of tSigningId && "--deep --verbose=2" && escapeArg(tAppBundle ))
0 commit comments