Snippets

Maxime Pasquier Blizzard Battle.net via Wine

Created by Maxime Pasquier last modified
#!/bin/bash

if [ $# -lt 1 ] ; then
    echo "[erreur] une option est requise : run|config|install"
    exit
fi

# initialisation
argument=$1
export WINEARCH=win64
export WINEPREFIX=~/.winehq/blizzardBattleNet
export WINEDLLOVERRIDES="mscoree,mshtml="
cheminFichierProgramme="$WINEPREFIX/drive_c/Program Files (x86)"
cheminFichierInstallation="$WINEPREFIX/install.exe"
fichierExecution="Battle.net Launcher.exe"

# création du préfix
if [ ! -d $WINEPREFIX ]; then
    mkdir -p $WINEPREFIX
fi

# lancement wine
wineboot

# installation
if [ "$argument" = "install" ]; then
    if [ -d "$cheminFichierProgramme/Battle.net" ]; then
        echo "[erreur] l'application existe déjà, supprimez-la avant de l'installer"
        exit
    fi

    winetricks fonts arial
    winetricks dlls vcrun2019
    winetricks dlls dotnet48
    winetricks settings win10

    wget -O "$cheminFichierInstallation" "https://eu.battle.net/download/getInstaller?os=win&installer=Battle.net-Setup.exe"
    wine "$cheminFichierInstallation"
# réinstallation
elif [ "$argument" = "install-only-exe" ]; then
    wine "$cheminFichierInstallation"
# configuration
elif [ "$argument" = "config" ]; then
    winecfg
# regedit
elif [ "$argument" = "regedit" ]; then
    wine regedit
# rustine
elif [ "$argument" = "fix-hearthstone-fireside-gathering" ]; then
    echo "[information] suppression du fichier : $cheminFichierProgramme/Hearthstone/Hearthstone_Data/Plugins/LocationAPI.dll"
    rm "$cheminFichierProgramme/Hearthstone/Hearthstone_Data/Plugins/LocationAPI.dll"
else
    cd "$cheminFichierProgramme/Battle.net"
    wine "$fichierExecution"
fi

Comments (0)