You can’t trivially run a Windows installer binary inside a Nix derivation and especially not to install it inside a Docker image.
I guess you could build up a WINE prefix from Nix expressions and copy it to a mutable place at runtime? If that wasn’t bad enough, if that installer needs a GUI though, that’s going to become very complex very fast.
Windows is an imperative mess and generally a lost cause. When I built a Docker container for running a Windows app, I built a container that has a sane WINE env and GUI/VNC setup and then used it to manage an imperative WINE prefix where I manually installed the app.
That sadly matches my experience. Trying to package anything involving wine often breaks due to the presence of symlinks, as well. I’ve used the “copy at runtime” approach before, but it’ll take some bespoke scripting to make work in a container.
That is something I tried to do. The installer needs a GUI but I was able to automate it because the qt installer framework can execute scripts. However the resulting WINEPREFIX (although it is in a relative path from my nix expression file) has symlinks to my home folder internally. Since I don’t know wine very well, I don’t know how to prevent it to link to anything outside the WINEPREFIX.
Have you any experience on how to make a wine prefix self contained? Than I could just copy it into my container. It would be no problem if it would still need to be writable because the container is only used by the ci server and it reloads the container every time I rerun the build.
I’ve read this thread before and it seems to have some great ideas on how to use wine applications on a desktop computer. But I don’t know really how to apply this to containers without x-Server (the installer itself has a GUI. Later in the container I will only use cli tools from qt with wine). But since I’m no expert with windows applications (try to avoid it if I can, since, at least to me, it’s so unpredictable) I don’t quit understand why windows applications have to be in a mutable place. Are they modified at runtime?
You are asking on a very Unixy forum, not many here will have much prior experience with this If it’s not that, then it’s probably just down to software engineering practices on the platform. A fair number of Linux applications will struggle being run from a read-only location, too.
Perhaps you can use Xdummy or Xvfb to set up a dummy X11 server prior to using Wine. That way Wine will feel happy and save in it’s cosy X11 environment, and move along with its business.