Apple .command executed on mounted image
SOLUTION:
- Create a command line program and make it execution clickable in Finder interface, by appending .command
e.g. myexe.command
- Wrap this up in a .dmg file, which is mountable once it is clicked on (it is how most mac programs are distributed from websites)
USAGE:
- User clicks twice, once on the URL (e.g.) http://example.com/yoursoftware.dmg
- User sees the mounted image in their Finder interface, and sees the (e.g.) myexe.command
- User clicks on myexe.command
IMPLEMENTATION:
- Create a shell executable.
vi myshellscript.command
#!/bin/bash
ls -l
-
Make it executable.
sudo chmod 0777 myshellscript.command
-
Put into directory as the only file.
mkdir downloads
mv myshellscript.command downloads/
-
Create a .dmg file
hdiutil create -srcfolder downloads -volname MyDownloadable MyDownloadable
-
Click on MyDownloadable.dmg
-
Click on myshellscript.command
No comments:
Post a Comment