# Codesign App that uses XojoScript (using AppWrapper)

**URL:** <https://forum.xojo.com/t/codesign-app-that-uses-xojoscript-using-appwrapper/49450>\
**Category:** macOS\
**Created:** [July 22, 2019, 8:40am UTC](https://forum.xojo.com/t/codesign-app-that-uses-xojoscript-using-appwrapper/49450 "2019-07-22T08:40:00Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Levine](https://forum.xojo.com/letter_avatar_proxy/v4/letter/p/e47c2d/32.png) [@Paul\_Levine](https://forum.xojo.com/u/Paul_Levine)\
**Post date:** [July 22, 2019, 8:40am UTC](https://forum.xojo.com/t/codesign-app-that-uses-xojoscript-using-appwrapper/49450/1 "2019-07-22T08:40:00Z")

</div>

Hi,

I was able to successfully codesign and notarize my App for Catalina but it seems there are some issues with XojoScript. I get the following crash when running a script;

[code]System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC\_BAD\_ACCESS (Code Signature Invalid)  
Exception Codes: 0x0000000000000032, 0x00000001110dd000  
Exception Note: EXC\_CORPSE\_NOTIFY

Termination Reason: Namespace CODESIGNING, Code 0x2

kernel messages:

VM Regions Near 0x1110dd000:  
CoreImage 00000001110dc000-00000001110dd000 [4K] rw-/rwx SM=PRV  
–\> VM\_ALLOCATE 00000001110dd000-00000001110df000 [8K] r-x/rwx SM=COW  
CoreImage 00000001110df000-00000001110e0000 [4K] rw-/rwx SM=PRV  
[/code]

Has anyone successfully codesigned an App that uses XojoScript?

It would be great if this can be done right from AppWrapper, but I’m not sure what settings to use if it is possible.

Thanks!

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [July 22, 2019, 9:06am UTC](https://forum.xojo.com/t/codesign-app-that-uses-xojoscript-using-appwrapper/49450/2 "2019-07-22T09:06:31Z")

</div>

Did you set the correct entitlement for XojoScript?

---

<div class="post-metadata">

**Author:** ![Paul\_Levine](https://forum.xojo.com/letter_avatar_proxy/v4/letter/p/e47c2d/32.png) [@Paul\_Levine](https://forum.xojo.com/u/Paul_Levine)\
**Post date:** [July 22, 2019, 9:09am UTC](https://forum.xojo.com/t/codesign-app-that-uses-xojoscript-using-appwrapper/49450/3 "2019-07-22T09:09:21Z")

</div>

> [@446164:@Beatrix Willius](#):
>
> Did you set the correct entitlement for XojoScript?

I did not, because I can’t find what they are, or how to set them.

Do you have instructions for how to set them? Preferably using AppWrapper.

Thank you!

- Paul

---

<div class="post-metadata">

**Author:** ![ChristopheDV](https://forum.xojo.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@ChristopheDV](https://forum.xojo.com/u/ChristopheDV)\
**Post date:** [July 22, 2019, 10:00am UTC](https://forum.xojo.com/t/codesign-app-that-uses-xojoscript-using-appwrapper/49450/4 "2019-07-22T10:00:10Z")

</div>

I think you can only add an entitlement to use Applescript, not Xojoscript.

---

<div class="post-metadata">

**Author:** ![Oliver\_Osswald](https://forum.xojo.com/user_avatar/forum.xojo.com/oliver_osswald/32/6972_2.png) [@Oliver\_Osswald](https://forum.xojo.com/u/Oliver_Osswald)\
**Post date:** [July 22, 2019, 10:28am UTC](https://forum.xojo.com/t/codesign-app-that-uses-xojoscript-using-appwrapper/49450/5 "2019-07-22T10:28:18Z")

</div>

This thread may help:  
[https://forum.xojo.com/53334-fyi-notarizing-your-app-before-distribution-macos-10-14-5-and-b/p5#p440993](https://forum.xojo.com/53334-fyi-notarizing-your-app-before-distribution-macos-10-14-5-and-b/p5#p440993)

---

<div class="post-metadata">

**Author:** ![Paul\_Levine](https://forum.xojo.com/letter_avatar_proxy/v4/letter/p/e47c2d/32.png) [@Paul\_Levine](https://forum.xojo.com/u/Paul_Levine)\
**Post date:** [July 22, 2019, 12:26pm UTC](https://forum.xojo.com/t/codesign-app-that-uses-xojoscript-using-appwrapper/49450/6 "2019-07-22T12:26:21Z")

</div>

Thank you everyone for the help!

I was able to edit the mainApplication.entitlements file for AppWrapper for my app and added these entitlements that file;

(this file is located at ~/Library/Application Support/com.ohanaware.appWrapper3/)

com.apple.security.cs.allow-unsigned-executable-memory  
com.apple.security.cs.allow-jit

After codesigning and notarizing XojoScript is now running on Catalina beta 4.

I am not sure if this is the correct way to add these custom entitlements to AppWrapper or if there is a more straightforward way. This file may get overwritten at some point by AppWrapper. Maybe @Sam Rowlands can suggest a better way.

Thanks!

---

<div class="post-metadata">

**Author:** ![Stéphane\_Mons](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/f07891/32.png) [@Stéphane\_Mons](https://forum.xojo.com/u/St%C3%A9phane_Mons)\
**Post date:** [July 22, 2019, 1:27pm UTC](https://forum.xojo.com/t/codesign-app-that-uses-xojoscript-using-appwrapper/49450/7 "2019-07-22T13:27:01Z")

</div>

@Paul Levine  Personally, I use an IDEScript to set entitlements and sign my apps (so the debug versions also have entitlements/signature). Here is my script:

[code]//# Sign app

dim appPath as String

appPath = CurrentBuildLocationNative + “/” + CurrentBuildAppName + “.app”

// First, clear xattr (finderInfo) which are not supported by codesign  
dim command as String

command = “/usr/bin/xattr -cr “”” + appPath + “”""

dim result as string = DoShellCommand( command )

if result\<\>"" then  
Print( "[xattr]: " + result )  
return  
end if

// Find entitlements  
dim entitlementsPath as string  
entitlementsPath =

// Then codesign  
command = “codesign -f --deep --entitlements “”” + entitlementsPath + “”" -s “”"" “”" + appPath + “”""

result = DoShellCommand( command )

if result\<\>"" then  
Print( "[codesign]: " + result )  
end if[/code]

Note that I usually prefer to use my email address as my Apple ID, if it ever makes a difference.

---

<div class="post-metadata">

**Author:** ![Paul\_Levine](https://forum.xojo.com/letter_avatar_proxy/v4/letter/p/e47c2d/32.png) [@Paul\_Levine](https://forum.xojo.com/u/Paul_Levine)\
**Post date:** [July 22, 2019, 1:58pm UTC](https://forum.xojo.com/t/codesign-app-that-uses-xojoscript-using-appwrapper/49450/8 "2019-07-22T13:58:16Z")

</div>

Hi Stphane,

Thanks for sharing your IDEScript, I will test it out here and see how it works for me.

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [July 23, 2019, 3:49am UTC](https://forum.xojo.com/t/codesign-app-that-uses-xojoscript-using-appwrapper/49450/9 "2019-07-23T03:49:27Z")

</div>

Check out App Wrapper 3.9.1 (released today, select “Update” from the “App Wrapper” menu). Which has these new options added to the Capabilities pane.

Direct download: [https://www.ohanaware.com/appwrapper/appWrapper3.dmg](https://www.ohanaware.com/appwrapper/appWrapper3.dmg)

---

<div class="post-metadata">

**Author:** ![Oliver\_Osswald](https://forum.xojo.com/user_avatar/forum.xojo.com/oliver_osswald/32/6972_2.png) [@Oliver\_Osswald](https://forum.xojo.com/u/Oliver_Osswald)\
**Post date:** [July 23, 2019, 8:07am UTC](https://forum.xojo.com/t/codesign-app-that-uses-xojoscript-using-appwrapper/49450/10 "2019-07-23T08:07:46Z")

</div>

[quote=446244:@Sam Rowlands]Check out App Wrapper 3.9.1 (released today, select “Update” from the “App Wrapper” menu). Which has these new options added to the Capabilities pane.

Direct download: [https://www.ohanaware.com/appwrapper/appWrapper3.dmg[/quote]](https://www.ohanaware.com/appwrapper/appWrapper3.dmg%5B/quote%5D)

It works like a charm now! Now my app is executing XojoScripts as before, but now the app is sandboxed AND notarized.

Great work Sam, thanks a lot!

And for those of you interested: This is the complete list of the hardened runtime entitlements:  
[https://developer.apple.com/documentation/security/hardened\_runtime\_entitlements](https://developer.apple.com/documentation/security/hardened_runtime_entitlements)

---

<div class="post-metadata">

**Author:** ![Paul\_Levine](https://forum.xojo.com/letter_avatar_proxy/v4/letter/p/e47c2d/32.png) [@Paul\_Levine](https://forum.xojo.com/u/Paul_Levine)\
**Post date:** [July 23, 2019, 9:50am UTC](https://forum.xojo.com/t/codesign-app-that-uses-xojoscript-using-appwrapper/49450/11 "2019-07-23T09:50:28Z")

</div>

Thanks @Sam Rowlands ! Everything seems to be working great!

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [April 29, 2021, 4:01pm UTC](https://forum.xojo.com/t/codesign-app-that-uses-xojoscript-using-appwrapper/49450/12 "2021-04-29T16:01:11Z")

</div>


