Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provisioning support #1190

Merged
merged 2 commits into from
Dec 21, 2023
Merged

Provisioning support #1190

merged 2 commits into from
Dec 21, 2023

Conversation

tresf
Copy link
Contributor

@tresf tresf commented Oct 13, 2023

Adds support for provisioning QZ Tray settings at install time.

Closes #885, #517

To try:

ant -Dprovision.file=./test/qz/installer/provision/resources/provision.json nsis

TODO:

  • Windows uninstallers show certificate popups (via type: 'remover')
    • One potential workaround is to invoke the uninstall commands manually.
    • EDIT: I think the installer is actually crashing.
  • Linux scripts in /opt/qz-tray/provision/ are only executable as root
  • Architecture support (e.g. { arch: 'aarch64' })

WISHLIST:

The main purpose of this is to add the following to Company Branded builds:

  • Custom install scripts
  • Custom startup scripts
  • Custom Installers (e.g. drivers)
  • Entries to qz-tray.properties
  • Entries to prefs.properties

High-Level:

  • A provision file that references the same resource shouldn't make copies:
  • Ability to automatically remove non-branded builds
  • Check for and invoke provision file at install time and at runtime
    • Handle phase: install when installer is invoked
    • Handle phase: startup when software is started
  • Ensure provision directory is bundled with all Desktop installers
  • Document command line flags for preparing the provisioning steps
    • Bundle certs or script files into a predictable location
    • Construct the provisioning file as a resource readable at both install time and runtime
  • Prepare common provisioning examples

Bundle:

  • Bundle pre-allowed certificate files
    • Automatically add CERT provisioning step to provision.json
  • Bundle startup scripts and post-install scripts for Company Branded: Add post-install scripting capabilities #885
    • Automatically add SCRIPT provisioning step to provision.json
  • Bundle advanced qz-tray.properties settings
    • Automatically add PROPERTY provisioning step to provision.json
  • Bundle advanced prefs.properties settings
    • Automatically add PREFERENCE provisioning step to provision.json
  • Bundle 3rd-party installers (e.g. drivers, etc)
    • Automatically add INSTALL provisioning step to provision.json
    • Sane handling of multiple architectures (Company Branded portal)

Deploy:

Desired usage:

ant -Dprovision.file=provision.json  makeself

One-off provisioning command:

Click to expand
java -jar out/dist/qz-tray.jar provision \
  --description "Epson TM-T88VI driver" \
  --type software \
  --phase install \
  --os mac \
  --data ~/Downloads/TMPrinterInstaller.pkg

### OR ###

java -jar out/dist/qz-tray.jar provision \
  --json provision.json

Sample provisioning file:

[
    {
        "description": "powershell script'",
        "type": "script",
        "os": "windows",
        "phase": "install",
        "data": "script1.ps1"
    },
    {
        "description": "bash script",
        "type": "script",
        "os": "linux|mac",
        "phase": "install",
        "data": "script2"
    },
    {
        "description": "certificate install",
        "type": "cert",
        "os": "*",
        "data": "cert1.crt"
    },
    {
        "description": "property install",
        "type": "property",
        "os": "*",
        "data": "log.size=2097152"
    },
    {
        "description": "pref install",
        "type": "preference",
        "os": "*",
        "data": "tray.notifications=true"
    },
    {
        "description": "qz remover",
        "type": "remover",
        "os": "*",
        "phase": "install",
        "data": "Cherry Connect,cc-util,cc"
    }
]

@tresf tresf merged commit 6869305 into master Dec 21, 2023
12 checks passed
@tresf tresf deleted the provision branch December 21, 2023 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Company Branded: Add post-install scripting capabilities
2 participants