sommelier-core
is an attempt to create a universal script for snapping Windows applications. It merges the original sommelier script from @Wimpress, @popey and @lucyllewy with the work @mmtrt is doing to create platform snaps for Wine. The goal of this script is that “everything just works”.
Features:
- Uses Wine from the wine-platform snaps to reduce the size of your snap.
- Uses the
gnome-3-28
extension for initializing all the generic desktop stuff. - Includes the “Modern” theme from ReactOS so Windows applications look less ugly. [optional]
- Updates the Wine prefix every time Wine changes. Can upgrade a 32-bit Wine prefix to 64-bit.
- Reinstalls the Windows app every time the snap
version
changes. - Reconfigures Wine every time the snap
revision
or the Wine version changes. - Users can run
myapp.wine
to run arbitrary applications inside this snap. - Users can run
myapp.winetricks
to modify the Wine environment.
Cons:
- The script is not 100% compatible with the original sommelier. If you need something which is not present, let me know.
I’ve built a bunch of snaps based on this script:
- TrackMania Nations Forever (downloads an installer)
- Notepad ++ (ships a portable install version in the snap itself)
- PhotoScape snap (ships an installer in the snap)
- Bridge Designer snap (ships an installer in the snap)
The rest of this post is a small tutorial. See the sommelier-core repository for a complete reference.
Snapping Windows Applications
You use sommelier-core by including the script as a part. I use branches for having a stable version and to allow for backwards-incompatible changes in the future.
parts:
sommelier:
plugin: make
source: https://github.com/snapcrafters/sommelier-core.git
source-branch: 1.0
You include the wine platform snaps. These are maintained by @mmtrt and are now auto-connected by default. Wine devel and Wine staging are also supported; run snap search wine-platform
to see all available snaps.
plugs:
# This contains all the dependencies Wine needs
wine-runtime:
interface: content
target: $SNAP/wine-runtime
default-provider: wine-platform-runtime
# This contains the Wine binaries themselves
wine-5-stable:
interface: content
target: $SNAP/wine-platform
default-provider: wine-platform-5-stable
Finally, add the apps themselves. sommelier-core uses environment variables for configuration.
environment:
WINEDLLOVERRIDES: "$WINEDLLOVERRIDES;mscoree,mshtml=" # Prevent pop-ups about Wine Mono and Wine Gecko
apps:
tmnationsforever:
extensions: [ gnome-3-28 ]
command: bin/sommelier run-exe
environment:
RUN_EXE: "C:/Program Files (x86)/TmNationsForever/TmForever.exe"
INSTALL_URL: "http://files.trackmaniaforever.com/tmnationsforever_setup.exe"
INSTALL_FLAGS: "/silent"
plugs:
- home
- network
- network-bind
- opengl
- audio-playback
- joystick
# The wine command can be used to run applications inside the wine
# environment that this snap uses.
#
# For example, users can configure the wine environment of this snap
# by running `myapp.wine winecfg`.
wine:
extensions: [ gnome-3-28 ]
command: bin/sommelier
plugs:
- home
- network
# The winetricks command can be used to run winetricks inside the wine
# environment that this snap uses.
winetricks:
extensions: [ gnome-3-28 ]
command: bin/sommelier winetricks
plugs:
- network