3

I broke something in my winecfg. Thus, It won't run any Windows apps in wine anymore. (I cannot afford to mv .wine and reinstall).

How do I override a dll using the command line. I disabled rpcrt4.dll by accident and want to undo it.

When launching winecfg or any windows application like MS Word, Wine prints this error message:

err:module:import_dll Library rpcrt4.dll (which is needed by L"C:\\windows\\system32\\explorer.exe") not found
Seth
  • 58,122

2 Answers2

3

Firstly, try using winetricks on the command-line to revert just your winecfg dll settings back to defaults with:

winetricks alldlls=default

If this doesn't solve the problem, you can use WINEDLLOVERRIDES; it is an environmental variable that can be used with wine to specify the dll overrides you want (or don't require). As stated on the manpage, WINEDLLOVERRIDES

Defines the override type and load order of dlls used in the loading process for any dll. There are currently two types of libraries that can be loaded into a process' address space: native windows dlls (native), wine internal dlls (builtin). The type may be abbreviated with the first letter of the type (n, b). The library may also be disabled (''). Each sequence of orders must be separated by commas.

You can either export the environmental variable, or use env and specify the variable to be used with the wine command (if you don't specify a WINEPREFIX it will use the default):

env WINEDLLOVERRIDES="rpcrt4=b,n" wine exe_to_run

This will specify that the builtin version should be tried, then the native version. If you instead use "rpcrt4=", then that dll will remain disabled and wine will not run at all.

If you want to export the value to the shell for that session, you can run

export WINEDLLOVERRIDES="rpcrt4=b,n" 

This will not affect the settings in winecfg, and they will remain the same. This environmental variable, and many other useful ones available with wine are only temporary and merely affect the shell in which they are used, either by exporting the variable or using env each time to state the variable and then run wine with that variable as it launches your program. You could also specify environmental variables in a bash script that launched your wine programs.

For more information, please see man wine, the Ubuntu manpages online, and the useful wine FAQ.

0

I assume you can do it via ~/wine/user.reg, where you should look list of dlls under [Software\Wine\DllOverrides]