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.Hearthstone] Add Hearthstone #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
38 changes: 38 additions & 0 deletions com.blizzard.Hearthstone/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Hearthstone
A fast-paced strategy card game

## Status

| Arch | Installs | Runs | Notes |
| ----- | -------- | ---- | ---------------------------------------------------------------- |
| 32bit | N/A | N/A | |
| 64bit | Yes | Yes | After installation, the battle.net client *must* first be closed |

## Build & Install
### Repo
#### 32bit

flatpak-builder --arch=i386 --force-clean builds --repo=winepak com.blizzard.Hearthstone.yml
flatpak --user install winepak com.blizzard.Hearthstone

#### 64bit

flatpak-builder --arch=x86_64 --force-clean builds --repo=winepak com.blizzard.Hearthstone.yml
flatpak --user install winepak com.blizzard.Hearthstone

### Direct
#### 32bit

flatpak-builder --user --arch=i386 --force-clean --install builds com.blizzard.Hearthstone.yml

#### 64bit

flatpak-builder --user --arch=x86_64 --force-clean --install builds com.blizzard.Hearthstone.yml

## Run

flatpak run com.blizzard.Hearthstone

Note: Make sure that during the first run, you close the battle.net launcher
before signing in. It will be relaunched for you, after which you
can use the client as you would normally do.
60 changes: 60 additions & 0 deletions com.blizzard.Hearthstone/com.blizzard.Hearthstone.appdata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>com.blizzard.Hearthstone.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LicenseRef-proprietary</project_license>
<name>Hearthstone</name>
<summary>A fast-paced strategy card game</summary>
<description>
<p>Sheathe your sword, draw your deck, and get ready for Hearthstone - the fast-paced strategy card game that's easy to learn and massively fun. Start a free game and play your cards to sling spells, summon creatures, and command the heroes of Warcraft in duels of epic strategy.</p>
</description>
<screenshots>
<screenshot type="default">
<image width="980" height="590">https://d2vkoy1na2a6o6.cloudfront.net/images/media/screenshots/en-us/ss4-full-aeeaacb3830c9c68ae0bf10c5418d8b56c5b68195a94fcc276d64d4f16e0d05c34f6012234531b09564ffe98bdb72a0898d7369643766ae255ec52ddb8539874.jpg</image>
</screenshot>
<screenshot>
<image width="980" height="590">https://d2vkoy1na2a6o6.cloudfront.net/images/media/screenshots/en-us/ss5-full-7d4989a6037604c0ba10efb3029fa879a527c93f8ec07fa37e753dd6ec40712b71c96259225345d01de3453fc165d6d4bb398f201916dddebec74350e0970117.jpg</image>
</screenshot>
<screenshot>
<image width="980" height="590">https://d2vkoy1na2a6o6.cloudfront.net/images/media/screenshots/en-us/ss1-full-72f425379264f9def23c9445d81c7f55740121789ff98f083f2a0f5e9b1f75ccb20315c42cc7d9142d5745a5d67d5c89900d608d3ecca721eb5827a3f53688a7.jpg</image>
</screenshot>
<screenshot>
<image width="980" height="590">https://d2vkoy1na2a6o6.cloudfront.net/images/media/screenshots/en-us/ss2-full-244c09bab5752fb44972016c838ce4834e474685fc1e04860ddef035fe7ced61cc919cd5fad96e3b926e5ad7ae8775de091aa5fc283bf306ff36e66d4b757298.jpg</image>
</screenshot>
<screenshot>
<image width="980" height="590">https://d2vkoy1na2a6o6.cloudfront.net/images/media/screenshots/en-us/ss3-full-358d2b15e8a699c615ba1c9fae7dd78747c37035330c84284b40a6643731c138315e22e39770f1597f5413531d5ddf26ae8e5e9cec5c77a4d862304d68f6b917.jpg</image>
</screenshot>
</screenshots>
<project_group>winepak</project_group>
<developer_name>Blizzard Entertainment</developer_name>

<url type="homepage">https://playhearthstone.com</url>
<url type="help">https://us.battle.net/support/en/games/hearthstone</url>
<url type="bugtracker">https://us.battle.net/forums/en/hearthstone/10591462/</url>

<categories>
<category>Game</category>
<category>Strategy</category>
</categories>

<content_rating type="oars-1.1">
<content_attribute id="violence-fantasy">moderate</content_attribute>
<content_attribute id="violence-bloodshed">mild</content_attribute>
<content_attribute id="drugs-alcohol">mild</content_attribute>
<content_attribute id="sex-themes">mild</content_attribute>
<content_attribute id="sex-appearance">moderate</content_attribute>
<content_attribute id="social-chat">intense</content_attribute>
<content_attribute id="money-purchasing">intense</content_attribute>
<content_attribute id="money-gambling">mild</content_attribute>
</content_rating>

<releases>
<release date="2018-07-14" version="2018.07.14">
<description>
<ul>
<li>Initial release of Hearthstone via winepak.</li>
</ul>
</description>
</release>
</releases>
</component>
11 changes: 11 additions & 0 deletions com.blizzard.Hearthstone/com.blizzard.Hearthstone.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Desktop Entry]
Name=Hearthstone
Comment=A fast-paced strategy card game
Exec=hearthstone %U
Icon=com.blizzard.Hearthstone
StartupNotify=true
Terminal=false
Type=Application
MimeType=application/x-ms-dos-executable;application/x-msi;application/x-ms-shortcut;
Categories=Game;Strategy;
Keywords=Hearthstone;Blizzard;Strategy;Hearthstone;
36 changes: 36 additions & 0 deletions com.blizzard.Hearthstone/com.blizzard.Hearthstone.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
157 changes: 157 additions & 0 deletions com.blizzard.Hearthstone/com.blizzard.Hearthstone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
app-id: com.blizzard.Hearthstone
branch: stable

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

base: com.blizzard.BattleNet.BaseApp
base-version: stable

command: hearthstone

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

add-extensions:
Copy link
Contributor

@julianrichen julianrichen Jul 14, 2018

Choose a reason for hiding this comment

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

Add:

org.winepak.Platform.Extension.d3dx9:
  directory: lib/extension/d3dx9
  version: 3.0
  no-autodownload: false

org.winepak.Platform.Extension.d3dx9:
directory: lib/extension/d3dx9
version: 3.0
no-autodownload: false

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

org.winepak.Platform.Wine.Compat32:
directory: lib/wine-32bit
version: 3.9-staging
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

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

Copy link
Contributor

@julianrichen julianrichen Jul 14, 2018

Choose a reason for hiding this comment

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

Add:

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

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

- name: hearthstone
only-arches:
- x86_64
buildsystem: simple
build-commands:
- install -d /app/bin
- install hearthstone-installer /app/bin
- install hearthstone /app/bin
- install -Dm644 com.blizzard.Hearthstone.appdata.xml /app/share/appdata/com.blizzard.Hearthstone.appdata.xml
Copy link
Contributor

Choose a reason for hiding this comment

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

Will need to install desktop and svg file:

- install -Dm644 com.blizzard.Hearthstone.desktop /app/share/applications/com.blizzard.Hearthstone.desktop
- install -Dm664 com.blizzard.Hearthstone.svg /app/share/icons/hicolor/scalable/apps/com.blizzard.Hearthstone.svg

- install -Dm644 com.blizzard.Hearthstone.svg /app/share/icons/hicolor/scalable/apps/com.blizzard.Hearthstone.svg
- install -Dm644 com.blizzard.Hearthstone.desktop /app/share/applications/com.blizzard.Hearthstone.desktop

sources:
- type: script
dest-filename: hearthstone-installer
commands:
- if [ -z "$WINEPREFIX" ]; then
- ' echo "No wine prefix set or is empty, abort."'
- ' exit 1'
- fi
-
- source /app/bin/battlenet-installer "battlenet://WTCG"
-
- if [[ $? != 0 ]] ; then
- ' echo "Battle.net installer failed, abort."'
- ' exit 1'
- fi
-
- if [ -e "${WINEPREFIX}/dosdevices/c:/Program Files (x86)/Hearthstone" ] ; then
- ' echo "This prefix already has an exisiting ''Hearthstone'' install at ${WINEPREFIX}"'
- ' echo "In order to install ''Hearthstone'' you must move or delete the current prefix."'
- ' exit 1'
- fi
Copy link
Contributor

@julianrichen julianrichen Jul 14, 2018

Choose a reason for hiding this comment

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

Add:

-
- echo "Installing Extension(s)..."
- source /app/lib/extension/d3dx9/bin/d3dx9-install64
- source /app/lib/extension/d3dx9/bin/d3dx9-install64-wow64
- 
- echo "Installer finished"

Copy link
Author

Choose a reason for hiding this comment

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

Hum, it appears that the extension never creates those files. Setting -force-d3d9 still seems to function on my machine with the current configuration - could you confirm?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I wonder if using Wine's native d3d9 libs are enough. Will test when I get a chance.

-
- echo "Installing Extension(s)..."
-
- echo "Installer finished"
-
- echo "Performing tweak(s)..."
- 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 "Set Hearthstone to run with directx9"
# FIXME: This is not very robust. If the batllenet project
# ever decides to set "Games", or do anything other
# than closing the json dict on the final line, this
# will break horribly.
- 'sed -i ''$d'' "${WINEPREFIX}/dosdevices/c:/users/${USER}/Application Data/Battle.net/Battle.net.config"'
- 'echo '',"Games": { "hs_beta": { "AdditionalLaunchArguments": "-force-d3d9" } } }'' >> "${WINEPREFIX}/dosdevices/c:/users/${USER}/Application Data/Battle.net/Battle.net.config"'

- type: script
dest-filename: hearthstone
commands:
- export WINEARCH=win64
-
- if ! [ -e "${WINEPREFIX}/dosdevices/c:/Program Files (x86)/Battle.net" ] ; then
- ' source /app/bin/hearthstone-installer'
- ' if [[ $? != 0 ]] ; then'
- ' echo "Installation failed, abort."'
- ' exit 1'
- ' fi'
- fi
-
- echo "Verify \"Battle.net Helper.exe\" doesn't launch..."
- if [ -f "${WINEPREFIX}/dosdevices/c:/Program Files (x86)/Battle.net/Battle.net*/Battle.net Helper.exe" ] ; then
- ' mv "${WINEPREFIX}/dosdevices/c:/Program Files (x86)/Battle.net/Battle.net*/Battle.net Helper.exe" "${WINEPREFIX}/dosdevices/c:/Program Files (x86)/Battle.net/Battle.net*/Battle.net Helper.exe.bak"'
- fi
-
- wine64 "${WINEPREFIX}/dosdevices/c:/Program Files (x86)/Battle.net/Battle.net Launcher.exe" "battlenet://WTCG"

- type: file
path: com.blizzard.Hearthstone.appdata.xml

- type: file
path: com.blizzard.Hearthstone.svg

- type: file
path: com.blizzard.Hearthstone.desktop