PortProton Documentation

repository·devel·Indexed 20 days ago

https://github.com/castro-fidel/portwine

A tool for running Windows games and software on Linux using a pre-configured environment based on Valve's Proton and Proton GE. It includes optimizations like MangoHud and vkBasalt, one-click launchers for popular platforms (Epic Games, Battle.net, Ubisoft Connect), and support for various emulators. The project features a GUI built with yad and a CLI mode for automation, prefix management, and direct executable launching.

Tokens
4.2K
Snippets
6
Records
11
Agent score
70%

What's inside PortProton

  1. Overview of PortProton

    devel

    PortProton is a project designed to simplify running Windows games and software on Linux. It provides a user-friendly interface for launching applications while offering advanced configuration options for experienced users.

    Key Features:

    • Proton-based: Uses Valve's Proton and Proton GE (GloriousEggroll) modifications.
    • Optimized Environment: Includes a Steam Runtime Sniper container, MangoHud (for performance monitoring like FPS and GPU usage), and vkBasalt (for graphics improvements like FSR/DLSS).
    • One-Click Launchers: Features an AUTOINSTALL tab for popular launchers including WGC, Epic Games, Battle.net, Origin, EVE Online, Rockstar, Ubisoft Connect, and League of Legends.
    • Emulators: Includes an EMULATORS tab with support for PPSSPP, Citra, Cemu, ePSXe, MAME, and more.
  2. Configure dependencies for PortProton

    devel

    Depending on your distribution, you must install specific dependencies to ensure compatibility, especially for 32-bit games.

    NVIDIA Users

    If using proprietary NVIDIA drivers, ensure lib32-nvidia-utils is installed to support 32-bit games.

    Ubuntu / Linux Mint / Pop!_OS

    sudo dpkg --add-architecture i386
    sudo add-apt-repository multiverse
    sudo apt update
    sudo apt upgrade
    sudo apt install curl file libc6 libnss3 policykit-1 xz-utils bubblewrap curl icoutils tar libvulkan1 libvulkan1:i386 zstd cabextract xdg-utils openssl libgl libgl1:i386

    Arch Linux / Manjaro

    1. Ensure the [multilib] repository is enabled in /etc/pacman.conf:
    [multilib]
    Include = /etc/pacman.d/mirrorlist
    1. Install dependencies:
    sudo pacman -Syu bash bubblewrap zstd cabextract tar openssl desktop-file-utils curl dbus freetype2 gdk-pixbuf2 ttf-font gzip nss xorg-xrandr vulkan-driver vulkan-icd-loader lsof lib32-freetype2 lib32-libgl lib32-gcc-libs lib32-libx11 lib32-libxss lib32-libalsa-plugins lib32-libgpg-error lib32-nss lib32-vulkan-driver lib32-vulkan-icd-loader lib32-openssl
    1. For NVIDIA:
    sudo pacman -Syu lib32-nvidia-utils

    Fedora

    sudo dnf update
    sudo dnf upgrade --refresh
    sudo dnf install curl bubblewrap zstd cabextract tar openssl mesa-dri-drivers.i686 mesa-vulkan-drivers mesa-vulkan-drivers.i686 vulkan-loader vulkan-loader.i686 nss.i686 alsa-lib.i686 mesa-libGL.i686 mesa-libEGL.i686 wmctrl ImageMagick

    openSUSE

    sudo zypper install curl bubblewrap zstd cabextract tar steam

    Void Linux

    sudo xbps-install -Su void-repo-multilib
    sudo xbps-install -S bash wget icoutils yad bubblewrap zstd cabextract gzip tar xz openssl desktop-file-utils curl dbus freetype xdg-utils gdk-pixbuf noto-fonts-ttf nss xrandr lsof mesa-demos ImageMagick Vulkan-Tools libgcc alsa-plugins-32bit libX11-32bit freetype-32bit libglvnd-32bit libgpg-error-32bit nss-32bit openssl-32bit vulkan-loader vulkan-loader-32bit
  3. Install dependencies for PortProton

    devel

    PortProton requires specific system dependencies to function correctly. Ensure you install the set corresponding to your distribution.

    Important for NVIDIA Users: If you use proprietary NVIDIA drivers, you must ensure lib32-nvidia-utils (Arch) or equivalent 32-bit drivers are installed, otherwise 32-bit games will not work.

    Ubuntu / Linux Mint / Pop!_OS / Debian

    sudo dpkg --add-architecture i386
    sudo add-apt-repository multiverse
    sudo apt update
    sudo apt upgrade
    sudo apt install curl file libc6 libnss3 policykit-1 xz-utils bubblewrap curl icoutils tar libvulkan1 libvulkan1:i386 zstd cabextract xdg-utils openssl libgl1 libgl1:i386

    Arch Linux / Manjaro

    First, ensure the [multilib] repository is enabled in /etc/pacman.conf:

    [multilib]
    Include = /etc/pacman.d/mirrorlist

    Then install dependencies:

    sudo pacman -Syu bash bubblewrap zstd cabextract tar openssl desktop-file-utils curl dbus freetype2 gdk-pixbuf2 ttf-font gzip nss xorg-xrandr vulkan-driver vulkan-icd-loader lsof lib32-freetype2 lib32-libgl lib32-gcc-libs lib32-libx11 lib32-libxss lib32-libalsa-plugins lib32-libgpg-error lib32-nss lib32-vulkan-driver lib32-vulkan-icd-loader
    
    # For NVIDIA users:
    sudo pacman -Syu lib32-nvidia-utils

    Fedora

    sudo dnf update
    sudo dnf upgrade --refresh
    sudo dnf install curl bubblewrap zstd cabextract tar openssl mesa-dri-drivers.i686 mesa-vulkan-drivers mesa-vulkan-drivers.i686 vulkan-loader vulkan-loader.i686 nss.i686 alsa-lib.i686 mesa-libGL.i686 mesa-libEGL.i686 wmctrl ImageMagick

    Void Linux

    sudo xbps-install -Su void-repo-multilib
    sudo xbps-install -S bash wget icoutils yad bubblewrap zstd cabextract gzip tar xz openssl desktop-file-utils curl dbus freetype xdg-utils gdk-pixbuf noto-fonts-ttf nss xrandx lsof mesa-demos ImageMagick Vulkan-Tools libgcc alsa-plugins-32bit libX11-32bit freetype-32bit libglvnd-32bit libgpg-error-32bit nss-32bit openssl-32bit vulkan-loader vulkan-loader-32bit
    sudo dpkg --add-architecture i386
    sudo apt install curl file libc6 libnss3 policykit-1 xz-utils bubblewrap curl icoutils tar libvulkan1 libvulkan1:i386 zstd cabextract xdg-utils openssl libgl1 libgl1:i386
  4. Install PortProton on various Linux distributions

    devel

    PortProton can be installed using package managers depending on your distribution. Follow the specific command for your OS:

    Alt Linux

    Using apt-get:

    su -
    apt-get update && apt-get dist-upgrade
    apt-get install portproton
    exit

    Using eepm:

    su -
    epm full-upgrade
    epm play portproton
    exit

    Ubuntu, Debian, Linux Mint, Deepin

    Download and install the .deb package: portproton_amd64.deb

    Arch Linux (and derivatives like Manjaro, Garuda)

    Use the AUR: AUR: portproton

    Fedora 39+ and Nobara

    sudo dnf copr enable boria138/portproton
    sudo dnf install portproton

    ROSA Linux

    sudo urpmi portproton

    Flatpak (Universal)

    flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
    flatpak install flathub ru.linux_gaming.PortProton
    ### Alt Linux
    su -
    apt-get update && apt-get dist-upgrade
    apt-get install portproton
    exit
    
    ### Fedora 39+ and Nobara
    sudo dnf copr enable boria138/portproton
    sudo dnf install portproton
    
    ### Flatpak
    flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
    flatpak install flathub ru.linux_gaming.PortProton
  5. Understand the PortWINE GUI and Command Dispatcher

    devel

    The start.sh script serves as the main entrypoint for the PortWINE application. It manages a complex GUI built with yad that acts as a command dispatcher. The GUI is organized into several tabs (e.g., Installed, Autoinstalls, Emulators, Wine Settings, PortProton Settings) and uses a button_click mechanism to trigger specific actions.

    When a user interacts with the GUI, the script captures the action via the PW_YAD_SET environment variable and dispatches it using a case statement. This allows the same entrypoint to handle both the initial GUI launch and subsequent command executions triggered by buttons within the interface.

  6. How PortWINE generates and manages .desktop files

    devel

    PortWINE automatically scans the $PORT_WINE_PATH for .desktop files to populate its main menu.

    Key behaviors:

    • Conversion: The script can convert existing .desktop files from flatpak run ru.linux_gaming.PortProton format to the native env "$PORT_SCRIPTS_PATH/start.sh" format and vice versa.
    • Sorting: Desktop buttons can be sorted by game time (bytime) or last launch time (lastlaunch) based on statistics stored in $PORT_WINE_TMP_PATH/statistics.
    • Icon Handling: It extracts icons from .desktop files and uses resize_png to generate standardized 48x48 or 128x128 icons for the GUI.
    • Sanitization: It sanitizes file paths and icon names by replacing special characters (like !, %, $, &, <, etc.) with placeholders to ensure compatibility with the yad command-line arguments.
  7. Launch games via PortWINE

    devel

    You can launch Windows executables through PortWINE in several ways:

    1. Directly via CLI: Use the --launch flag with the path to the executable.
    2. Via URL schemes: Use the portproton:// scheme followed by a .ppdb URL to download and apply specific database settings.
    3. Via file extensions: Passing a .exe, .bat, .msi, .reg, or .lnk file as a direct argument to the script will trigger the launch process for that file.
    4. Via .ppack files: Passing a .ppack file will unpack the prefix and then execute it.
    # Launching an exe directly
    ./start.sh /path/to/game.exe
    
    # Launching via CLI
    ./start.sh cli --launch /path/to/game.exe
    
    # Using a remote PPDB configuration
    ./start.sh portproton://https://example.com/config.ppdb
  8. Available GUI Actions and Commands

    devel

    The PortWINE entrypoint dispatches various commands based on user interaction in the GUI. Below are the primary actions supported by the dispatcher:

    Wine & Prefix Management

    • WINECFG: Runs winecfg to edit prefix settings.
    • WINEFILE: Runs the Wine file manager.
    • WINECMD: Runs the Wine command line.
    • WINEREG: Runs regedit.
    • WINETRICKS: Opens the prefix manager/Winetricks.
    • gui_clear_pfx: Clears the current prefix to fix problems.
    • pw_create_prefix_backup: Creates a backup of the current prefix.
    • wine_uninstaller: Runs the built-in Wine uninstaller.

    PortProton & System Management

    • gui_pw_update: Updates PortProton.
    • gui_rm_portproton: Removes PortProton.
    • gui_pw_reinstall_pp: Reinstalls PortProton.
    • gui_proton_downloader: Opens the menu to download other WINE or PROTON versions.
    • change_loc: Changes the application language.
    • open_changelog: Opens the changelog.
    • gui_credits: Shows credits.
    • pw_start_cont_xterm: Starts a terminal (Xterm) for PortProton.

    Advanced & Debugging

    • portwine_start_debug: Starts PortWINE in debug mode.
    • portwine_launch: Launches the application.
    • gui_vkbasalt, gui_mangohud, gui_dgvoodoo2, gui_gamescope: Specialized tool GUIs.
    • *.desktop: Handles clicking on a generated .desktop file via button_click --desktop.
  9. PortWINE CLI command reference

    devel

    When using the cli mode, the following commands are available. Note that many commands require a path to an .exe file or a specific prefix name as an argument.

    --help                                            Show usage information
    --reinstall                                        Reinstalls PortProton and resets all settings to default
    --generate-pot                                     Creates files with translations .pot and .po
    --debug                                            Debug scripts (saves log in $PORT_WINE_PATH/scripts-debug.log)
    --update                                            Check update scripts for PortProton
    --launch                                            Launches the application immediately (requires path to .exe)
    --edit-db                                          Edit variables for a specific .exe file
    --get-user-conf                                     Get a value from user.conf file (requires variable name)
    --set-user-conf                                    Set a value in user.conf file (requires variable name and value)
    --del-user-conf                                    Delete a value from user.conf file (requires variable name)
    --list-db                                          List all available database variables
    --show-ppdb                                        Show the content of .ppdb file for specified .exe file
    --backup-prefix                                    Backup specified prefix to a file
    --restore-prefix                                   Restore prefix from backup file
    --winefile                                         Open wine file explorer (requires WINE version and prefix name)
    --winecfg                                          Open wine configuration (requires WINE version and prefix name)
    --winecmd                                          Open wine command prompt (requires WINE version and prefix name)
    --winereg                                          Open wine registry editor (requires WINE version and prefix name)
    --wine_uninstaller                                 Open wine uninstaller (requires WINE version and prefix name)
    --clear_pfx                                        Clear specified prefix (requires WINE version and prefix name)
    --mangohud-preview                                 Starts MangoHud preview in vkcube
    --initial                                          Initial setup command
    --autoinstall                                      Run autoinstall scripts
  10. Use the PortWINE CLI for automation and management

    devel

    PortWINE provides a CLI mode by passing the cli argument as the first parameter. This mode is designed for automation, headless environments, or direct control over specific game executables and configurations without the GUI.

    Common CLI tasks include launching specific executables, managing user configurations, backing up/restoring prefixes, and running Wine utilities (like winecfg) directly.

    # Launch a specific game executable
    portproton cli --launch /path/to/game.exe
    
    # Edit database variables for a specific game
    portproton cli --edit-db /path/to/game.exe PW_MANGOHUD=1 PW_VKBASALT=0
    
    # Manage user configuration values
    portproton cli --set-user-conf PW_MANGOHUD 1
    portproton cli --get-user-conf PW_MANGOHUD
    portproton cli --del-user-conf PW_MANGOHUD
    
    # Backup and Restore prefixes
    portproton cli --backup-prefix DEFAULT /path/to/backup/directory
    portproton cli --restore-prefix /path/to/backup/file.ppack
    
    # Run Wine utilities for a specific prefix
    portproton cli --winecfg WINE_LG DEFAULT
    portproton cli --winecmd WINE_LG DEFAULT