Note that there are some explanatory texts on larger screens.

plurals
  1. PORun script in ".app" (Application Bundle) as the primary executable
    text
    copied!<p>I'm trying to use Mono to make a portable application that works on Windows, Mac, and Linux, but I want to have a standard DMG file that allows users to simply click and drag my application to their Applications folder on their Mac. In the best answer to <a href="https://stackoverflow.com/questions/751599/possible-to-include-mono-runtimes-in-osx-app-bundle">this post</a> I found that by creating an executable script beginning with <code>#!</code> in the <code>MyAppName.app/Contents/MacOSX/</code> folder, it could run whatever I liked.</p> <p>How do I get a script to actually run?</p> <p>I made a blank "Hello World" Cocoa App in XCode, and copied the .app file to the Applications directory, and everything worked great. But when I replaced the executable in the MacOSX folder with a script starting with <code>#!</code> it didn't run the script.</p> <p>I tried <code>chmod 755 myscript</code>, I tried deleting the old executable file and renaming my script to be the old filename, but all that served to do was stop the app from running at all. The permissions of the script, and the filename, are both correct.</p> <p>So then I assumed that maybe scripts wouldn't work, and XCoded a command line utility, again that would simply spout "Hello World!", but still it didn't run.</p> <p>The ".app" extension is formally called an Application Bundle, and they have some pretty good documentation, but none of it seems to tell me why my approach isn't working.</p> <p><a href="http://home.edgemontgeek.com/files/XCodeTest.zip" rel="nofollow noreferrer">Here is the .app bundle that I'm working on.</a> Inside the MasOSX directory you'll find hello (the Hello Word command line utility) and script (a one line script with a <code>#!</code> as the first line) and XCodeTest (a Hello World cocoa app).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload