0

I have very limited knowledge of Mac OS and have a couple of questions related to DMG installers.

We have an application that runs on Windows, Mac and Ubuntu. We generate our installers for all three OSs using an open source tool called Omnibus that builds the installers in code, i.e. it is not a visual app with a GUI that lets you put together an installer piece by piece.

Our DMG installer is a bit basic but works fine, i.e. our application is installed as it should. However, we would like it to create a shortcut to the application on the desktop and/or the launchpad.

Bear in mind that I only mentioned Omnibus above so that we can avoid "use tool X/Y/Z" in the responses as that's not an option. Omnibus itself takes the declarative OS specific inputs to build the installers. Example: when the Windows MSI file is created Omnibus takes the input from Wix XML files where we declare that we would like a shortcut to our application like so:

<Shortcut Id="ApplicationStartMenuShortcut" 
          Name="!(loc.ProductName)" 
          Target="[PROJECTLOCATIONBIN]run-min.bat"
          WorkingDirectory="PROJECTLOCATIONBIN"
          Icon="application.ico"/>

Wix files are Windows specific and are taken as inputs to the MSI file, they are not Omnibus files.

Our DMG-specific set of input files include a file called distribution.xml based on the Distribution XML reference guide. I would guess that this file has about the same role as Wix XML files for MSI installers but I'm not sure how to proceed. Therefore I'm looking for programmatic/declarative ways to extend the current DMG installer.

I've looked into a couple of shortcuts on our test Mac and they seem to point at .app files which then start the application somehow.

I'm wondering the following issues:

  • our application starts from a shell script (.sh) - is it possible to have a shortcut icon which runs the shell script?
  • do we need to create this .app file for a shortcut? Is there a way to create one with any of the DMG input files such as distribution.xml?
  • what about shortcuts in the Launch Pad? Can those be created via a DMG installer?
    • is it a prerequisite to install the application in the /Applications catalog to create shortcuts? Currently our app is installed in the user's Application folder ~/Application for various reasons. I'm wondering if that is a limiting factor to creating desktop/launch pad icons

I'm really fumbling in the dark here so any pointers are welcome. Thanks a lot in advance!

Here's our distribution.xml file for reference in case it is relevant for this issue:

<?xml version="1.0" standalone="no"?>
<installer-gui-script minSpecVersion="1">
 <title><%= friendly_name %></title>
 <background file="background.png" alignment="bottomleft" mime- 
   type="image/png"/>
 <welcome file="welcome.html" mime-type="text/html"/>
 <license file="license.html" mime-type="text/html"/>

 <!-- Generated by productbuild - - synthesize -->
 <pkg-ref id="<%= identifier %>"/>
 <options customize="never" require-scripts="false"/>
 <choices-outline>
  <line choice="default">
   <line choice="<%= identifier %>"/>
  </line>
 </choices-outline>
 <choice id="default"/>
 <choice id="<%= identifier %>" visible="false">
  <pkg-ref id="<%= identifier %>"/>
 </choice>
 <pkg-ref id="<%= identifier %>" version="<%= version %>" 
    onConclusion="none"><%= component_pkg %></pkg-ref>
 <domains enable_anywhere="false" enable_currentUserHome="true" 
   enable_localSystem="false" />
</installer-gui-script>
  • Please do not put a shortcut on the Desktop it is for my files - macOS is not Windows so desktop shortcuts are not a thing. As for Launchpad from Apple docs "Apps that you download from the App Store or that are included with macOS automatically appear in Launchpad. If you download an app from another source, you can add it to Launchpad by moving the app to your Applications folder." So you already have that – Mark Jan 25 at 12:47

You must log in to answer this question.

Browse other questions tagged .