sumo icon indicating copy to clipboard operation
sumo copied to clipboard

Native installer and packaging for sumo on macOS

Open RobertHilbrich opened this issue 7 months ago • 1 comments

Overview

It seems that the macOS packaging approach so far has not be satisfying for a lot of users. We should investigate other options - probably native macOS options.

Requirements

  • "Native" apps for sumo-gui, netedit and the webwizard to start them via spotlight / taskbar
  • Easy to install and remove SUMO
  • Access to command line tools and python tools
  • Does not depend on brew or MacPorts
  • Is stable, even if brew decides to update libraries
  • Support for nightly releases

Proposal

  • Create a SUMO "framework" package containing all libraries, documentation, python tools, ... (i.e. SUMO)
  • Create "native" apps as basic wrappers / launchers for sumo-gui, netedit and the webwizard
  • Create an installer for the framework and the apps

Things to discuss

  • How to provide an uninstall script?
  • How to set SUMO_HOME?
  • How to check if XQuartz is present?
  • Notarization? Code Signing?

Implementation

Here are my notes from googling and checking the usage of pkgbuild and productbuild. There is also CPack, but I assume, that it is a wiser choice to use macOS tools.

SUMO Framework Package

  • Create a directory structure that mimics a macOS framework, then: pkgbuild --root SUMOFramework.framework --identifier com.yourcompany.SUMOFramework --version 1.0 --install-location /Library/Frameworks/SUMOFramework.framework SUMOFramework.pkg

App Packages

  • Create packages for each app that will be moved to the /Applications folder, then: pkgbuild --root SumoGUI.app --identifier com.yourcompany.SumoGUI --version 1.0 --install-location /Applications/SumoGUI.app SumoGUI.pkg

Distribution XML for the Installer

  • Create a distribution.xml file that specifies the packages to be included in the installer and their installation order:
<installer-gui-script minSpecVersion="1">
    <title>SUMO Installer</title>
    <background file="background.png" scaling="proportional"/>
    <welcome file="welcome.html"/>
    <license file="license.html"/>
    <choices-outline>
        <line choice="sumo_framework"/>
        <line choice="sumo_gui"/>
        <line choice="netedit"/>
    </choices-outline>
    <choice id="sumo_framework" title="SUMO Framework">
        <pkg-ref id="com.yourcompany.SUMOFramework"/>
    </choice>
    <choice id="sumo_gui" title="SUMO GUI">
        <pkg-ref id="com.yourcompany.SumoGUI"/>
    </choice>
    <choice id="netedit" title="Netedit">
        <pkg-ref id="com.yourcompany.Netedit"/>
    </choice>
    <pkg-ref id="com.yourcompany.SUMOFramework" installKBytes="0" version="1.0">
        <payload installKBytes="0"/>
        <bundle-version/>
    </pkg-ref>
    <pkg-ref id="com.yourcompany.SumoGUI" installKBytes="0" version="1.0">
        <payload installKBytes="0"/>
        <bundle-version/>
    </pkg-ref>
    <pkg-ref id="com.yourcompany.Netedit" installKBytes="0" version="1.0">
        <payload installKBytes="0"/>
        <bundle-version/>
    </pkg-ref>
</installer-gui-script>

Installer Package

  • Use productbuild to create the installer package that includes the framework and app packages: productbuild --distribution distribution.xml --package-path . --resources ./resources --version 1.0 SUMOInstaller.pkg

RobertHilbrich avatar Jul 15 '24 14:07 RobertHilbrich