Question

I'm building an application which is made of four .app packages: a launcher, a client, a server manager and a runtime.

The launcher's .app is distributed in a .pkg file generated by MonoMac's packaging option. The other .app files are downloaded/auto-updated as ZIP by the launcher.

Bundling a copy of Mono within every single one of those .app files would be a waste of bandwidth / diskspace, but even more than that, I have a Mono server .exe file which is cross-platform and as such doesn't come in an .app bundle nor should pack any platform-specific DLLs. So bundling a private copy of Mono isn't an option.

Is there a way for me to create a .pkg file which has a dependency/requirement on a globally-installed Mono?

I see PackageMaker has a Requirements pane which can run scripts but I have no idea how to properly check whether Mono has been installed without relying on some hardcoded paths and stuff like that.

I'd like to have the installer check whether Mono is installed and if it isn't, install it (or, failing that, display a message with a link to the Mono website for instance).

Was it helpful?

Solution

I ended up switching to Packages which is a pretty neat tool.

I added a pre-install requirement of type "Shell script returns true". My shell script just checks for the "mono" executable using the "which" command:

#!/bin/bash
which mono
$(exit $?)

When the script returns false, I configured Packages to spit out an informative error message with a link to download Mono (for lack of a way to trigger download / installation of Mono).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top