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, portable Windows application? #1

Closed brlin-tw closed 2 years ago

brlin-tw commented 3 years ago

The target application provides a portable executable that doesn't require installing, how to snap it?

merlijn-sebrechts commented 3 years ago

You can use the "RUN_EXE" environment variable for this. Just add the exe to your snap and point RUN_EXE to that location.

This is what the notepad-plus-plus snap does. Taqi recently ported it to sommelier-core: https://github.com/mmtrt/notepad-plus-plus/blob/master/snap/snapcraft.yaml

docs contributions are welcome! :)

brlin-tw commented 2 years ago

Apologies for the ignorance, I finally am able to come back to this.

My implementation is to download the executable in runtime using a launcher script, then set the RUN_EXE environment variable to the path

https://github.com/brlin-tw/xnote-stopwatch-snap/blob/4ee68ea0e8b8b6d6ddaa13b44ece7b54bce8a183/snap/local/launchers/xnote-stopwatch-launch

https://github.com/brlin-tw/xnote-stopwatch-snap/blob/4ee68ea0e8b8b6d6ddaa13b44ece7b54bce8a183/snap/snapcraft.yaml#L110

Not sure how to improve the documentation, though, my thought is to simply enumerate different kinds of applications and their corresponding snap recipe in the Example Snaps section of the README for reference. I've quickly made up #30 for the idea.