0

I have a sh-script in MacOS that launches my application. I can use Automator to create executable desctop icon for it but manually.

Is there any way automatically create a desktop icon that will execute this sh-script by double-clicking on this icon? And also I would like to create such icon using some parameters like a path to custom image of the icon.

Note. In our project we have a number of jar-files for about 100Mb. So now I use sh-script with configuration to launch the application.

Kirill Ch
  • 5,496
  • 4
  • 44
  • 65
  • 1
    Are you asking how to create an **installer** for a java application? Like: https://stackoverflow.com/questions/1536190/how-do-i-create-a-mac-installer-for-my-java-application ??? Icons are Icons, not programs. Your question is pretty unclear ... – GhostCat Aug 15 '17 at 13:26
  • At this point I don't need an installer. Just tie sh-script with desktop icon, not manually. Answer about creating app folder might be the right one, I'll try. – Kirill Ch Aug 15 '17 at 13:46
  • The answer with the ".command" extension is the simplest. – Thorbjørn Ravn Andersen Aug 15 '17 at 13:50
  • @ThorbjørnRavnAndersen I know how to execute sh-script by double-clicking. The question is how to *automatically* create the executable desktop icon for sh-script. – Kirill Ch Aug 15 '17 at 13:52
  • 1
    `echo java -whatever foo bar > ~/Desktop/foo.command` – Thorbjørn Ravn Andersen Aug 15 '17 at 13:54

1 Answers1

1

You can create an app folder for your application and put the icon you want in it.

More info here.

Maurice Perry
  • 9,261
  • 2
  • 12
  • 24
  • Thank you very much. It might be very good solution. I would like to ask: in our application we have a lot of jar-files so is it possible to put sh-script in such folder? – Kirill Ch Aug 15 '17 at 14:16
  • 1
    @KirillCh Yes. You MUST include a launcher somewhere in the structure. There is a binary version that comes with MacOs, but there is an open-source alternative that is a shell script: https://github.com/tofi86/universalJavaApplicationStub – Maurice Perry Aug 17 '17 at 05:56