Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
  1. I know that I can add dll-overrides from wineconfig GUI:

    WINEPREFIX="$somedir" winecfg
  2. I know that I can temporarily add dll-overrides from command-line by specifying WINEDLLOVERRIDES environment variable:

    WINEPREFIX="$somedir" WINEDLLOVERRIDES="$somedlloverrides" wine "$pathtoexe"

    But this will not change wine configs, just temporarily use changed settings.

I want to change wine config (specifically: add dll-override) from command-line.

Is there command-line tool that will help me to do it?

share|improve this question
P.S.: May be I should ask it on or – Sasha Apr 9 '14 at 8:58
up vote 1 down vote accepted

This is exceprt code that does what you want, from a tool you want to look into: winetricks:

    w_skip_windows w_override_dlls && return

    case $_W_mode in
        w_die "w_override_dlls: unknown mode $_W_mode.
Usage: 'w_override_dlls mode[,mode] dll ...'." ;;
        _W_mode="" ;;
    echo Using $_W_mode override for following DLLs: $@
    cat > "$W_TMP"/override-dll.reg <<_EOF_

    while test "$1" != ""
        case "$1" in
           rm -rf "$W_WINDIR_UNIX"/winsxs/manifests/

        if [ "$_W_mode" = default ]
            # To delete a registry key, give an unquoted dash as value
            echo "\"*$1\"=-" >> "$W_TMP"/override-dll.reg
            # Note: if you want to override even DLLs loaded with an absolute
            # path, you need to add an asterisk:
            echo "\"*$1\"=\"$_W_mode\"" >> "$W_TMP"/override-dll.reg
            #echo "\"$1\"=\"$_W_mode\"" >> "$W_TMP"/override-dll.reg


    w_try_regedit "$W_TMP_WIN"\\override-dll.reg

    unset _W_mode

This bash function first creates a override-dll.reg file in temp directory, then tries to import it into selected prefix using regedit. You can specify overrides like:

w_override_dlls native,builtin comctl32

Another useful function sets the override for specific application, like:

w_override_app_dlls winecfg.exe builtin comctl32

What you can do is write your own bash script using this as inspiration, or extend winetricks own functionality (google for writing winetricks verb metadata) for your use cases, or just use winetricks functions as a library.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.