How to automatically run cocoa application after install via installer - macos

I have a built a cocoa application that I have packaged using package maker so that the app is installed using the installer.
After install is finished I want to run the installed application. In the package maker I can see postinstall actions, but I don't find an appropriate action to execute the application.
Any ideas what should I do ? my app is install in the /Applications/my.app
Should I write a script file of some sort or should the package maker help me run the app?
Thanks,
Ahmed

You need to add a postflight (assuming you want this for both installs and upgrades. If you just want it for installs, use postinstall).
Just call open "$3/Applications/my.app" to launch.
$3 is the install target. It's usually going to be /, but if you're being installed onto another volume, it could be something different like /Volumes/Other_Drive.

Related

Cannot Run Qt Installer Application on MAC(Mojave)

I have developed a camera application for MAC platform. The app executable and framework dependencies were bundled into an installer app named QtCameraInstaller (developed using Qt Framework). This installer app, perform unzip process to extract the compressed files.
QTProcess process;
process.start("/bin/sh unzip /User/MyMac/Desktop/test.zip");
Case #1:
By clicking the installer application, I was able to run the installer. Exactly the unzip shell commands(part of my Qt code) were not working. The unzip task were skipped, resulted in unsuccessful installation of my Camera App (dependencies found missing after the installation).
Case #2:
When I tried to run the installer resides inside the bundled package, I was able to install the application successfully (i.e) now the shell commands were working fine. The unzip commands were working and dependencies were copied successfully.
MAC OS Version: 10.14.5(Mojave)
Can someone please help to fix the problem in Case #1 ?
What differs between Case #1 vs Case #2 ?
Please try modifying it to this: /bin/sh -c /usr/bin/unzip /User/MyMac/Desktop/test.zip
It a suggestion that may work, considering you may not have a full environment on the first case, so passing the exactly path with the -c may help.

Is it possible to install multiple programs via script?

I need to re-create the development environment on my machine, and put exact applications on co-workers machine ( not in same office ).
What We Need Installed
So basically we need a NativeScript development environment created.
This will include programs like, NativeScript CLI, Android Studio, Node, etc.
Ideal Solution
Ideally I would like to write a script that would install the necessary programs without any ( or minimal ) attendance .
Can someone show me how I would create such a script?
Thank you
You can install NodeJS silently by downloading the most recent MSI installer and running msiexec /qn /l* node-log.txt /i node-vX.X.XX-x64.msi. This will install Node and NPM.
Once you've installed NPM, you can install Nativescript with npm install -g nativescript
You can install the Android studio IDE silently with the /S switch, and the SDK silently using /S /Allusers.
You can set the Android_Home environment variable inside HKLM\System\CurrentControlSet\Control\Session Manager\Environment
References:
https://gist.github.com/manuelbieh/4178908
https://www.nativescript.org/blog/installing-nativescript-on-windows
http://www.edugeek.net/forums/windows-7/173153-android-studio-unattended-install.html#post1485712
You can use autoit to create script, code what and in what order need to be installed. Than you can either put all programs version on one usb with your script - in this way you can also controll version of software installed or call to download and install from internet.
You can also include GUI with the script as well as you can create .exe file and end user need just to execute it.
Another option would be to create .bat file and code step by step what need to be installed. Look at batch file command list to see what commands are available.
Those are just two options, possibilities are endless, depend on what you feel most comfortable.

How to create a exe file from an elixir project

I am new to elixir and I am trying to create a command line app for Windows. I would like to deploy the app as an exe file that can be run from command prompt. I would also like the end user to not be required to install erlang to run the app if possible.
I have looked everywhere on Google and found nothing that seemed to help. I have installed Rebar3 but I don't know if that is what I need or not.
EDIT: I am currently using escript to run the app but I still have to type "escript app_name [args]" and I want to just run it as "app_name [args]".
You can create a release with exrm. Include it in your app dependencies in your mix file and then you'll be able to do something like : MIX_ENV=prod mix do compile, release
It will generate a tarball that contains everything you need to run your app. Including a bat file to start it on windows. It might not be a exe as you requested in your question, but it's still easy to from windows CLI
you'll find more information in the Phoenix doc (most of it applies to elixir apps without phoenix): http://www.phoenixframework.org/docs/advanced-deployment

How to run multiple DMG files in one installer using Iceberg or Package Maker?

I am trying to create a Mac Installer to streamline the process for my end users.
The idea is that they could just run one installer that would take them through the process of installing 5 different pieces of software.
Another complicating factor is that I would like to run different types of installers within this one meta-installer in a particular order
1) Install a bunch of files (including the DMG files)
2) Run one DMG file and install it
3) Run another DMG file and install it
4) Run a .sh python script that would execute through the terminal
5) Install some more files
My questions are:
Is this possible?
Any idea how to do this with either Iceberg or Package Maker?
Thanks in advance!
Well, it is definitely possible.
Seems like your requirement is that you have 5 different installers and you want to install them one by one from a single main installer.
In this case, lets assume you have all these installers inside a dmg file with one main installer (All those installers can be hidden so that user sees only the main installer when he mounts the dmg).
Now, inside the postinstall script of this main installer (assuming you use packagemaker), you can write the logic to get the current path and start installing your sub-installers. You will have to do some error-handling as well to know if any of the installation failed.
What I provided is a high level idea of how to achieve what you want to do. I am sure there are a lot of improvements you can think of when you are writing the main postinstall file that contains all the business logic.
Command to install a packagemaker installer from the script:
installer -pkg "path_to_pkg" -target /
See man page of installer for more options.

Installing Cappuccino (Objective J)

I have to confess I am not an expert in Mac OS but I am trying to install Cappuccino. I ran the script and the following files are now in the "narwhal" subdirectory. Trouble is, I have no idea what to do next. There doesn't appear to be an install executable, and no icon has appeared to invoke the development environment. Any help is appreciated.
These are the downloaded files:
I'm assuming you've downloaded the package on the website, there's a shell script. In the terminal run the bootstrap.sh file:
./bootstrap.sh
Then, you're set to install Cappuccino.
Inside the Cappuccino directory type:
jake install
or sometimes
jake sudo-install
is required. (it'll complain about permissions if you need to use sudo-install)
That will install Cappuccino itself.
To create a new cappuccino project you'll need to use the "capp" tool
capp gen MyNewProjectName
or capp --help
will tell you how to use some of the more advanced features of the capp tool.
This will give you a blank project where you can get to work.
There are other tools you can (and will want to) use when you're ready to deploy, but we can get to those when the time comes.
Additionally, the mailing list is very helpful when it comes to these kinds of questions, and it monitored much more closely than SO. :)

Resources