Debian Codegraph @

docs/INSTALL.md

raw symbols SCIP
1 # [fheroes2](README.md) Installation Guide
2
3 ## Requirements
4
5 You will need to have a demo version or the full version of **Heroes of Might and Magic II** game to be able to play. We strongly
6 advise to purchase the original game on [**GOG**](https://www.gog.com) or [**Ubisoft Store**](https://store.ubi.com) platforms.
7
8 Alternatively, you can **download a free demo version of the game (in English only) using the bundled script**. See detailed
9 instructions below.
10
11 ## Installation
12
13 Precompiled binaries of the release version are currently available for the following platforms and operating systems:
14
15 * [**Windows**](#windows)
16 * [**Windows installer**](#windows-installer)
17 * [**Windows ZIP archive**](#windows-zip-archive)
18 * [**macOS**](#macos)
19 * [**Homebrew**](#homebrew-on-macos)
20 * [**MacPorts**](#macports)
21 * [**macOS ZIP archive**](#macos-zip-archive)
22 * [**macOS native app**](#macos-native-app)
23 * [**Linux**](#linux)
24 * [**Flatpak**](#flatpak)
25 * [**Gentoo**](#gentoo-package)
26 * [**Homebrew**](#homebrew-on-linux)
27 * [**AUR package**](#aur-package)
28 * [**Debian and Ubuntu**](#debian-and-ubuntu)
29 * [**Linux ZIP archive**](#linux-zip-archive)
30 * [**Android**](#android)
31 * [**PlayStation Vita**](#playstation-vita)
32 * [**Nintendo Switch**](#nintendo-switch)
33
34 Alternatively, you can [**download the precompiled binaries of the latest commit (snapshot)**](#snapshots-latest-builds).
35
36 ## Windows
37
38 ### Windows Installer
39
40 * Download one of the following Windows installer packages:
41 * [**Windows x64 (64-bit)**](https://github.com/ihhub/fheroes2/releases/latest/download/fheroes2_windows_x64_SDL2_installer.exe)
42 * [**Windows x86 (32-bit)**](https://github.com/ihhub/fheroes2/releases/latest/download/fheroes2_windows_x86_SDL2_installer.exe)
43 * After downloading the installer, launch it and follow the instructions.
44 * During the installation process, you will be prompted to extract game resources from the original game (select this option if you
45 already have a legally purchased copy of the original game installed), or download the demo version of the original game and extract
46 game resources from it (you can also do this later by clicking the appropriate shortcut in the program's group in the Windows Start
47 menu).
48 * If you purchased a copy of the original game only after installing fheroes2, you can run the `Extract game resources from the original
49 distribution of HoMM2` shortcut in the program's group in the Windows Start menu. This script will try to perform an automatic search
50 for an existing installation of the original game and extract all the necessary resource files. If it can't find an existing installation,
51 you will be prompted to enter the location of the original game manually.
52 * As an alternative to the previous step, you can manually copy the subdirectories `ANIM`, `DATA`, `MAPS` and `MUSIC` (some of them may
53 be missing depending on the version of the original game) from the original game directory to the fheroes2 installation directory.
54
55 ### Windows ZIP Archive
56
57 * Download one of the following Windows ZIP archives:
58 * [**Windows x64 (64-bit)**](https://github.com/ihhub/fheroes2/releases/latest/download/fheroes2_windows_x64_SDL2.zip)
59 * [**Windows x86 (32-bit)**](https://github.com/ihhub/fheroes2/releases/latest/download/fheroes2_windows_x86_SDL2.zip)
60 * After downloading the ZIP archive, extract it to a suitable directory of your choice.
61 * If you have a legally purchased copy of the original game, run the `extract_homm2_resources.bat` script supplied in the ZIP archive.
62 This script will try to perform an automatic search for an existing installation of the original game and extract all the necessary
63 resource files. If it can't find an existing installation, you will be prompted to enter the location of the original game manually.
64 * As an alternative to the previous step, you can manually copy the subdirectories `ANIM`, `DATA`, `MAPS` and `MUSIC` (some of them may
65 be missing depending on the version of the original game) from the original game directory to the fheroes2 installation directory.
66 * If you don't have a legally purchased copy of the original game, you can download and install the demo version of the original game
67 by running the `download_demo_version.bat` script supplied in the ZIP archive.
68
69 #### Troubleshooting Missing Microsoft Visual C++ DLLs
70
71 If you see complaints about missing DLLs when running fheroes2, then you may need to install the Microsoft Visual C++ redistributable package.
72
73 You can download it using the following URLs:
74
75 | Windows Version | C++ Package |
76 | --- | --- |
77 | For 64-bit x64 fheroes2 builds | [**https://aka.ms/vs/17/release/vc_redist.x64.exe**](https://aka.ms/vs/17/release/vc_redist.x64.exe) |
78 | For 32-bit x86 fheroes2 builds | [**https://aka.ms/vs/17/release/vc_redist.x86.exe**](https://aka.ms/vs/17/release/vc_redist.x86.exe) |
79
80 ## macOS
81
82 ### Homebrew on macOS
83
84 If you are using [**Homebrew**](https://brew.sh/), you can install the game by running the following command:
85
86 ```sh
87 brew install fheroes2
88 ```
89
90 Follow the [**instructions below**](#gathering-game-resources) to gather resources necessary for fheroes2 to function as expected.
91
92 ### MacPorts
93
94 If you are using [**MacPorts**](https://www.macports.org/), you can install the game by running the following command:
95
96 ```sh
97 port install fheroes2
98 ```
99
100 Then follow the instructions on the screen.
101
102 Follow the [**instructions below**](#gathering-game-resources) to gather resources necessary for fheroes2 to function as expected.
103
104 ### macOS ZIP Archive
105
106 * Download the [**macOS ZIP archive**](https://github.com/ihhub/fheroes2/releases/latest/download/fheroes2_macos_x86-64_SDL2.zip).
107 Currently only x86-64 binaries are provided. If you use a machine with an Apple Silicon chip, you should choose another installation
108 method (using [**MacPorts**](#macports) or [**Homebrew**](#homebrew-on-macos)), or
109 [**build the project from source**](DEVELOPMENT.md#macos-and-linux).
110 * After downloading the ZIP archive, extract it to a suitable directory of your choice and then run `brew bundle` from
111 the `script/macos` subdirectory. This will install the SDL libraries required to run the game.
112
113 Follow the [**instructions below**](#gathering-game-resources) to gather resources necessary for fheroes2 to function as expected.
114
115 ### macOS Native App
116
117 * Install the required dependencies using the provided Brewfile:
118
119 ```sh
120 brew bundle --file script/macos/Brewfile.app_bundle
121 ```
122
123 * Download the source and compile with the `-DMACOS_APP_BUNDLE=ON` option (if using CMake) or using the following command (with make):
124
125 ```sh
126 make FHEROES2_MACOS_APP_BUNDLE=ON
127 ```
128
129 Follow the [**instructions below**](#gathering-game-resources) to gather resources necessary for fheroes2 to function as expected.
130
131 ### Gathering Game Resources
132
133 Once you obtain the fheroes2 executable using any of the options above, you should follow these steps to load in the correct resources:
134
135 * If you have a legally purchased copy of the original game in a self-extracting Windows executable (such as from GOG), you can utilize
136 [`innoextract`](https://constexpr.org/innoextract/#use) to extract files out of the exe without having to use Wine/Windows emulation
137 software on your *UNIX-based machine.
138 * If you have a legally purchased copy of the original game, run the extract resources script which will prompt you to enter
139 the location of the original game, and will extract all the necessary resource files. The script can be run from the following paths depending on
140 how you installed fheroes2:
141
142 | Installation Method | Script |
143 | --- | --- |
144 | If you used a package manager (MacPorts or Homebrew) | `fheroes2-extract-resources` |
145 | If you built from source using the [**macOS native app**](#macos-native-app) method | `script/homm2/extract_homm2_resources_for_app_bundle.sh` |
146 | All other cases | `script/homm2/extract_homm2_resources.sh` |
147
148 Alternatively, you may manually copy the subdirectories `ANIM`, `DATA`, `MAPS` and `MUSIC` (some of them may be missing depending on the version of the original game)
149
150 | Installation Method | Destination |
151 | --- | --- |
152 | Built from source using the [**macOS native app**](#macos-native-app) | `~/Library/Application Support/fheroes2` |
153 | All other cases | `~/.fheroes2` |
154
155 * If you don't have a legally purchased copy of the original game, you can download and install the demo version of the original game
156 by running the download demo script. The script can be run from the following paths depending on how you installed fheroes2:
157
158 | Installation Method | Script |
159 | --- | --- |
160 | If you used a package manager (MacPorts or Homebrew) | `fheroes2-install-demo` |
161 | If you built from source using the [**macOS native app**](#macos-native-app) method | `script/demo/download_demo_version_for_app_bundle.sh` |
162 | All other cases | `script/demo/download_demo_version.sh` |
163
164 ## Linux
165
166 ### Flatpak
167
168 If you are using [**Flatpak**](https://flatpak.org) and [**Flathub**](https://flathub.org), you can install the game by running the
169 following command:
170
171 ```sh
172 flatpak install flathub io.github.ihhub.Fheroes2
173 ```
174
175 And launch from the start menu or the console:
176
177 ```sh
178 flatpak run io.github.ihhub.Fheroes2
179 ```
180
181 Alternatively, you can use an application manager like Discover, which is also available on Steam Deck.
182
183 After the first start you will be asked for the original files. There are three possibilities:
184
185 1. Install GOG version (recommended)
186 2. Manual install
187 3. Install demo
188
189 The recommended option requires the Heroes of Might and Magic II installer file (*.exe) from GOG. This will extract the appropriate resources by itself.
190
191 For the manual installation you have to copy the subdirectories `ANIM`, `DATA`, `MAPS` and `MUSIC` from the original game or demo directory to the
192 `~/.var/app/io.github.ihhub.Fheroes2/data/fheroes2` directory. The destination folder will be opened when this option is selected.
193
194 ### Gentoo Package
195
196 If you are using [**Gentoo**](https://gentoo.org), you can install the game using package manager. There are several options:
197
198 #### GOG Version
199
200 If you purchased the game from GOG, add `games-strategy/homm2-gold-gog GOG-EULA` line to your `/etc/portage/package.license`, then use the following command:
201
202 ```sh
203 sudo emerge -av games-strategy/homm2-gold-gog
204 ```
205
206 It will ask you to put the .exe installer of the game and optionally the zip file with FLAC music to your distfiles directory,
207 and if it's there, it will unpack everything to the correct places and pull `games-engines/fheroes2` as a dependency.
208
209 USE-flag `flac` determines whether the game will use FLAC music or OGG music.
210
211 #### Demo Version
212
213 You can install the demo version for free by adding `games-strategy/homm2-demo HoMM2-Demo` line to your `/etc/portage/package.license`, then using the following command:
214
215 ```sh
216 sudo emerge -av games-strategy/homm2-demo
217 ```
218
219 #### Another Legal Installation
220
221 If you installed the game from original CD, use the following commands:
222
223 ```sh
224 sudo emerge -av games-engines/fheroes2
225 /usr/share/fheroes2/extract_homm2_resources.sh
226 ```
227
228 The second command (Note: run it without root) will ask you where your data files are.
229
230 ### Homebrew on Linux
231
232 If you are using [**Homebrew**](https://brew.sh/), you can install the game by running the following command:
233
234 ```sh
235 brew install fheroes2
236 ```
237
238 If you have a legally purchased copy of the original game, copy the subdirectories `ANIM`, `DATA`, `MAPS` and `MUSIC` (some of them may
239 be missing depending on the version of the original game) from the original game directory to the `$XDG_DATA_HOME/fheroes2` (usually
240 `~/.local/share/fheroes2`) directory. Otherwise, you can download and install the demo version of the original game by running the
241 `/usr/share/fheroes2/download_demo_version.sh` script.
242
243 ### AUR Package
244
245 If you are using Arch Linux or compatible distribution, you can install [**fheroes2 package**](https://aur.archlinux.org/packages/fheroes2)
246 from AUR (Arch User Repository).
247
248 #### Install Using AUR Helper
249
250 If you use one of AUR helpers, e.g. `yay`, you can install the game by running the following command:
251
252 ```sh
253 yay -S aur/fheroes2
254 ```
255
256 #### Install Using the Official Guide
257
258 Follow the [**official guide**](https://wiki.archlinux.org/title/Arch_User_Repository#Installing_and_upgrading_packages).
259 One of possible command sets:
260
261 ```sh
262 git clone https://aur.archlinux.org/fheroes2.git
263 cd fheroes2
264 makepkg -si
265 ```
266
267 ### Debian and Ubuntu
268
269 fheroes2 is available from `contrib` repositories for Debian (since 13) and Ubuntu (since 24.04). You can install it by running:
270
271 ```sh
272 apt install fheroes2
273 ```
274
275 These distributions may not provide the latest version of the game due to their release cycle.
276
277 #### Game Resources
278
279 To play the game you need the original game resources. You can install them to per-user paths (`man fheroes2` for more info, or you
280 can install them to the system-wide path (`/usr/share/games/fheroes2`) with `game-data-packager` program (since v70).
281 To make the resource package:
282
283 ```sh
284 game-data-packager heroes2 <path_to_installed_original_game>
285 apt install ./homm2-data_<version>_all.deb
286 ```
287
288 You can get more info about resource packaging by running `game-data-packager heroes2 --help`
289
290 ### Linux ZIP Archive
291
292 * Download one of the following Linux ZIP archives:
293 * [**Linux x86-64**](https://github.com/ihhub/fheroes2/releases/latest/download/fheroes2_ubuntu_x86-64_SDL2.zip)
294 * [**Linux ARM64**](https://github.com/ihhub/fheroes2/releases/latest/download/fheroes2_ubuntu_arm64_SDL2.zip)
295 * After downloading the ZIP archive, extract it to a suitable directory of your choice. Then you will need to install the SDL libraries
296 required to run the game. The installation procedure depends on the Linux distribution you are using:
297 * **Debian-based**: run the script `install_sdl2.sh` from the `script/linux` subdirectory.
298 * **Pacman-based (e.g. Arch Linux)**: run the following command: `sudo pacman -S sdl2 sdl2_mixer`.
299 * **RedHat-based**: for RPM-based distributions (such as Fedora or RedHat) use the commands `sudo yum install SDL*` or `sudo dnf install SDL*`.
300 * **openSUSE**: openSUSE supports the One-Click-Install using the `SDL_mixer.ymp` file from the `script/linux` subdirectory.
301 * **Gentoo**: run the following command: `emerge --ask media-libs/sdl2-mixer`.
302 * After all dependencies are installed, run the `extract_homm2_resources.sh` script supplied in the ZIP archive if you have a legally purchased
303 copy of the original game. You will be prompted to enter the location of the original game, and the script will extract all the necessary
304 resource files.
305 * As an alternative to the previous step, you can manually copy the subdirectories `ANIM`, `DATA`, `MAPS` and `MUSIC` (some of them may
306 be missing depending on the version of the original game) from the original game directory to the fheroes2 installation directory.
307 * If you don't have a legally purchased copy of the original game, you can download and install the demo version of the original game
308 by running the `download_demo_version.sh` script supplied in the ZIP archive.
309
310 ## Android
311
312 * Install the fheroes2 app from [**Google Play**](https://play.google.com/store/apps/details?id=org.fheroes2) or download the
313 [**Android ZIP archive**](https://github.com/ihhub/fheroes2/releases/latest/download/fheroes2_android.zip).
314 * Follow the [**instructions**](README_android.md).
315
316 ## PlayStation Vita
317
318 **Please note**: you need to be running custom firmware for it to work.
319
320 * Download the [**PlayStation Vita ZIP archive**](https://github.com/ihhub/fheroes2/releases/latest/download/fheroes2_psv.zip).
321 * Follow the [**instructions**](README_PSV.md).
322
323 ## Nintendo Switch
324
325 **Please note**: you need to be running custom firmware for it to work.
326
327 * Download the [**Nintendo Switch ZIP archive**](https://github.com/ihhub/fheroes2/releases/latest/download/fheroes2_switch.zip).
328 * Follow the [**instructions**](README_switch.md).
329
330 ## Snapshots (Latest Builds)
331
332 You can download the precompiled binaries of the latest commit (snapshot)
333
334 | Platform Version | Release |
335 |------------------|-----------------------------------------------------------------------------------------------------------|
336 | Windows x64 | [fheroes2-windows-x64-SDL2](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-windows-x64-SDL2) |
337 | Windows x86 | [fheroes2-windows-x86-SDL2](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-windows-x86-SDL2) |
338 | macOS x86-64 | [fheroes2-osx-sdl2_dev](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-osx-sdl2_dev) |
339 | Ubuntu x86-64 | [fheroes2-linux-sdl2_dev](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-linux-sdl2_dev) |
340 | Ubuntu ARM | [fheroes2-linux-arm-sdl2_dev](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-linux-arm-sdl2_dev) |
341 | Android | [fheroes2-android](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-android) |
342 | PlayStation Vita | [fheroes2-psv-sdl2_dev](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-psv-sdl2_dev) |
343 | Nintendo Switch | [fheroes2-switch-sdl2_dev](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-switch-sdl2_dev) |
344
345 **These binaries incorporate all the latest changes, but also all the latest bugs, and are mainly intended for developers.**
346
347 **DON'T EXPECT THEM TO WORK PROPERLY.**