[Nix-dev] packaging windows applications through wine

aszlig aszlig at redmoonstudios.org
Tue Apr 25 02:01:11 CEST 2017


On Mon, Apr 24, 2017 at 02:39:02AM +0000, Taeer Bar-Yam wrote:
> When one installs things through wine, one usually has to click
> through a bunch of agreements for things installed via winetricks. Can
> we bypass this so we can make nix packages for these things that
> installs nicely?

That really depnds on the installer:

  * If it's an MSI file, you may be able to automate this using msiexec.
  * Some installers can be extracted via cabextract, unshield, 7zip, etc...
  * You could override specific functionality via WINEDLLOVERRIDES, but
    that might be a bit difficult in a GUI application.
  * Automate it via something like xdotool in an Xvfb.

I guess the simplest method would be the latter, because if you extract
the installer archive there might be some missing files or registry keys
that you need to apply as well.

Here is an example for automating this via xdotool:

https://github.com/openlab-aux/vuizvui/blob/97e440e996e9c418e46af3dbcdba58595b5c11ea/pkgs/aszlig/santander/default.nix#L63-L74

In this case the installer is quite simple because all you need to do is
click "Next -> Next -> Next -> ..." here.

If it's something more complicated, like if you need ta accept an EULA,
then you might be either in luck and you just need to apply something
like "key alt+a Return" all over again if for example alt+a is for
"accept EULA".

In most cases however it isn't that easy, so I'd try to look whether you
can get information about what's displayed via tracing the font
rendering calls in wine. Another way would be to use OCR, but that is
slower and might be a bit error prone.

> The other challenge I see is where do you put the wineprefix? Because
> on the one hand you want the installation to happen at system build
> time, so that would suggest the nix store. But you also want the
> application to be able to write files (like saves &c) so that would
> have to be in your home folder.

You could set the user data directory to some other unix path via
dosdevices/ and change %APPDATA% accordingly, like:

https://support.microsoft.com/en-us/help/190234/prb-how-to-modify-the-personal-directory-for-all-new-users

Another way would be to use a wrapper that uses overlayfs to write all
the differences of the immutable store path to some location within the
home directory (like eg. ${XDG_DATA_HOME:-$HOME/.local/share}/your_app).

> Is how to package wine applications a solved problem, or do I need to
> do some creative work?

The latter :-)

a!
-- 
aszlig
Universal dilettante
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 230 bytes
Desc: Digital signature
URL: <https://mailman.science.uu.nl/pipermail/nix-dev/attachments/20170425/85eca528/attachment.sig>


More information about the nix-dev mailing list