| Both sides previous revision Previous revision Next revision | Previous revision |
| systems:windows [2025/05/17 12:02] – DLL Override is more userfriendly now - method by cyperghost aka crcerror crcerror | systems:windows [2026/01/22 10:28] (current) – Document Wine configuration options with FIXME badges ssokolow |
|---|
| <WRAP center round todo 60%> | <WRAP center round todo> |
| The paths for some Windows components have been updated in v39 or v40. Update them and note the older paths underneath. | Under construction. |
| </WRAP> | </WRAP> |
| |
| |
| <WRAP group> | <WRAP group> |
| |
| <WRAP center round important> | <WRAP center round important> |
| It is recommended to use **btrfs** or **ext4** for ''/userdata/'' as WINE [[https://wiki.winehq.org/FAQ#Does_Wine_run_on_all_Unix_filesystems.3F|explains on their FAQ]] that some games won't run on a non-Linux native file system. Steam games are [[https://developer.valvesoftware.com/wiki/Steam_under_Linux#Wine.2C_Steam_.26_ntfs-3g|notoriously known to be unusable under WINE when using ntfs]]. | It is recommended to use **btrfs** or **ext4** for ''/userdata/'' as WINE [[https://wiki.winehq.org/FAQ#Does_Wine_run_on_all_Unix_filesystems.3F|explains on their FAQ]] that some games won't run on a non-Linux native file system. Steam games are [[https://developer.valvesoftware.com/wiki/Steam_under_Linux#Wine.2C_Steam_.26_ntfs-3g|notoriously known to be unusable under WINE when using the NTFS filesystem]]. |
| </WRAP> | </WRAP> |
| |
| ===== Program files ===== | ===== Program files ===== |
| |
| * ''/userdata/roms/windows/'' : installed windows game (both 32 and 64-bit). | * ''/userdata/roms/windows/'': installed windows game (both 32 and 64-bit). |
| * ''/userdata/roms/windows_installers/'' : ''.iso'', ''.msi'' or ''.exe'' used to install games into ''/userdata/roms/windows/''. | * ''/userdata/roms/windows_installers/'': ''.iso'', ''.msi'' or ''.exe'' used to install games into ''/userdata/roms/windows/''. |
| |
| ==== Games coming with an installer ==== | ==== Games coming with an installer ==== |
| * Executable Installers: A ''*.exe'' or ''*.msi'' file, that usually contains "setup" or "install" in the name (in some cases, other files may be bundled with them) | * Executable Installers: A ''*.exe'' or ''*.msi'' file, that usually contains "setup" or "install" in the name (in some cases, other files may be bundled with them) |
| |
| In both cases, those files need to be put into the ''/userdata/roms/windows_installers/'' folder. Once this is done, refresh the gamelist in EmulationStation, then go into the "Windows" system, select "Install a new game", and run the installer. | In both cases, those files need to be put into the ''/userdata/roms/windows_installers/'' folder. Once this is done, refresh the gamelist in EmulationStation, then go into the "Windows" system, select "Install a new game" or select "Windows Install"-system, and run the installer file. |
| | |
| | To make the "Install a new game" visible within the "Windows" system, go to **Main Menu --> Game Collection --> Disable "Don't show groups with only one system"** (This is imho the better option - Windows Installer isn't a real system, even it can be challenging to install some Windows-based games - thank you Mr. Gates) |
| |
| After a screen announcing that the configuration is being made, the installer should open up. It'll look the same way it does inside Windows. | After a screen announcing that the configuration is being made, the installer should open up. It'll look the same way it does inside Windows. |
| | |
| | <WRAP center round tip> |
| | Some installers themselves may require additional dependencies to run. If you're not sure what they are, you could consider running the installer on a real Windows machine and then copying its installed data from that machine directly into ''/userdata/roms/windows/''. |
| | </WRAP> |
| |
| Proceed to install the game in the normal way, as for the installation path, leave it to the default: The virtual ''C:\'' Drive will be located at ''/userdata/roms/windows/<game_name>.wine/drive_c/''. | Proceed to install the game in the normal way, as for the installation path, leave it to the default: The virtual ''C:\'' Drive will be located at ''/userdata/roms/windows/<game_name>.wine/drive_c/''. |
| |
| Once the installation is done, it is tried to automatically create the ''autorun.cmd'' file. If there are several exes or you need to set up command parameters, then head over to the ''/userdata/roms/windows/<game_name>.wine/'' folder, and edit the ''autorun.cmd'' accordingly. | Once the installation is done, it tries to automatically create the ''autorun.cmd'' file based on the executable files present. If there are several exes or you need to set up command parameters, then head over to the ''/userdata/roms/windows/<game_name>.wine/'' folder, and edit the ''autorun.cmd'' accordingly. |
| |
| <WRAP center round important> | <WRAP center round important> |
| This ''<game name>.wine'' folder is called the wineprefix. | This ''<game name>.wine'' folder is called the wineprefix. |
| |
| New in **BATOCERA 42** is the possibility to add a location to the save directory or to save files. These directories or files will be transferred to ''/userdata/saves/windows/<GAME>'' and are symlinked to the game specific wineprefix. So in case you have to rebuild all wineprefixes (version change for example), your savegames are still available and working. | In Batocera **42 and higher** it is possible to add a save directory argument to specify where that game saves files to in the Wine prefix. These directories will be transferred to ''/userdata/saves/windows/<GAME>'' and are symlinked to the game specific wineprefix. So in case you have to rebuild all wineprefixes (version change for example), your savegames are still available and working. |
| |
| Example for a directory: | Example for a directory: |
| |
| |
| There are some additional parameters allowed, ''ENV'' and ''LANG''. The language can be changed per game for WINE. It is needed for certain older Windows Unicode games (mostly Japanese). If not used, games with Unicode filenames may fail to launch, and other games may display text incorrectly. May require additional fonts to be installed via Winetricks, depending on the game. Use ''LANG=[language code]''. The ''ENV'' parameter allows the adding of any other parameter, it is quite useful for [[#DLL_Override_Instructions|overridding DLL files]] but read more about in it's chapter section. | There are some additional parameters allowed, ''ENV'' and ''LANG''. The language can be changed per game for WINE. It is needed for certain older Windows Unicode games (mostly Japanese). If not used, games with Unicode filenames may fail to launch, and other games may display text incorrectly. May require additional fonts to be installed via winetricks, depending on the game. Use ''LANG=[language code]''. The ''ENV'' parameter allows the adding of any other parameter, it is quite useful for [[#DLL_Override_Instructions|overridding DLL files]] but read more about in it's chapter section. |
| |
| ENV=MESA_EXTENSION_MAX_YEAR=2002 | ENV=MESA_EXTENSION_MAX_YEAR=2002 |
| If the path isn't working, try putting ''./'' before the path. Eg. ''DIR=./drive_c/Program Files/xmoto 0.6.1'' | If the path isn't working, try putting ''./'' before the path. Eg. ''DIR=./drive_c/Program Files/xmoto 0.6.1'' |
| </WRAP> | </WRAP> |
| |
| |
| ==== Games that don't need any installation ==== | ==== Games that don't need any installation ==== |
| |
| This ''<game name>.wine'' folder is called the wineprefix. | This ''<game name>.wine'' folder is called the wineprefix. |
| | |
| | ===== Use the WINE.toolbox for setup (v43) and a clean structures ===== |
| | |
| | Please read and understand the text written above as this reflects the basics how to setup WINE games. Since **v43** the process of creating the ''autorun.cmd'', managing prefixes, compressing games, extraction of games is made with more convenience. |
| | |
| | <WRAP group> |
| | <WRAP third left>{{https://up.picr.de/50494488sb.png?nolink&500}}</WRAP> |
| | Press F1 to enter [[ built_file_manager | PCManFM ]] and navigate to ''/userdata/roms/windows''. By making a left mouse click on your windows game folders you can see several commands that will help you to setup and manage all your windows games. |
| | |
| | * Create the ''autorun.cmd'' by selecting a single exe out of list |
| | * List and manage used prefixes for all games, prefixes not bound to a prefix will be selected for deletion. This helps to clean up your prefixes and saves also a lot of space |
| | * You can also symlink a prefix to a default one, this helps if you setted up a working prefix with winetricks |
| | * If you setted up your game it is a good idea to compress/squash it |
| | * Toolbox config lets you open a dialog to set text size |
| | |
| | Some more tricks: |
| | |
| | * Use symlinks for custom runners, so you have installed ''wine-11.0-amd64'' into ''/userdata/system/wine/custom/wine-11.0-amd64'' then you symlink this to ''/userdata/system/wine/custom/gog-wine-11.0-amd64'' this keeps wine prefixes separated. |
| | * winetricks can carry more than one winetrick now, usage ''batocera-wine windows tricks <game.pc/wine> trick1 trick2 ... trick{n}'' |
| | * Some winetricks need a pure 32bit prefix. All prefixes will be installed as 64bit variant. So tick ''Enable 32bit'' within ES Advanced Game Options (This has to be done **before** the prefix is created! If the prefix was created, delete it with the file explorer and start over again |
| | * If you symlink a wine runner you can use ''win32-<wine runner>'' the word ''win32-'' will enable the build of 32bit prefixes if this runner is selected. This also helps to keep things tidy and separated. |
| | </WRAP> |
| |
| ===== Emulators ===== | ===== Emulators ===== |
| | **VIRTUAL DESKTOP ''windows.virtual_desktop''** | Define the resolution and a new dedicated window.\\ => Off ''0'', On ''1''. | | | **VIRTUAL DESKTOP ''windows.virtual_desktop''** | Define the resolution and a new dedicated window.\\ => Off ''0'', On ''1''. | |
| | **ENABLE MOUSE ''windows.force_mouse''** | Show the cursor.\\ => Off ''0'', On ''1''. | | | **ENABLE MOUSE ''windows.force_mouse''** | Show the cursor.\\ => Off ''0'', On ''1''. | |
| | **ENABLE XIM ''windows.allow_xim''** | Enable XIM support. (FIXME what's XIM?)\\ => Off ''0'', On ''1''. | | | **ENABLE XIM ''windows.allow_xim''** | Enable [[https://en.wikipedia.org/wiki/X_Input_Method|XIM]] support. => Off ''0'', On ''1''. | |
| | **NO WRITE WATCH ''windows.no_write_watch''** | Disable support for memory write watches in ntdll. (FIXME what is this used for?)\\ => Off ''0'', On ''1''. | | | **NO WRITE WATCH ''windows.no_write_watch''** | Disable support for memory write watches in ntdll. (Dangerous speed hack. Only for specific game engines which don't need them [[https://github.com/Valloric/proton-ge-custom?tab=readme-ov-file#modification|such as CoreRT]].)\\ => Off ''0'', On ''1''. | |
| | **FORCE LARGE ADDRESS ''windows.force_large_adress''** | Force WINE to run games with large address. (FIXME what is this used for?)\\ => Off ''0'', On ''1''. | | | **FORCE LARGE ADDRESS ''windows.force_large_adress''** | Pretend that 32-bit .exe files have their Large Address Aware flag set. (Grants non-LAA 32-bit games access to as much as 4GiB of RAM instead of 2GiB. May fix OOM crashes or improve performance but could also cause crashes if the game has certain kinds of signed/unsigned sloppiness in its memory handling. Note that upstream Proton considers it safe to have this enabled by default.)\\ => Off ''0'', On ''1''. | |
| | **HEAP DELAY FREE ''windows.heap_delay_free''** | Delay freeing some memory. (FIXME what is this used for?)\\ => Off ''0'', On ''1''. | | | **HEAP DELAY FREE ''windows.heap_delay_free''** | Delay freeing some memory. (Workaround for games with use-after-free bugs (eg. [[https://www.joelonsoftware.com/2000/05/24/strategy-letter-ii-chicken-and-egg-problems/|SimCity for Windows 3.x]]) which would be applied automatically by Windows's bundled AppCompat database.)\\ => Off ''0'', On ''1''. | |
| | **HIDE NVIDIA GPU ''windows.hide_nvidia_gpu''** | Force Nvidia GPUs to always be reported as AMD GPUs. (FIXME what is this used for?)\\ => Off ''0'', On ''1''. | | | **HIDE NVIDIA GPU ''windows.hide_nvidia_gpu''** | Force Nvidia GPUs to always be reported as AMD GPUs. (For games which would otherwise expect nVidia features too new for the Wine/driver/etc. version Batocera uses.)\\ => Off ''0'', On ''1''. | |
| | **ENABLE DEBUG ''windows.wine_debug''** | Enable wine debug. (FIXME be more descriptive)\\ => Off ''0'', On ''1''. | | | **ENABLE DEBUG ''windows.wine_debug''** | Enable wine's debug logging. (Useful for identifying what compatibility settings or winetricks need to be applied or for filing Wine/Proton bug reports.)\\ => Off ''0'', On ''1''. | |
| |
| Advanced options will only be applied on the first launch of the game. Adjusting these values later will not do anything. | Advanced options will only be applied on the first launch of the game. Adjusting these values later will not do anything. |
| </code> | </code> |
| |
| To automate the process you can use a small script, that automatically searches your Windows-games and calls the script for every single directory. You have not worry about losing your previosuly setted ''autrun.cmd''s - older files will be renamed to ''autorun.cmd.bak'' and ''autorun.cmd.bak.~1~ ......'' | To automate the process you can use a small script, that automatically searches your Windows-games and calls the script for every single directory. Existing ''autorun.cmd'' files will be renamed to ''autorun.cmd.bak'', ''autorun.cmd.bak.~1~'', etc. |
| |
| <code bash| Autoautorun.sh> | <code bash| Autoautorun.sh> |
| Where ''/userdata/roms/windows/Windlands.pc'' is the path to the game | Where ''/userdata/roms/windows/Windlands.pc'' is the path to the game |
| |
| ===== Manually add Redistributables, Packages and Registry entries to your game ===== | ===== Manually add redistributables, packages and registry entries to your game ===== |
| |
| In this section it is showen how to manually add addition Redistributable, MSI-Packages, Registry entries and some Fonts to your specific game. The process is straightforward and Batocera is able to easily add additional files to your installation. | Create the folder in the appropriate locations: |
| |
| ^ Filetype | Install location ^ Backuplocation ^ | ^ Filetype | Install location ^ Backuplocation ^ |
| ==== Manually install an exe files ==== | ==== Manually install an exe files ==== |
| |
| To install dependencies inside a WINEprefix, is by creating a folder in ''/userdata/system/wine/exe'', and then putting the required executables inside. For 32-bit architectures, install the 32-bit version, and for 64-bit architectures, install both the 32 and 64-bit versions. For each one, a download SSH command will be given. Read [[https://webpifeed.blob.core.windows.net/webpifeed/eula/aspnetcomponent_rtw_ENU.htm|here]] the related licenses for those packages. | To install dependencies inside a WINEprefix, is by creating a folder in ''/userdata/system/wine/exe'', and then putting the required executable files inside. For 32-bit architectures, install the 32-bit version, and for 64-bit architectures, install both the 32 and 64-bit versions. For each one, a download SSH command will be given. Read [[https://webpifeed.blob.core.windows.net/webpifeed/eula/aspnetcomponent_rtw_ENU.htm|here]] the related licenses for those packages. |
| |
| --> Common list of Redistributable from Batocera server | --> Common list of redistributable from Batocera server |
| |
| * **DirectX3D** : https://batocera.org/users/liberodark/wine/directx.7z | * **DirectX3D** : https://batocera.org/users/liberodark/wine/directx.7z |
| |
| To use a Windows Installer package inside your WINEprefix, create a folder in ''/userdata/system/wine/msi'', and then putting the required msi-package inside. Start the game and the dependencies will install themselves. Place only ''*.msi''-files in the folder named above. After finishing the game you will find the used msi-packages in ''/userdata/system/wine/installed.msi'' folder. | To use a Windows Installer package inside your WINEprefix, create a folder in ''/userdata/system/wine/msi'', and then putting the required msi-package inside. Start the game and the dependencies will install themselves. Place only ''*.msi''-files in the folder named above. After finishing the game you will find the used msi-packages in ''/userdata/system/wine/installed.msi'' folder. |
| |
| |
| ==== Manually put a registry file ==== | ==== Manually put a registry file ==== |
| **Adding the ENV parameter** | **Adding the ENV parameter** |
| |
| - First, add your game to the Batocera system and launch it once. This will create the required Windows file structure. | - First, add your game to the Batocera system, launch it once and then exit the game back to ES, which will create the required WINE bottle. |
| - On a PC connected to the same network as your Batocera system, navigate to your WINE-Bottle | - Edit the ''/userdata/roms/windows/<yourGame>.pc/autorun.cmd'' file and add the according ''ENV=WINEDLLOVERRIDES="<NameOfDllFile>"="native"'' |
| - This can be ''/share/system/wine-bottles/windows/ge-custom/'' | |
| - or ''/share/roms/windows/<game>.wine'' | |
| - or ''/share/system/wine-bottles/windows/wine-tkg'' | |
| - Edit the ''autorun.cmd'' file and add ''ENV=WINEDLLOVERRIDES="NameOfDllFile"="native"'' | |
| - Do not use the dll-extension, just the plain filename | - Do not use the dll-extension, just the plain filename |
| - ''native'' means to override the DLL | - ''native'' means to override the DLL |
| - Save the file and start the game | - Save the file and start the game |
| |
| *You can daisychain WINEDLLOVERRIDES like ''ENV=WINEDLLOVERRIDES="NameOfDllFile1"="native" WINEDLLOVERRIDES="NameOfDllFile2"="native"''* | *You can daisychain WINEDLLOVERRIDES like ''ENV=WINEDLLOVERRIDES="msvbvm50,comctl32.ocx=n"'' or''ENV=WINEDLLOVERRIDES="NameOfDllFile1"="native" WINEDLLOVERRIDES="NameOfDllFile2"="native"''* |
| |
| **Editing the user.reg file** | **Editing the user.reg file** |
| - Add your override in this section: | - Add your override in this section: |
| * **Here’s how you can format your override entries:** | * **Here’s how you can format your override entries:** |
| * ''"NameOfDllFile"="native,builtin"'' | * ''"<NameOfDllFile1>"="native,builtin"'' |
| * ''"NameOfDllFile"="native"'' | * ''"<NameOfDllFile2>"="native"'' |
| * ''"NameOfDllFile"="builtin"'' | * ''"<NameOfDllFile3>"="builtin"'' |
| * ''"NameOfDllFile"="disabled"'' | * ''"<NameOfDllFile4>"="disabled"'' |
| | * ...and so on. |
| |
| Remember, you **DO NOT want to include the file extension in your entry**. For example, if you’re overriding ''ddraw.dll'', then you would simple say ''ddraw'' before the equal sign. | Remember, you **DO NOT want to include the file extension in your entry**. For example, if you’re overriding ''ddraw.dll'', then you would simple say ''ddraw'' before the equal sign. |
| | |
| A list of WINEtricks commands and more detail about using WINEtricks with Batocera is available [[emulators:winetricks|right here]]. | A list of WINEtricks commands and more detail about using WINEtricks with Batocera is available [[emulators:winetricks|right here]]. |
| | |
| | If a game needs several tricks you can add as many trick commands as you like (since v43), so you don't need to call the command every time |
| | |
| | batocera-wine windows tricks /userdata/roms/windows/aok.wine directplay vb5run vb6run |
| | |
| |
| ===== Troubleshooting ===== | ===== Troubleshooting ===== |
| * Get WINE version for Proton: <code>/usr/wine/proton/bin/wine64 --version</code> | * Get WINE version for Proton: <code>/usr/wine/proton/bin/wine64 --version</code> |
| |
| ==== Custom WINE versions in Batocera? ==== | ==== How to install custom WINE versions/runners in Batocera ==== |
| |
| With v40, you can now install a compatible version of Wine into the folder <code>/userdata/system/wine/custom/</code> | <WRAP center round help> |
| The runner should be in it's own folder, i.e. <code>/userdata/system/wine/custom/Wine-9.4/</code> | With v40 and later, you can now install a compatible version of Wine into the folder ''/userdata/system/wine/custom/''. The runner should be in it's own folder, i.e. ''/userdata/system/wine/custom/Wine-9.4/'' |
| | </WRAP> |
| |
| Batocera EmulationStation will then allow you to choose the runner of your choice. | <WRAP center round tip> |
| | A good resource for WINE-versions: [[https://github.com/Kron4ek/Wine-Builds]] |
| | </WRAP> |
| | |
| | - Create the directory <code>/userdata/system/wine/custom</code> if it doesn't already exist. This can be done using Windows/Samba or Terminal/WinSCP. |
| | - Download the desired WINE-version and unzip and copy them into its own directory like <code>/userdata/system/wine/custom/Wine-9.4</code> This can be done using Windows/Samba or WinSCP. |
| | - Using the Terminal or SSH, navigate to ///userdata/system/wine/custom// using <code>cd /userdata/system/wine/custom</code> |
| | - Set the correct rights for execution of the WINE files using <code>chmod a+x -R *</code> |
| | - Batocera EmulationStation will then allow you to choose the runner of your choice and you should be ready to go. |
| |
| {{:systems:pxl_20240329_043046171.jpg?400|}} | {{:systems:pxl_20240329_043046171.jpg?400|}} |
| |
| The best compatible versions are from [[https://github.com/Kron4ek/Wine-Builds]] | |
| ==== Further troubleshooting ==== | ==== Further troubleshooting ==== |
| |
| For further troubleshooting, refer to the [[:support|generic support pages]]. | For further troubleshooting, refer to the [[:support|generic support pages]]. |
| |