Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [com.blizzard.Diablo3] Initial Diablo III flatpak #73

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 157 additions & 0 deletions com.blizzard.Diablo3/com.blizzard.Diablo3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
app-id: com.blizzard.Diablo3
branch: stable

runtime: org.winepak.Platform
runtime-version: 3.0
sdk: org.winepak.Sdk

base: com.blizzard.BattleNet.BaseApp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're basing off the base app but not using the battlenet-installer, can you please update the manifest to mirror the style of the StarCraft2 module: https://github.com/winepak/applications/blob/master/com.blizzard.StarCraft2/com.blizzard.StarCraft2.yml#L53

The battlenet:// shortcut is battlenet://D3

Source: b1f2837

base-version: stable

command: diablo3

inherit-extensions:
- org.winepak.Platform.Compat32
- org.winepak.Platform.Extension.corefonts

add-extensions:
org.winepak.Platform.Wine:
directory: lib/wine
version: 3.10-staging
add-ld-path: lib
no-autodownload: false

org.winepak.Platform.Wine.Compat32:
directory: lib/wine-32bit
version: 3.10-staging
add-ld-path: lib
no-autodownload: false

org.winepak.Platform.Extension.vcrun2015:
directory: lib/extension/vcrun2015
version: 3.0
add-ld-path: lib
no-autodownload: false

tags:
- proprietary

finish-args:
- --socket=x11
- --socket=pulseaudio
- --share=ipc
- --share=network
- --device=dri
- --allow=multiarch
# --allow=devel is required to launch Diablo III
#
# Without it the game will partily launch then crash.
#
# Ideally flatpak applications shouldn't have --allow=devel, so this needs to
# be investigated.
- --allow=devel

modules:
- name: setup-wine
buildsystem: simple
build-commands:
- mkdir -p /app/lib/wine

- name: setup-wine-compat32
buildsystem: simple
build-commands:
- mkdir -p /app/lib/wine-32bit

- name: setup-vcrun2015
buildsystem: simple
build-commands:
- mkdir -p /app/lib/extension/vcrun2015

- name: diablo-3
only-arches:
- x86_64
buildsystem: simple
build-commands:
- install -d /app/bin
- install d3-installer /app/bin
- install diablo3 /app/bin
# - install -Dm644 com.blizzard.Diablo3.appdata.xml /app/share/appdata/com.blizzard.Diablo3.appdata.xml
# - install -Dm644 com.blizzard.Diablo3.desktop /app/share/applications/com.blizzard.Diablo3.desktop
sources:
- type: script
dest-filename: d3-installer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick but I would prefer if it was diablo3-installer. All of the other installers are application & application-installer.

commands:
- if [ -z "$WINEPREFIX" ] ; then
- ' echo "No wine prefix set or is empty, abort."'
- ' exit 1'
- fi
-
- if [ -e "${WINEPREFIX}/dosdevices/c:/Program Files (x86)/Battle.net" ] ; then
- ' echo "This prefix already has an exisiting ''Diablo III'' install at ${WINEPREFIX}"'
- ' echo "In order to install ''Diablo III'' you must move or delete the current prefix."'
- ' exit 1'
- fi
-
- echo "Downloading installer..."
- curl -L --progress-bar --output "${XDG_CACHE_HOME}/d3-installer.exe" "https://www.battle.net/download/getInstallerForGame?os=win&version=LIVE&gameProgram=DIABLO_3"
-
- echo "Setting-up wine prefix..."
- wineboot
-
- echo "Installing Extension(s)..."
- echo "Installing corefonts..."
- source /app/lib/extension/corefonts/bin/corefonts-install64
-
- echo "Installing vcrun2015..."
- source /app/lib/extension/vcrun2015/bin/vcrun2015-install64
-
- echo "Performing tweak(s)..."
- echo "Disable winemenubuilder.exe..."
- wine64 reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v winemenubuilder.exe /d '' /f
-
- echo "Clear Windows Version"
- wine64 reg delete 'HKLM\Software\Microsoft\Windows\CurrentVersion' /v SubVersionNumber /f
- wine64 reg delete 'HKLM\Software\Microsoft\Windows\CurrentVersion' /v VersionNumber /f
- wine64 reg delete 'HKLM\Software\Microsoft\Windows NT\CurrentVersion' /v CSDVersion /f
- wine64 reg delete 'HKLM\Software\Microsoft\Windows NT\CurrentVersion' /v CurrentBuildNumber /f
- wine64 reg delete 'HKLM\Software\Microsoft\Windows NT\CurrentVersion' /v CurrentVersion /f
- wine64 reg delete 'HKLM\System\CurrentControlSet\Control\ProductOptions' /v ProductType /f
- wine64 reg delete 'HKLM\System\CurrentControlSet\Control\ServiceCurrent' /v OS /f
- wine64 reg delete 'HKLM\System\CurrentControlSet\Control\Windows' /v CSDVersion /f
- wine64 reg delete 'HKCU\Software\Wine' /v Version /f
- wine64 reg delete 'HKLM\System\CurrentControlSet\Control\ProductOptions' /v ProductType /f
-
- echo "Set Windows Version to 10"
- wine64 reg add 'HKLM\System\CurrentControlSet\Control\ProductOptions' /v ProductType /d 'WinNT' /f
- wine64 reg add 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' /v CSDVersion /d '' /f
- wine64 reg add 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' /v CurrentBuildNumber /d '10240' /f
- wine64 reg add 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' /v CurrentVersion /d '10.0' /f
- wine64 reg add 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Windows' /v CSDVersion /t REG_DWORD /d 00000000 /f
-
- echo "Create Battle.net config"
- mkdir -p "${WINEPREFIX}/dosdevices/c:/users/${USER}/Application Data/Battle.net"
- 'echo "{ \"Client\": { \"HardwareAcceleration\": false, \"Sound\": { \"Enabled\": false } } }" > "${WINEPREFIX}/dosdevices/c:/users/${USER}/Application Data/Battle.net/Battle.net.config"'
-
- echo "Installing application..."
- wine64 "${XDG_CACHE_HOME}/d3-installer.exe"
-
- echo "Installer finished"
- type: script
dest-filename: diablo3
commands:
- export WINEARCH=win64
-
- if ! [ -e "${WINEPREFIX}/dosdevices/c:/Program Files (x86)/Battle.net" ] ; then
- ' if ! /app/bin/d3-installer; then'
- ' echo "Installation failed, abort."'
- ' exit 1'
- ' fi'
- fi
-
- wine64 "C:/Program Files (x86)/Battle.net/Battle.net Launcher.exe"
# - type: file
# path: com.blizzard.Diablo3.appdata.xml
# - type: file
# path: com.blizzard.Diablo3.desktop