Good to have CLI program or script

It should be possible to do a variety of Wine tasks solely from the command line. The advantage to this is that we can then configure Wine using scripts, without having to duplicate any code. Wine itself is the natural way to do this, as we can abstract away any possible differences between future versions of Wine and how it stores specific configuration metadata. We also prevent other projects from having to recreate and maintain their own registry parser code, which could become exceptionally difficult if Wine (or Windows) ever changes the way the registry is handled.

Desired features


  • --list-uninstall: would output a list of applications that can be removed, as well as their short descriptions and the linux path of their icon
  • --uninstall FOO: would launch the uninstaller for application foo

These two commands are desirable so we can uninstall Windows applications from within the Gnome add/remove programs applet, gnome-app-install.

Windows version

  • --windows-version: list the default windows version
  • --windows-version FOO.EXE: show the windows version that foo.exe would run with. Output is "default" or whatever is in the registry
  • --windows-version [foo.exe] WINVERSION: set default windows version to WINVERSION, or set the version specifically for foo.exe

These commands are desirable so we can set the windows version from a context menu (right click the application, go to properties, and then set it there), as well as setting the default windows version from a (very simplified) version of winecfg.


Implementation should come in a few steps to make it into small, Alexandre-approved patches.

  • Create stub functions for calling Wine or winecfg with above arguments
  • Implement functionality for above commands - copy it from winecfg
  • Change winecfg to use the same codepath

maybe: modify winecfg so that it is a script, if the script detects no arguments then launch normal winecfg gui, if args detected then launch this new command line config program. Having this command line configure stuff separate from the main wine launcher might be more tasty to Alexandre. Maybe this is what you were meaning all along, in that case then I'm just clarifying =)

maybe: have winecfg be the command line tool when launched with arguments. Have all functionality of winecfg accessible through command line arguments. Use the existing winecfg code for the actual configuration.

No worker currently (in fact, this idea still needs to be mailed to wine-devel)

[ReeceDunn]: I have posted some ideas on how to improve winecfg (see, including adding CLI support to winecfg. While not as extensive as this, it should at least start the ball rolling. CLI support makes a lot of sense, especially allowing for post-install/pre-removal scripts to do the right thing. The usage model I was thinking of in the e-mail is to use winecfg to install a Ubuntu human.theme file as a post-install step.

[JohnKlehm]: Once reg.exe gets a bit more implemented it might be possible to script most of the functionality here utilizing it in combination with a few other small exe tools. Wine could provide a set of scripts (,, With the control panel applet stuff being done winecfg is probably on its way out or atleast on its way to being a control panel applet. Either way makes it harder for console use.

[ChristianDannieStorgaard]: Since the bug ( has been (winecfg is a strictly GUI tool, the requested functionality should be provided by small Wine tools, one tool per job, similar to reg.exe), I've created a python script that functions as this page describes, using regedit.exe for read/write operations. Getting descriptions and icons is done from installed menu entries in ~/.local/share/applications/*wine*.desktop and checked against registry info (gathered from regedit.exe). I doubt the method of getting the info from the registry will change since it matches Windows' way of doing it. Winversion functionality is the same as winecfg, "not" the same as winetricks. The script also has more functionality than the description here - I'm aiming for feature compatibility with winecfg. Take a look at ChristianDannieStorgaard for details.


ConsoleConfiguration (last edited 2013-07-08 04:37:04 by KyleAuble)