Open EasyG0ing1 opened 7 months ago
Hi @EasyG0ing1!
I'm not a mac proficient user/developer 😞 ... What's more, the mac I had was borrowed, and I no longer have it 😢
Ok, now let's go to the point. I'm not sure what kind of package JP can generate to do that, it only supports PKG and DMG packages, containing an ".app" in both cases as you said. Maybe you can create an app (distributed in a DMG package), and instead of move it to Applications
folder you can run it with elevated privileges and then this app installs your command tools in /user/local/bin
?
@fvarrui I'll have to look a little deeper into how programs are distributed that are "command line" programs vs. "app" programs wrapped in an app package. I do know that things like the Java SDK as one example, gets installed by a pkg file where it simply extracts the files into the root Library folder where Java SDKs are intended to exist. There is no use of any .app packages in those instances. So I tend to think there should be a way to utilize a tool that creates a PKG installer so that it can be directed to package things in either scenario. The next question would be ... where to unpack a command line program so that it aligns with the way things should be in MacOS ... and I suppose one could follow HomeBrews methods for that where it tends to put programs in /usr/local/bin
though it uses shortcuts to its own Cellar folder, I've seen other programs use /usr/local/bin
... such as VirtualBox and others... I think it's a safe place for executables in general since it's always in the default path of any MacOS install.
How does JP create PKG files?
@fvarrui I am also curious ... when I package a program using Linux and I direct JP to include the JRE and create a single program that just runs, it does a nice job of that... how is that done, exactly? Clearly in the case of MacOS, the process assumes a .app file must be generated, but the same process that you use to create the linux self contained executable could be used in macOS where the option is available in the POM file to package it either as an executable or as an .app file.
I do know that things like the Java SDK as one example, gets installed by a pkg file where it simply extracts the files into the root Library folder where Java SDKs are intended to exist.
Yep, good point.
The next question would be ... where to unpack a command line program so that it aligns with the way things should be in MacOS
I'm not sure, but as you say, maybe PKG packages are the answer. I'll have a look into it. Maybe JP can install command line apps in Library folder and create a symlink in /usr/local/bin pointing to the binary file in Library folder
when I package a program using Linux and I direct JP to include the JRE and create a single program that just runs, it does a nice job of that... how is that done, exactly?
JP just concatenates the JAR file to a BASH startup script, and yes, I think we can do the same on macOS
When I make a .deb file with JP in Ubuntu, and I install it with
dpkg
, it creates a nicely packaged folder in /opt then it adds the link to the executable in /usr/local/bin and the program works just like any other command line program that one would install via apt etc.It's tight, clean and it works well.
My question is, how can we build something like that for MacOS? JP seems to only build .app files but what if my program is just a command line utility that I want to package up with the JRE included?