snapcrafters / sommelier-core

Package a Windows application for Linux using a Snap with Wine.
MIT License
30 stars 10 forks source link

How to snap non-redistributable Windows application available as a zipball? #2

Open brlin-tw opened 3 years ago

brlin-tw commented 3 years ago

The application provides a zipball with the setup executable in it, how to snap this kind of application?

merlijn-sebrechts commented 3 years ago

You could add a pre-install hook that extracts the zip and then point INSTALL_EXE or RUN_EXE to it. Any script in "$SNAP/sommelier/hooks/pre-install" will be sourced before installation is attempted. These hooks can also change environment variables.

See https://github.com/snapcrafters/sommelier-core/blob/4020073016c6ee3400fa7a4f4f26308485aa3484/scripts/sommelier#L108

Hooks still need to be documented so contributions are welcome :)

merlijn-sebrechts commented 3 years ago

It might be useful to look into doing this automatically. For example, sommelier could check if INSTALL_EXE is an archive and extract it if that's the case.

Thermionix commented 2 years ago

I included a pre-install hook sourced from hooks/pre-install via;

parts:
  hooks:
    plugin: dump
    source: hooks/
    organize:
      '*': sommelier/hooks/
    stage:
      - sommelier
merlijn-sebrechts commented 2 years ago

Thanks, @Thermionix

For anyone looking to do the same thing, this is what it looks like in action: https://github.com/Thermionix/fusion360/blob/main/snap/snapcraft.yaml