Update to 1.11.0-beta1
@@ -1,25 +0,0 @@
|
||||
openttd (1.0.0~rc3-2) unstable; urgency=low
|
||||
|
||||
The openttd package has been moved from contrib into main. Since the
|
||||
OpenGFX free graphics set has been packaged for Debian, one can now run
|
||||
OpenTTD without needing any of the resources from the original game
|
||||
(though the original resources are still supported).
|
||||
|
||||
-- Matthijs Kooijman <matthijs@stdin.nl> Thu, 18 Mar 2010 13:09:35 +0100
|
||||
|
||||
openttd (0.7.0-1) unstable; urgency=low
|
||||
|
||||
Handling of AI players has changed in 0.7.0. This package no longer
|
||||
contains any AI players, so playing against the computer is not possible
|
||||
out of the box any longer. However, you can easily download AI players
|
||||
through the new "Content Downloading Service", after which playing with
|
||||
computer players is possible.
|
||||
|
||||
Loading old savegames with computer players is supported (AI players will
|
||||
be converted according to the current AI settings), but at this moment
|
||||
there are no AIs that completely handle any existing infrastructure built
|
||||
by the old AI, so starting a new game might be more fun (especially since
|
||||
most of the new AIs are a lot less erratic).
|
||||
|
||||
-- Matthijs Kooijman <matthijs@stdin.nl> Mon, 13 Apr 2009 15:11:20 +0200
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
OpenTTD for Debian
|
||||
------------------
|
||||
|
||||
To properly play this game, you need a base graphics and sound set.
|
||||
Currently, the graphics, sound and music files from the original
|
||||
Transport Tycoon Deluxe game (Windows and DOS versions) are supported,
|
||||
as well as the free graphics replacement set "OpenGFX", sound
|
||||
replacement set "OpenSFX" (which is in non-free due to a restrictive
|
||||
license) and the free music replacement set "OpenMSX".
|
||||
|
||||
Normally, installing the openttd package should automatically install
|
||||
openttd-opengfx as well, allowing OpenTTD to run out of the box. If you
|
||||
want sound, you'll have to enable non-free sources and install the
|
||||
openttd-opensfx package manually (or install the original Transport
|
||||
Tyccon Deluxe sound files).
|
||||
|
||||
The easiest way to install the OpenMSX music files is to use the in-game
|
||||
content download system, which should offer the latest version of the
|
||||
music files.
|
||||
|
||||
To find out how to install the original Transport Tycoon Deluxe graphics
|
||||
sound files and music files, see readme.txt, section 4.1.
|
||||
|
||||
-Playing Music
|
||||
In addition to installing a music set (see above), you'll also need
|
||||
to install the timidity midi player, available in the timidity
|
||||
package.
|
||||
|
||||
Remember that not all audio devices support multiple audiostreams
|
||||
(music and sound), so you might have to use alsa software mixing or
|
||||
pulseaudio.
|
||||
|
||||
-Scenarios
|
||||
There are no scenarios included in this release. Scenarios can be
|
||||
downloaded using OpenTTD's content service, which is available from
|
||||
OpenTTD's main menu. If you have obtained a scenario through other
|
||||
means, you can place it either in your ~/.openttd/scenario directory
|
||||
or in the system-wide /usr/share/games/openttd/scenario directory.
|
||||
|
||||
-- Matthijs Kooijman <matthijs@stdin.nl> Mon, 01 Feb 2010 10:42:11 +0100
|
||||
|
||||
1117
os/debian/changelog
@@ -1 +0,0 @@
|
||||
7
|
||||
@@ -1,36 +0,0 @@
|
||||
Source: openttd
|
||||
Section: games
|
||||
Priority: optional
|
||||
Maintainer: Matthijs Kooijman <matthijs@stdin.nl>
|
||||
Uploaders: Jordi Mallach <jordi@debian.org>
|
||||
Build-Depends: debhelper (>= 7.0.50), libsdl2-dev, zlib1g-dev, libpng-dev, libfreetype6-dev, libfontconfig-dev, libicu-dev, liblzma-dev, liblzo2-dev
|
||||
Standards-Version: 3.8.4
|
||||
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/openttd.git
|
||||
Vcs-Git: git://anonscm.debian.org/collab-maint/openttd.git
|
||||
Homepage: http://www.openttd.org/
|
||||
|
||||
Package: openttd
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Recommends: openttd-opengfx, x11-utils
|
||||
Replaces: openttd-data
|
||||
Conflicts: openttd-data
|
||||
Suggests: openttd-opensfx, timidity, freepats
|
||||
Description: reimplementation of Transport Tycoon Deluxe with enhancements
|
||||
OpenTTD is a reimplementation of the Microprose game "Transport
|
||||
Tycoon Deluxe" with lots of new features and enhancements.
|
||||
.
|
||||
OpenTTD is playable with the free graphics files from the openttd-opengfx
|
||||
package and optional sound files from the openttd-opensfx package (which is in
|
||||
non-free). Alternatively, OpenTTD can use the graphics files from the original
|
||||
Transport Tycoon Deluxe game (See README.Debian on how to set this up).
|
||||
|
||||
Package: openttd-dbg
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: openttd (= ${binary:Version}), ${misc:Depends}
|
||||
Description: debugging symbols for openttd
|
||||
This package contains the debugging symbols for OpenTTD, the reimplementation
|
||||
of the Micropose game "Transport Tycoon Deluxe" with lots of new features and
|
||||
enhancements.
|
||||
@@ -1,106 +0,0 @@
|
||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: OpenTTD
|
||||
Upstream-Contact: info@openttd.org, #openttd on irc.oftc.net
|
||||
Source: http://www.openttd.org
|
||||
|
||||
|
||||
Files: *
|
||||
Copyright: © 2004-2019 Ludvig Strigeous and others.
|
||||
License: GPL-2.0
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2.0 as
|
||||
published by the Free Software Foundation;
|
||||
.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this package; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General Public License
|
||||
version 2 can be found in `/usr/share/common-licenses/GPL-2'.
|
||||
|
||||
Files: src/3rdparty/squirrel/*
|
||||
Copyright: © 2003-2009 Alberto Demichelis
|
||||
License: Zlib
|
||||
|
||||
Files: src/3rdparty/md5/*
|
||||
Copyright: © 1999, 2000, 2002 Aladdin Enterprises. All rights reserved.
|
||||
License: Zlib
|
||||
|
||||
|
||||
License: Zlib
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
.
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
.
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software in
|
||||
a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
.
|
||||
2. Altered source versions must be plainly marked as such, and must not
|
||||
be misrepresented as being the original software.
|
||||
.
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
Files: os/dos/exe2coff/*
|
||||
Copyright: © 1998 DJ Delorie
|
||||
License: GPL-2.0 with additional restrictions
|
||||
This document is Copyright (C) DJ Delorie and may be distributed
|
||||
verbatim, but changing it is not allowed.
|
||||
.
|
||||
Source code copyright DJ Delorie is distributed under the terms of the
|
||||
GNU General Public Licence, with the following exceptions:
|
||||
.
|
||||
* Sources used to build crt0.o, gcrt0.o, libc.a, libdbg.a, and
|
||||
libemu.a are distributed under the terms of the GNU Library General
|
||||
Public License, rather than the GNU GPL.
|
||||
.
|
||||
* Any existing copyright or authorship information in any given source
|
||||
file must remain intact. If you modify a source file, a notice to that
|
||||
effect must be added to the authorship information in the source file.
|
||||
.
|
||||
* Runtime binaries, as provided by DJ in DJGPP, may be distributed
|
||||
without sources ONLY if the recipient is given sufficient information
|
||||
to obtain a copy of djgpp themselves. This primarily applies to
|
||||
go32-v2.exe, emu387.dxe, and stubedit.exe.
|
||||
.
|
||||
* Runtime objects and libraries, as provided by DJ in DJGPP, when
|
||||
linked into an application, may be distributed without sources ONLY
|
||||
if the recipient is given sufficient information to obtain a copy of
|
||||
djgpp themselves. This primarily applies to crt0.o and libc.a.
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General Public License
|
||||
version 2 can be found in `/usr/share/common-licenses/GPL-2'.
|
||||
Comment:
|
||||
Given only the exe2coff.c file is distributed in the source distribution (and
|
||||
nothing in Debian binary distribution), it seems only the 2nd condition
|
||||
applies.
|
||||
|
||||
Files: os/dos/cwsdpmi/*
|
||||
Source: http://homer.rice.edu/~sandmann/cwsdpmi/index.html
|
||||
Copyright: © 1995-2000 Charles W Sandmann (sandmann@clio.rice.edu)
|
||||
License: Custom binary-only license
|
||||
This is release 5. The files in this binary distribution may be redistributed
|
||||
under the GPL (with source) or without the source code provided:
|
||||
.
|
||||
* CWSDPMI.EXE or CWSDPR0.EXE are not modified in any way except via CWSPARAM.
|
||||
.
|
||||
* CWSDSTUB.EXE internal contents are not modified in any way except via
|
||||
CWSPARAM or STUBEDIT. It may have a COFF image plus data appended to it.
|
||||
.
|
||||
* Notice to users that they have the right to receive the source code and/or
|
||||
binary updates for CWSDPMI. Distributors should indicate a site for the
|
||||
source in their documentation.
|
||||
Comment:
|
||||
Files are distributed as binary only, so the second option in the license
|
||||
("without source code provided: ...") is applicable.
|
||||
@@ -1,13 +0,0 @@
|
||||
[DEFAULT]
|
||||
# Use pristine-tar
|
||||
pristine-tar = True
|
||||
|
||||
[git-dch]
|
||||
# We use metaheaders in commit messages.
|
||||
meta = True
|
||||
# Put git commit ids in the debian changelog.
|
||||
id-length = 7
|
||||
|
||||
[git-import-orig]
|
||||
# Use a custom commit message for upstream imports.
|
||||
import-msg = New upstream release %(version)s.
|
||||
@@ -1,2 +0,0 @@
|
||||
?package(openttd):needs="X11" section="Games/Simulation" title="OpenTTD"\
|
||||
command="/usr/games/openttd" icon="/usr/share/pixmaps/openttd.32.xpm"
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/sh
|
||||
# This is a wrapper script that checks openttd's exit status and
|
||||
# displays its stderr output
|
||||
|
||||
# Get a file to capture stderr to. Use the deprecated -t option, so this
|
||||
# works on the old mktemp from the mktemp package (which has been
|
||||
# replaced by the version from the coreutils package).
|
||||
TMPFILE=`mktemp -t openttd.errout.XXXXXXXXX`
|
||||
|
||||
if [ ! -w "$TMPFILE" ]; then
|
||||
xmessage "Could not create temporary file for error messages. Not starting OpenTTD."
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
# Capture stderr
|
||||
openttd "$@" 2> "$TMPFILE"
|
||||
ERRCODE=$?
|
||||
if [ "$ERRCODE" -ne 0 ]; then
|
||||
CODEMSG="OpenTTD returned with error code $ERRCODE."
|
||||
if [ -s "$TMPFILE" ]; then
|
||||
MESSAGE="$CODEMSG The following error messages were produced:\n\n"
|
||||
printf "$MESSAGE" | cat - "$TMPFILE" | fold -s | xmessage -file -
|
||||
else
|
||||
xmessage "$CODEMSG No error messages were produced."
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -f "$TMPFILE"
|
||||
@@ -1,20 +0,0 @@
|
||||
From: Matthijs Kooijman <matthijs@stdin.nl>
|
||||
Subject: Use a wrapper script for running openttd
|
||||
|
||||
The wrapper script captures stderr from openttd and displays this in
|
||||
case of an error. This patch makes the the .desktop file call the
|
||||
wrapper instead of the openttd binary directly.
|
||||
|
||||
Index: media/openttd.desktop.in
|
||||
===================================================================
|
||||
--- a/media/openttd.desktop.in (revision 20124)
|
||||
+++ b/media/openttd.desktop.in (working copy)
|
||||
@@ -5,7 +5,7 @@
|
||||
Version=1.1
|
||||
Name=!!MENU_NAME!!
|
||||
Icon=openttd
|
||||
-Exec=!!TTD!!
|
||||
+Exec=/usr/share/games/openttd/openttd-wrapper
|
||||
Terminal=false
|
||||
Categories=!!MENU_GROUP!!
|
||||
Comment=A clone of Transport Tycoon Deluxe
|
||||
@@ -1 +0,0 @@
|
||||
run-openttd-wrapper.patch
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
# Makefile to build the openttd debian package.
|
||||
|
||||
# Use debhelper default for all targets (but some are overridden below).
|
||||
%:
|
||||
dh --parallel $@
|
||||
|
||||
DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
||||
DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
||||
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
|
||||
CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
|
||||
endif
|
||||
|
||||
# This prevents linking uselessly to libicudata and silences a warning
|
||||
# in the build process.
|
||||
DEB_LDFLAGS_MAINT_APPEND="-Wl,-as-needed"
|
||||
|
||||
# Enable all hardening options (since openttd offers a network-listening
|
||||
# service that handles untrusted data).
|
||||
DEB_BUILD_MAINT_OPTIONS=hardening=+all
|
||||
|
||||
# Load buildflags (this uses dpkg-buildflags). Note that we don't export
|
||||
# them, but instead pass them to ./configure explicitly.
|
||||
include /usr/share/dpkg/buildflags.mk
|
||||
|
||||
# Pass custom options to configure. Since it's not autoconf but a custom
|
||||
# script, some of the option names are slightly different. We also need
|
||||
# to be explicit about the dependencies, in case we're not running in a
|
||||
# clean build root.
|
||||
override_dh_auto_configure:
|
||||
./configure $(CROSS) --prefix-dir=/usr --install-dir=debian/openttd --without-allegro --with-zlib --with-sdl --with-png --with-freetype --with-fontconfig --with-icu-sort --with-liblzo2 --with-lzma --without-xdg-basedir --without-iconv --disable-strip CFLAGS="$(CFLAGS) $(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" CFLAGS_BUILD="$(CFLAGS) $(CPPFLAGS)" CXXFLAGS_BUILD="$(CXXFLAGS) $(CPPFLAGS)" LDFLAGS_BUILD="$(LDFLAGS)"
|
||||
|
||||
# Do some extra installation
|
||||
override_dh_auto_install:
|
||||
$(MAKE) install DO_NOT_INSTALL_CHANGELOG=1 DO_NOT_INSTALL_LICENSE=1
|
||||
|
||||
# Don't do testing. Because the OpenTTD Makefile always does dependency
|
||||
# generation (even on invalid targets), dh_auto_test thinks there is a
|
||||
# "test" target, while there isn't.
|
||||
override_dh_auto_test:
|
||||
|
||||
# Call mrproper. Again, dh_auto_clean thinks there is a distclean
|
||||
# target, while there isn't.
|
||||
override_dh_auto_clean:
|
||||
[ ! -f Makefile ] || $(MAKE) mrproper
|
||||
|
||||
# We want to strip the debug informatiton into the -dbg package.
|
||||
override_dh_strip:
|
||||
dh_strip --dbg-package=openttd-dbg
|
||||
@@ -1 +0,0 @@
|
||||
3.0 (quilt)
|
||||
@@ -1,5 +0,0 @@
|
||||
version=3
|
||||
|
||||
options=downloadurlmangle=s/(.*)\/index.html$/\1\/openttd-\1-source.tar.gz/ \
|
||||
http://master.binaries.openttd.org/releases/ \
|
||||
(\d+(?:\.\d+)*)/index.html
|
||||
4
os/emscripten/Dockerfile
Normal file
@@ -0,0 +1,4 @@
|
||||
FROM emscripten/emsdk
|
||||
|
||||
COPY emsdk-liblzma.patch /
|
||||
RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-liblzma.patch
|
||||
40
os/emscripten/README.md
Normal file
@@ -0,0 +1,40 @@
|
||||
## How to build with Emscripten
|
||||
|
||||
Building with Emscripten works with emsdk 2.0.10 and above.
|
||||
|
||||
Currently there is no LibLZMA support upstream; for this we suggest to apply
|
||||
the provided patch in this folder to your emsdk installation.
|
||||
|
||||
For convenience, a Dockerfile is supplied that does this patches for you
|
||||
against upstream emsdk docker. Best way to use it:
|
||||
|
||||
Build the docker image:
|
||||
```
|
||||
docker build -t emsdk-lzma .
|
||||
```
|
||||
|
||||
Build the host tools first:
|
||||
```
|
||||
mkdir build-host
|
||||
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build-host emsdk-lzma cmake .. -DOPTION_TOOLS_ONLY=ON
|
||||
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build-host emsdk-lzma make -j5 tools
|
||||
```
|
||||
|
||||
Next, build the game with emscripten:
|
||||
|
||||
```
|
||||
mkdir build
|
||||
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emcmake cmake .. -DHOST_BINARY_DIR=$(pwd)/build-host -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPTION_USE_ASSERTS=OFF
|
||||
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emmake make -j5
|
||||
```
|
||||
|
||||
And now you have in your build folder files like "openttd.html".
|
||||
|
||||
To run it locally, you would have to start a local webserver, like:
|
||||
|
||||
```
|
||||
cd build
|
||||
python3 -m http.server
|
||||
````
|
||||
|
||||
Now you can play the game via http://127.0.0.1:8000/openttd.html .
|
||||
20
os/emscripten/cmake/FindLibLZMA.cmake
Normal file
@@ -0,0 +1,20 @@
|
||||
# LibLZMA is a recent addition to the emscripten SDK, so it is possible
|
||||
# someone hasn't updated his SDK yet. Test out if the SDK supports LibLZMA.
|
||||
include(CheckCXXSourceCompiles)
|
||||
set(CMAKE_REQUIRED_FLAGS "-sUSE_LIBLZMA=1")
|
||||
|
||||
check_cxx_source_compiles("
|
||||
#include <lzma.h>
|
||||
int main() { return 0; }"
|
||||
LIBLZMA_FOUND
|
||||
)
|
||||
|
||||
if (LIBLZMA_FOUND)
|
||||
add_library(LibLZMA::LibLZMA INTERFACE IMPORTED)
|
||||
set_target_properties(LibLZMA::LibLZMA PROPERTIES
|
||||
INTERFACE_COMPILE_OPTIONS "-sUSE_LIBLZMA=1"
|
||||
INTERFACE_LINK_LIBRARIES "-sUSE_LIBLZMA=1"
|
||||
)
|
||||
else()
|
||||
message(WARNING "You are using an emscripten SDK without LibLZMA support. Many savegames won't be able to load in OpenTTD. Please apply 'emsdk-liblzma.patch' to your local emsdk installation.")
|
||||
endif()
|
||||
7
os/emscripten/cmake/FindPNG.cmake
Normal file
@@ -0,0 +1,7 @@
|
||||
add_library(PNG::PNG INTERFACE IMPORTED)
|
||||
set_target_properties(PNG::PNG PROPERTIES
|
||||
INTERFACE_COMPILE_OPTIONS "-sUSE_LIBPNG=1"
|
||||
INTERFACE_LINK_LIBRARIES "-sUSE_LIBPNG=1"
|
||||
)
|
||||
|
||||
set(PNG_FOUND on)
|
||||
7
os/emscripten/cmake/FindSDL2.cmake
Normal file
@@ -0,0 +1,7 @@
|
||||
add_library(SDL2::SDL2 INTERFACE IMPORTED)
|
||||
set_target_properties(SDL2::SDL2 PROPERTIES
|
||||
INTERFACE_COMPILE_OPTIONS "-sUSE_SDL=2"
|
||||
INTERFACE_LINK_LIBRARIES "-sUSE_SDL=2"
|
||||
)
|
||||
|
||||
set(SDL2_FOUND on)
|
||||
7
os/emscripten/cmake/FindZLIB.cmake
Normal file
@@ -0,0 +1,7 @@
|
||||
add_library(ZLIB::ZLIB INTERFACE IMPORTED)
|
||||
set_target_properties(ZLIB::ZLIB PROPERTIES
|
||||
INTERFACE_COMPILE_OPTIONS "-sUSE_ZLIB=1"
|
||||
INTERFACE_LINK_LIBRARIES "-sUSE_ZLIB=1"
|
||||
)
|
||||
|
||||
set(ZLIB_FOUND on)
|
||||
213
os/emscripten/emsdk-liblzma.patch
Normal file
@@ -0,0 +1,213 @@
|
||||
From 90dd4d4c6b1cedec338ff5b375fffca93700f7bc Mon Sep 17 00:00:00 2001
|
||||
From: milek7 <me@milek7.pl>
|
||||
Date: Tue, 8 Dec 2020 01:03:31 +0100
|
||||
Subject: [PATCH] Add liblzma port
|
||||
|
||||
---
|
||||
Source: https://github.com/emscripten-core/emscripten/pull/12990
|
||||
|
||||
Modifed by OpenTTD to have the bare minimum needed to work. Otherwise there
|
||||
are constantly conflicts when trying to apply this patch to different versions
|
||||
of emsdk.
|
||||
|
||||
diff --git a/embuilder.py b/embuilder.py
|
||||
index 818262190ed..ab7d5adb7b2 100755
|
||||
--- a/embuilder.py
|
||||
+++ b/embuilder.py
|
||||
@@ -60,6 +60,7 @@
|
||||
'harfbuzz',
|
||||
'icu',
|
||||
'libjpeg',
|
||||
+ 'liblzma',
|
||||
'libpng',
|
||||
'ogg',
|
||||
'regal',
|
||||
@@ -197,6 +198,8 @@ def main():
|
||||
build_port('ogg', libname('libogg'))
|
||||
elif what == 'libjpeg':
|
||||
build_port('libjpeg', libname('libjpeg'))
|
||||
+ elif what == 'liblzma':
|
||||
+ build_port('liblzma', libname('liblzma'))
|
||||
elif what == 'libpng':
|
||||
build_port('libpng', libname('libpng'))
|
||||
elif what == 'sdl2':
|
||||
diff --git a/src/settings.js b/src/settings.js
|
||||
index 61cd98939ba..be6fcb678c6 100644
|
||||
--- a/src/settings.js
|
||||
+++ b/src/settings.js
|
||||
@@ -1197,6 +1197,9 @@ var USE_BZIP2 = 0;
|
||||
// 1 = use libjpeg from emscripten-ports
|
||||
var USE_LIBJPEG = 0;
|
||||
|
||||
+// 1 = use liblzma from emscripten-ports
|
||||
+var USE_LIBLZMA = 0;
|
||||
+
|
||||
// 1 = use libpng from emscripten-ports
|
||||
var USE_LIBPNG = 0;
|
||||
|
||||
diff --git a/tools/ports/liblzma.py b/tools/ports/liblzma.py
|
||||
new file mode 100644
|
||||
index 00000000000..e9567ef36ff
|
||||
--- /dev/null
|
||||
+++ b/tools/ports/liblzma.py
|
||||
@@ -0,0 +1,160 @@
|
||||
+# Copyright 2020 The Emscripten Authors. All rights reserved.
|
||||
+# Emscripten is available under two separate licenses, the MIT license and the
|
||||
+# University of Illinois/NCSA Open Source License. Both these licenses can be
|
||||
+# found in the LICENSE file.
|
||||
+
|
||||
+import os
|
||||
+import shutil
|
||||
+
|
||||
+VERSION = '5.2.5'
|
||||
+HASH = '7443674247deda2935220fbc4dfc7665e5bb5a260be8ad858c8bd7d7b9f0f868f04ea45e62eb17c0a5e6a2de7c7500ad2d201e2d668c48ca29bd9eea5a73a3ce'
|
||||
+
|
||||
+
|
||||
+def needed(settings):
|
||||
+ return settings.USE_LIBLZMA
|
||||
+
|
||||
+
|
||||
+def get(ports, settings, shared):
|
||||
+ libname = ports.get_lib_name('liblzma')
|
||||
+ ports.fetch_project('liblzma', 'https://tukaani.org/xz/xz-' + VERSION + '.tar.gz', 'xz-' + VERSION, sha512hash=HASH)
|
||||
+
|
||||
+ def create():
|
||||
+ ports.clear_project_build('liblzma')
|
||||
+
|
||||
+ source_path = os.path.join(ports.get_dir(), 'liblzma', 'xz-' + VERSION)
|
||||
+ dest_path = os.path.join(ports.get_build_dir(), 'liblzma')
|
||||
+
|
||||
+ shared.try_delete(dest_path)
|
||||
+ os.makedirs(dest_path)
|
||||
+ shutil.rmtree(dest_path, ignore_errors=True)
|
||||
+ shutil.copytree(source_path, dest_path)
|
||||
+
|
||||
+ build_flags = ['-DHAVE_CONFIG_H', '-DTUKLIB_SYMBOL_PREFIX=lzma_', '-fvisibility=hidden']
|
||||
+ exclude_dirs = ['xzdec', 'xz', 'lzmainfo']
|
||||
+ exclude_files = ['crc32_small.c', 'crc64_small.c', 'crc32_tablegen.c', 'crc64_tablegen.c', 'price_tablegen.c', 'fastpos_tablegen.c'
|
||||
+ 'tuklib_exit.c', 'tuklib_mbstr_fw.c', 'tuklib_mbstr_width.c', 'tuklib_open_stdxxx.c', 'tuklib_progname.c']
|
||||
+ include_dirs_rel = ['../common', 'api', 'common', 'check', 'lz', 'rangecoder', 'lzma', 'delta', 'simple']
|
||||
+
|
||||
+ open(os.path.join(dest_path, 'src', 'config.h'), 'w').write(config_h)
|
||||
+
|
||||
+ final = os.path.join(dest_path, libname)
|
||||
+ include_dirs = [os.path.join(dest_path, 'src', 'liblzma', p) for p in include_dirs_rel]
|
||||
+ ports.build_port(os.path.join(dest_path, 'src'), final, flags=build_flags, exclude_dirs=exclude_dirs, exclude_files=exclude_files, includes=include_dirs)
|
||||
+
|
||||
+ ports.install_headers(os.path.join(dest_path, 'src', 'liblzma', 'api'), 'lzma.h')
|
||||
+ ports.install_headers(os.path.join(dest_path, 'src', 'liblzma', 'api', 'lzma'), '*.h', 'lzma')
|
||||
+
|
||||
+ return final
|
||||
+
|
||||
+ return [shared.Cache.get(libname, create, what='port')]
|
||||
+
|
||||
+
|
||||
+def clear(ports, settings, shared):
|
||||
+ shared.Cache.erase_file(ports.get_lib_name('liblzma'))
|
||||
+
|
||||
+
|
||||
+def process_args(ports):
|
||||
+ return []
|
||||
+
|
||||
+
|
||||
+def show():
|
||||
+ return 'liblzma (USE_LIBLZMA=1; public domain)'
|
||||
+
|
||||
+
|
||||
+config_h = r'''
|
||||
+#define ASSUME_RAM 128
|
||||
+#define ENABLE_NLS 1
|
||||
+#define HAVE_CHECK_CRC32 1
|
||||
+#define HAVE_CHECK_CRC64 1
|
||||
+#define HAVE_CHECK_SHA256 1
|
||||
+#define HAVE_CLOCK_GETTIME 1
|
||||
+#define HAVE_DCGETTEXT 1
|
||||
+#define HAVE_DECL_CLOCK_MONOTONIC 1
|
||||
+#define HAVE_DECL_PROGRAM_INVOCATION_NAME 1
|
||||
+#define HAVE_DECODERS 1
|
||||
+#define HAVE_DECODER_ARM 1
|
||||
+#define HAVE_DECODER_ARMTHUMB 1
|
||||
+#define HAVE_DECODER_DELTA 1
|
||||
+#define HAVE_DECODER_IA64 1
|
||||
+#define HAVE_DECODER_LZMA1 1
|
||||
+#define HAVE_DECODER_LZMA2 1
|
||||
+#define HAVE_DECODER_POWERPC 1
|
||||
+#define HAVE_DECODER_SPARC 1
|
||||
+#define HAVE_DECODER_X86 1
|
||||
+#define HAVE_DLFCN_H 1
|
||||
+#define HAVE_ENCODERS 1
|
||||
+#define HAVE_ENCODER_ARM 1
|
||||
+#define HAVE_ENCODER_ARMTHUMB 1
|
||||
+#define HAVE_ENCODER_DELTA 1
|
||||
+#define HAVE_ENCODER_IA64 1
|
||||
+#define HAVE_ENCODER_LZMA1 1
|
||||
+#define HAVE_ENCODER_LZMA2 1
|
||||
+#define HAVE_ENCODER_POWERPC 1
|
||||
+#define HAVE_ENCODER_SPARC 1
|
||||
+#define HAVE_ENCODER_X86 1
|
||||
+#define HAVE_FCNTL_H 1
|
||||
+#define HAVE_FUTIMENS 1
|
||||
+#define HAVE_GETOPT_H 1
|
||||
+#define HAVE_GETOPT_LONG 1
|
||||
+#define HAVE_GETTEXT 1
|
||||
+#define HAVE_IMMINTRIN_H 1
|
||||
+#define HAVE_INTTYPES_H 1
|
||||
+#define HAVE_LIMITS_H 1
|
||||
+#define HAVE_MBRTOWC 1
|
||||
+#define HAVE_MEMORY_H 1
|
||||
+#define HAVE_MF_BT2 1
|
||||
+#define HAVE_MF_BT3 1
|
||||
+#define HAVE_MF_BT4 1
|
||||
+#define HAVE_MF_HC3 1
|
||||
+#define HAVE_MF_HC4 1
|
||||
+#define HAVE_OPTRESET 1
|
||||
+#define HAVE_POSIX_FADVISE 1
|
||||
+#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
|
||||
+#define HAVE_PTHREAD_PRIO_INHERIT 1
|
||||
+#define HAVE_STDBOOL_H 1
|
||||
+#define HAVE_STDINT_H 1
|
||||
+#define HAVE_STDLIB_H 1
|
||||
+#define HAVE_STRINGS_H 1
|
||||
+#define HAVE_STRING_H 1
|
||||
+#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
|
||||
+#define HAVE_SYS_PARAM_H 1
|
||||
+#define HAVE_SYS_STAT_H 1
|
||||
+#define HAVE_SYS_TIME_H 1
|
||||
+#define HAVE_SYS_TYPES_H 1
|
||||
+#define HAVE_UINTPTR_T 1
|
||||
+#define HAVE_UNISTD_H 1
|
||||
+#define HAVE_VISIBILITY 1
|
||||
+#define HAVE_WCWIDTH 1
|
||||
+#define HAVE__BOOL 1
|
||||
+#define HAVE___BUILTIN_ASSUME_ALIGNED 1
|
||||
+#define HAVE___BUILTIN_BSWAPXX 1
|
||||
+#define MYTHREAD_POSIX 1
|
||||
+#define NDEBUG 1
|
||||
+#define PACKAGE "xz"
|
||||
+#define PACKAGE_BUGREPORT "lasse.collin@tukaani.org"
|
||||
+#define PACKAGE_NAME "XZ Utils"
|
||||
+#define PACKAGE_STRING "XZ Utils 5.2.5"
|
||||
+#define PACKAGE_TARNAME "xz"
|
||||
+#define PACKAGE_VERSION "5.2.5"
|
||||
+#define SIZEOF_SIZE_T 4
|
||||
+#define STDC_HEADERS 1
|
||||
+#define TUKLIB_CPUCORES_SYSCONF 1
|
||||
+#define TUKLIB_FAST_UNALIGNED_ACCESS 1
|
||||
+#define TUKLIB_PHYSMEM_SYSCONF 1
|
||||
+#ifndef _ALL_SOURCE
|
||||
+# define _ALL_SOURCE 1
|
||||
+#endif
|
||||
+#ifndef _GNU_SOURCE
|
||||
+# define _GNU_SOURCE 1
|
||||
+#endif
|
||||
+#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
+# define _POSIX_PTHREAD_SEMANTICS 1
|
||||
+#endif
|
||||
+#ifndef _TANDEM_SOURCE
|
||||
+# define _TANDEM_SOURCE 1
|
||||
+#endif
|
||||
+#ifndef __EXTENSIONS__
|
||||
+# define __EXTENSIONS__ 1
|
||||
+#endif
|
||||
+#define VERSION "5.2.5"
|
||||
+'''
|
||||
BIN
os/emscripten/loading.png
Executable file
|
After Width: | Height: | Size: 4.7 KiB |
93
os/emscripten/pre.js
Normal file
@@ -0,0 +1,93 @@
|
||||
Module.arguments.push('-mnull', '-snull', '-vsdl:relative_mode');
|
||||
Module['websocket'] = { url: function(host, port, proto) {
|
||||
/* openttd.org hosts a WebSocket proxy for the content service. */
|
||||
if (host == "content.openttd.org" && port == 3978 && proto == "tcp") {
|
||||
return "wss://content.openttd.org/";
|
||||
}
|
||||
|
||||
/* Everything else just tries to make a default WebSocket connection.
|
||||
* If you run your own server you can setup your own WebSocket proxy in
|
||||
* front of it and let people connect to your server via the proxy. You
|
||||
* are best to add another "if" statement as above for this. */
|
||||
return null;
|
||||
} };
|
||||
|
||||
Module.preRun.push(function() {
|
||||
personal_dir = '/home/web_user/.openttd';
|
||||
content_download_dir = personal_dir + '/content_download'
|
||||
|
||||
/* Because of the "-c" above, all user-data is stored in /user_data. */
|
||||
FS.mkdir(personal_dir);
|
||||
FS.mount(IDBFS, {}, personal_dir);
|
||||
|
||||
Module.addRunDependency('syncfs');
|
||||
FS.syncfs(true, function (err) {
|
||||
/* FS.mkdir() tends to fail if parent folders do not exist. */
|
||||
if (!FS.analyzePath(content_download_dir).exists) {
|
||||
FS.mkdir(content_download_dir);
|
||||
}
|
||||
if (!FS.analyzePath(content_download_dir + '/baseset').exists) {
|
||||
FS.mkdir(content_download_dir + '/baseset');
|
||||
}
|
||||
|
||||
/* Check if the OpenGFX baseset is already downloaded. */
|
||||
if (!FS.analyzePath(content_download_dir + '/baseset/opengfx-0.6.0.tar').exists) {
|
||||
window.openttd_downloaded_opengfx = true;
|
||||
FS.createPreloadedFile(content_download_dir + '/baseset', 'opengfx-0.6.0.tar', 'https://installer.cdn.openttd.org/emscripten/opengfx-0.6.0.tar', true, true);
|
||||
} else {
|
||||
/* Fake dependency increase, so the counter is stable. */
|
||||
Module.addRunDependency('opengfx');
|
||||
Module.removeRunDependency('opengfx');
|
||||
}
|
||||
|
||||
Module.removeRunDependency('syncfs');
|
||||
});
|
||||
|
||||
window.openttd_syncfs_shown_warning = false;
|
||||
window.openttd_syncfs = function() {
|
||||
/* Copy the virtual FS to the persistent storage. */
|
||||
FS.syncfs(false, function (err) { });
|
||||
|
||||
/* On first time, warn the user about the volatile behaviour of
|
||||
* persistent storage. */
|
||||
if (!window.openttd_syncfs_shown_warning) {
|
||||
window.openttd_syncfs_shown_warning = true;
|
||||
Module.onWarningFs();
|
||||
}
|
||||
}
|
||||
|
||||
window.openttd_exit = function() {
|
||||
Module.onExit();
|
||||
}
|
||||
|
||||
window.openttd_abort = function() {
|
||||
Module.onAbort();
|
||||
}
|
||||
|
||||
window.openttd_server_list = function() {
|
||||
add_server = Module.cwrap("em_openttd_add_server", null, ["string", "number"]);
|
||||
|
||||
/* Add servers that support WebSocket here. Example:
|
||||
* add_server("localhost", 3979); */
|
||||
}
|
||||
|
||||
/* https://github.com/emscripten-core/emscripten/pull/12995 implements this
|
||||
* properly. Till that time, we use a polyfill. */
|
||||
SOCKFS.websocket_sock_ops.createPeer_ = SOCKFS.websocket_sock_ops.createPeer;
|
||||
SOCKFS.websocket_sock_ops.createPeer = function(sock, addr, port)
|
||||
{
|
||||
let func = Module['websocket']['url'];
|
||||
Module['websocket']['url'] = func(addr, port, (sock.type == 2) ? 'udp' : 'tcp');
|
||||
let ret = SOCKFS.websocket_sock_ops.createPeer_(sock, addr, port);
|
||||
Module['websocket']['url'] = func;
|
||||
return ret;
|
||||
}
|
||||
});
|
||||
|
||||
Module.postRun.push(function() {
|
||||
/* Check if we downloaded OpenGFX; if so, sync the virtual FS back to the
|
||||
* IDBFS so OpenGFX is stored persistent. */
|
||||
if (window['openttd_downloaded_opengfx']) {
|
||||
FS.syncfs(false, function (err) { });
|
||||
}
|
||||
});
|
||||
205
os/emscripten/shell.html
Normal file
37
os/macosx/plistgen.sh → os/macosx/Info.plist.in
Executable file → Normal file
@@ -1,46 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
# sets VERSION to the value if RELEASE if there are any,
|
||||
# otherwise it sets VERSION to revision number
|
||||
if [ "$3" ]; then
|
||||
VERSION="$3"
|
||||
else
|
||||
VERSION="$2"
|
||||
fi
|
||||
date=`date +%Y`
|
||||
|
||||
# Generates Info.plist while applying $VERSION
|
||||
|
||||
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
|
||||
<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
|
||||
\"http://www.apple.com/DTDs/Prop$
|
||||
<plist version=\"1.0\">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
|
||||
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>OpenTTD</string>
|
||||
<string>${CPACK_BUNDLE_NAME}</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>openttd</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>$VERSION, Copyright 2004-$date The OpenTTD team</string>
|
||||
<string>#CPACK_PACKAGE_VERSION#, Copyright 2004-${CURRENT_YEAR} The OpenTTD team</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>openttd.icns</string>
|
||||
<string>${CPACK_BUNDLE_NAME}.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.openttd.openttd</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>OpenTTD</string>
|
||||
<string>${CPACK_BUNDLE_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$VERSION</string>
|
||||
<string>#CPACK_PACKAGE_VERSION#</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$VERSION</string>
|
||||
<string>#CPACK_PACKAGE_VERSION#</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright 2004-$date The OpenTTD team</string>
|
||||
<string>Copyright 2004-${CURRENT_YEAR} The OpenTTD team</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>" > "$1"/Contents/Info.plist
|
||||
</plist>
|
||||
58
os/macosx/notarize.sh
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# This script attempts to notarize the OpenTTD DMG generated by CPack.
|
||||
# If you are building an unofficial branch of OpenTTD, please change the bundle
|
||||
# ID in Info.plist and below.
|
||||
#
|
||||
# This uses `gon' to perform notarization:
|
||||
#
|
||||
# https://github.com/mitchellh/gon
|
||||
#
|
||||
# Follow the setup instructions on the gon site to install.
|
||||
#
|
||||
# Before executing this script, you must first configure CMake with at least the following
|
||||
# parameters:
|
||||
#
|
||||
# -DCPACK_BUNDLE_APPLE_CERT_APP={certificate ID}
|
||||
# "-DCPACK_BUNDLE_APPLE_CODESIGN_PARAMETER=--deep -f --options runtime"
|
||||
#
|
||||
# then run "make package" or "cpack".
|
||||
#
|
||||
# This will sign the application with your signing certificate, and will enable
|
||||
# the hardened runtime.
|
||||
#
|
||||
# You also need to set your Apple Developer username and password (app-specific password
|
||||
# is recommended) in the AC_USERNAME and AC_PASSWORD environment variables.
|
||||
#
|
||||
# Then, ensuring you're in your build directory and that the "bundles" directory
|
||||
# exists with a .dmg in it (clear out any old DMGs first), run:
|
||||
#
|
||||
# ../os/macosx/notarize.sh
|
||||
|
||||
if [ -z "${AC_USERNAME}" ]; then
|
||||
echo AC_USERNAME not set, skipping notarization.
|
||||
exit 0
|
||||
fi;
|
||||
|
||||
dmg_filename=(bundles/*.dmg)
|
||||
|
||||
if [ "${dmg_filename}" = "bundles/*.dmg" ]; then
|
||||
echo "No .dmg found in the bundles directory, skipping notarization. Please read this"
|
||||
echo "script's source for execution instructions."
|
||||
exit 1
|
||||
fi;
|
||||
|
||||
cat <<EOF > notarize.json
|
||||
{
|
||||
"notarize": [
|
||||
{
|
||||
"path": "${dmg_filename[0]}",
|
||||
"bundle_id": "org.openttd.openttd",
|
||||
"staple": true
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
|
||||
gon notarize.json
|
||||
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
@@ -1,6 +1,6 @@
|
||||
@echo off
|
||||
|
||||
set OPENTTD_VERSION=1.10.3
|
||||
set OPENTTD_VERSION=1.11.0
|
||||
set OPENSFX_VERSION=0.8.0
|
||||
set NOSOUND_VERSION=0.8.0
|
||||
set OPENGFX_VERSION=1.2.0
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# the man page is in the subpackage data
|
||||
addFilter("openttd.*: W: no-manual-page-for-binary openttd")
|
||||
# no other package depends on this package, so this should not matter
|
||||
addFilter("openttd.*: W: file-contains-date-and-time /usr/bin/openttd")
|
||||
addFilter("openttd.*: W: file-contains-current-date /usr/bin/openttd")
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Mar 6 09:36:55 UTC 2011 - ammler@openttdcoop.org
|
||||
|
||||
- upstream update 1.1.0-RC2
|
||||
* Feature: XZ/LZMA2 savegame support. New default reduces
|
||||
savegame size by 10 to 30% with slightly more CPU usage.
|
||||
(requires xz-devel)
|
||||
* Feature: Remote administration
|
||||
* Feature: a lot improvements with GUI
|
||||
* Feature: Customizable hotkeys
|
||||
* Sources for openttd.grf are pngs (requires grfcodec >= 5.1)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Nov 21 11:11:38 UTC 2010 - ammler@openttdcoop.org
|
||||
|
||||
- upstream update 1.0.5
|
||||
* Fix: Reading (very) recently freed memory [CVE-2010-4168]
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Oct 31 17:53:41 UTC 2010 - ammler@openttdcoop.org
|
||||
|
||||
- upstream update 1.0.4
|
||||
* build openttd.grf from source
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 10 20:16:03 UTC 2010 - ammler@openttdcoop.org
|
||||
|
||||
- upstream update 1.0.3
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 23 11:42:59 UTC 2010 - Marcel Gmür <ammler@openttdcoop.org>
|
||||
|
||||
- upstream update 1.0.2
|
||||
* Feature: Translated desktop shortcut comments (r19884)
|
||||
* many minor Bugfixes
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat May 1 15:59:32 UTC 2010 - Marcel Gmür <ammler@openttdcoop.org>
|
||||
|
||||
- upstream update 1.0.1
|
||||
* Fix: Leaking a file descriptor
|
||||
* Fix a lot small bugs, like minor desync issues on Mulitplayer
|
||||
- no strip on make
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 1 08:53:54 UTC 2010 - Marcel Gmür <ammler@openttdcoop.org>
|
||||
|
||||
- upstream update 1.0.0 (finally!)
|
||||
* completely independent game but still working also
|
||||
with ttd original gaphics, sounds and music
|
||||
- Add: Recommends openmsx
|
||||
- requires lzo2
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Dec 18 2009 Marcel Gmür <ammler@openttdcoop.org> - 0.7.4
|
||||
|
||||
- support for different branches
|
||||
- easy support for dedicated branch
|
||||
- let openttd build system make the dektop file
|
||||
- split the package to data and gui
|
||||
- disable requires
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 01 2009 Marcel Gmür <ammler@openttdcoop.org> - 0.7.3
|
||||
|
||||
- disable libicu for RHEL4
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Sep 26 2009 Marcel Gmür <ammler@openttdcoop.org> - 0.7.2
|
||||
|
||||
- no subfolder games for datadir
|
||||
- cleanup: no post and postun anymore
|
||||
- Recommends: opengfx (for suse and mandriva)
|
||||
- add SUSE support
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 20 2008 Benedikt Brüggemeier <skidd13@openttd.org>
|
||||
|
||||
- Added libicu dependency
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 23 2008 Benedikt Brüggemeier <skidd13@openttd.org>
|
||||
|
||||
- Merged both versions of the spec file
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 29 2008 Jonathan Coome <maedhros@openttd.org>
|
||||
|
||||
- Rewrite spec file from scratch.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Aug 02 2008 Benedikt Brüggemeier <skidd13@openttd.org>
|
||||
|
||||
- Updated spec file
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 27 2008 Denis Burlaka <burlaka@yandex.ru>
|
||||
|
||||
- Universal spec file
|
||||
|
||||
@@ -1,272 +0,0 @@
|
||||
#
|
||||
# spec file for package openttd
|
||||
#
|
||||
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2007-2019 The OpenTTD developers
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
Name: openttd
|
||||
Version: 1.10.3
|
||||
Release: 0
|
||||
%define srcver 1.10.3
|
||||
Summary: An open source reimplementation of Chris Sawyer's Transport Tycoon Deluxe
|
||||
License: GPL-2.0
|
||||
Group: Amusements/Games/Strategy/Other
|
||||
Url: http://www.openttd.org
|
||||
|
||||
Source: http://binaries.openttd.org/releases/%{srcver}/%{name}-%{srcver}-source.tar.gz
|
||||
|
||||
%if 0%{?suse_version} || 0%{?mdkversion}
|
||||
Recommends: %{name}-gui
|
||||
%endif
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: libpng-devel
|
||||
BuildRequires: zlib-devel
|
||||
|
||||
%if 0%{?suse_version} || 0%{?mdkversion}
|
||||
BuildRequires: update-alternatives
|
||||
Requires: update-alternatives
|
||||
%else
|
||||
BuildRequires: chkconfig
|
||||
Requires: chkconfig
|
||||
%endif
|
||||
|
||||
%if 0%{?mdkversion}
|
||||
BuildRequires: liblzma-devel
|
||||
BuildRequires: liblzo-devel
|
||||
%else
|
||||
BuildRequires: lzo-devel
|
||||
BuildRequires: xz-devel
|
||||
%endif
|
||||
|
||||
# OBS workaround: needed by libdrm
|
||||
%if 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
|
||||
BuildRequires: kernel
|
||||
%endif
|
||||
|
||||
# for lzma detection
|
||||
%if 0%{?suse_version}
|
||||
BuildRequires: pkg-config
|
||||
%endif
|
||||
|
||||
# building openttd.grf is not required as it is a) part of source and
|
||||
# b) required only, if you want to use the original set
|
||||
%if 0%{?with_grfcodec}
|
||||
BuildRequires: grfcodec
|
||||
%endif
|
||||
# Recommends would fit better but not well supported...
|
||||
Requires: openttd-opengfx >= 0.4.2
|
||||
|
||||
Obsoletes: %{name}-data < %{version}
|
||||
Provides: %{name}-data = %{version}
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
OpenTTD is a reimplementation of the Microprose game "Transport Tycoon Deluxe"
|
||||
with lots of new features and enhancements. To play the game you need either
|
||||
the original data from the game or install the recommend subackages OpenGFX for
|
||||
free graphics, OpenSFX for free sounds and OpenMSX for free music.
|
||||
|
||||
OpenTTD is licensed under the GNU General Public License version 2.0. For more
|
||||
information, see the file 'COPYING.md' included with every release and source
|
||||
download of the game.
|
||||
|
||||
%package gui
|
||||
Summary: OpenTTD GUI/Client (requires SDL)
|
||||
Group: Amusements/Games/Strategy/Other
|
||||
|
||||
Requires: %{name}
|
||||
Conflicts: %{name}-dedicated
|
||||
|
||||
BuildRequires: SDL2-devel
|
||||
BuildRequires: fontconfig-devel
|
||||
|
||||
%if 0%{?rhel_version} != 600
|
||||
BuildRequires: libicu-devel
|
||||
%endif
|
||||
%if 0%{?rhel_version} || 0%{?fedora}
|
||||
BuildRequires: freetype-devel
|
||||
%endif
|
||||
%if 0%{?suse_version} || 0%{?mdkversion}
|
||||
BuildRequires: freetype2-devel
|
||||
%endif
|
||||
%if 0%{?suse_version}
|
||||
BuildRequires: update-desktop-files
|
||||
%else
|
||||
BuildRequires: desktop-file-utils
|
||||
Requires: hicolor-icon-theme
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version} || 0%{?mdkversion}
|
||||
Recommends: openttd-openmsx
|
||||
Recommends: openttd-opensfx
|
||||
%endif
|
||||
|
||||
%description gui
|
||||
OpenTTD is a reimplementation of the Microprose game "Transport Tycoon Deluxe"
|
||||
with lots of new features and enhancements. To play the game you need either
|
||||
the original data from the game or install the recommend subackages OpenGFX for
|
||||
free graphics, OpenSFX for free sounds and OpenMSX for free music.
|
||||
|
||||
This subpackage provides the binary which needs SDL.
|
||||
|
||||
%package dedicated
|
||||
Summary: OpenTTD Dedicated Server binary (without SDL)
|
||||
Group: Amusements/Games/Strategy/Other
|
||||
|
||||
Requires: %{name}
|
||||
Conflicts: %{name}-gui
|
||||
|
||||
%description dedicated
|
||||
OpenTTD is a reimplementation of the Microprose game "Transport Tycoon Deluxe"
|
||||
with lots of new features and enhancements. To play the game you need either
|
||||
the original data from the game or the required package OpenGFX and OpenSFX.
|
||||
|
||||
This subpackage provides the binary without dependency of SDL.
|
||||
|
||||
%prep
|
||||
%setup -qn openttd%{?branch:-%{branch}}-%{srcver}
|
||||
|
||||
# we build the grfs from sources but validate the result with the existing data
|
||||
%if 0%{?with_grfcodec}
|
||||
md5sum bin/data/* > validate.data
|
||||
%endif
|
||||
|
||||
%build
|
||||
# first, we build the dedicated binary and copy it to dedicated/
|
||||
./configure \
|
||||
--prefix-dir="%{_prefix}" \
|
||||
--binary-dir="bin" \
|
||||
--data-dir="share/%{name}" \
|
||||
--enable-dedicated
|
||||
make %{?_smp_mflags} BUNDLE_DIR="dedicated" bundle
|
||||
|
||||
# then, we build the common gui version which we install the usual way
|
||||
./configure \
|
||||
--prefix-dir="%{_prefix}" \
|
||||
--binary-name="%{name}" \
|
||||
--binary-dir="bin" \
|
||||
--data-dir="share/%{name}" \
|
||||
--doc-dir="share/doc/%{name}" \
|
||||
--menu-name="OpenTTD%{?branch: %{branch}}" \
|
||||
--menu-group="Game;StrategyGame;"
|
||||
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
# install the dedicated binary
|
||||
install -D -m0755 dedicated/openttd %{buildroot}%{_bindir}/%{name}-dedicated
|
||||
# install the gui binary and rename to openttd-gui
|
||||
make install INSTALL_DIR=%{buildroot}
|
||||
mv %{buildroot}%{_bindir}/%{name} %{buildroot}%{_bindir}/%{name}-gui
|
||||
# we need a dummy target for /etc/alternatives/openttd
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
||||
touch %{buildroot}%{_sysconfdir}/alternatives/%{name}
|
||||
ln -s -f /etc/alternatives/%{name} %{buildroot}%{_bindir}/%{name}
|
||||
|
||||
%if 0%{?suse_version}
|
||||
%suse_update_desktop_file -r %{name} Game StrategyGame
|
||||
%else
|
||||
%if 0%{?fedora} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
|
||||
desktop-file-install --dir=%{buildroot}%{_datadir}/applications \
|
||||
--add-category=StrategyGame \
|
||||
media/openttd.desktop
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if 0%{?with_grfcodec}
|
||||
%check
|
||||
md5sum -c validate.data
|
||||
%endif
|
||||
|
||||
%post gui
|
||||
/usr/sbin/update-alternatives --install %{_bindir}/%{name} %{name} %{_bindir}/%{name}-gui 10
|
||||
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
|
||||
|
||||
%post dedicated
|
||||
/usr/sbin/update-alternatives --install %{_bindir}/%{name} %{name} %{_bindir}/%{name}-dedicated 0
|
||||
|
||||
%preun gui
|
||||
if [ "$1" = 0 ] ; then
|
||||
/usr/sbin/update-alternatives --remove %{name} %{_bindir}/%{name}-gui
|
||||
fi
|
||||
|
||||
%preun dedicated
|
||||
if [ "$1" = 0 ] ; then
|
||||
/usr/sbin/update-alternatives --remove %{name} %{_bindir}/%{name}-dedicated
|
||||
fi
|
||||
|
||||
%postun gui
|
||||
if [ "$1" -eq 0 ] ; then
|
||||
touch --no-create %{_datadir}/icons/hicolor &>/dev/null
|
||||
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
||||
fi
|
||||
|
||||
%posttrans gui
|
||||
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
||||
|
||||
# we need a file in the main package so it will be made
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
%dir %{_datadir}/doc/%{name}
|
||||
%dir %{_datadir}/%{name}
|
||||
%dir %{_datadir}/%{name}/lang
|
||||
%dir %{_datadir}/%{name}/baseset
|
||||
%dir %{_datadir}/%{name}/scripts
|
||||
%dir %{_datadir}/%{name}/ai
|
||||
%dir %{_datadir}/%{name}/game
|
||||
%{_datadir}/doc/%{name}/*
|
||||
%{_datadir}/%{name}/lang/*
|
||||
%{_datadir}/%{name}/baseset/*
|
||||
%{_datadir}/%{name}/scripts/*
|
||||
%{_datadir}/%{name}/ai/*
|
||||
%{_datadir}/%{name}/game/*
|
||||
%doc %{_mandir}/man6/%{name}.6.*
|
||||
|
||||
%files gui
|
||||
%defattr(-, root, root)
|
||||
%ghost %{_sysconfdir}/alternatives/%{name}
|
||||
%ghost %{_bindir}/%{name}
|
||||
%{_bindir}/%{name}-gui
|
||||
%dir %{_datadir}/icons/hicolor
|
||||
%dir %{_datadir}/icons/hicolor/16x16
|
||||
%dir %{_datadir}/icons/hicolor/16x16/apps
|
||||
%dir %{_datadir}/icons/hicolor/32x32
|
||||
%dir %{_datadir}/icons/hicolor/32x32/apps
|
||||
%dir %{_datadir}/icons/hicolor/48x48
|
||||
%dir %{_datadir}/icons/hicolor/48x48/apps
|
||||
%dir %{_datadir}/icons/hicolor/64x64
|
||||
%dir %{_datadir}/icons/hicolor/64x64/apps
|
||||
%dir %{_datadir}/icons/hicolor/128x128
|
||||
%dir %{_datadir}/icons/hicolor/128x128/apps
|
||||
%dir %{_datadir}/icons/hicolor/256x256
|
||||
%dir %{_datadir}/icons/hicolor/256x256/apps
|
||||
%{_datadir}/applications/%{name}.desktop
|
||||
%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
|
||||
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
|
||||
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
|
||||
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
|
||||
%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
|
||||
%{_datadir}/icons/hicolor/256x256/apps/%{name}.png
|
||||
%{_datadir}/pixmaps/%{name}.32.xpm
|
||||
|
||||
%files dedicated
|
||||
%defattr(-, root, root)
|
||||
%ghost %{_bindir}/%{name}
|
||||
%ghost %{_sysconfdir}/alternatives/%{name}
|
||||
%{_bindir}/%{name}-dedicated
|
||||
|
||||
%changelog
|
||||
@@ -1,4 +0,0 @@
|
||||
@echo off
|
||||
"c:\Program Files\NSIS\makensis.exe" /DVERSION_INCLUDE=version_win9x.txt install.nsi > win9x.log
|
||||
"c:\Program Files\NSIS\makensis.exe" /DVERSION_INCLUDE=version_win32.txt install.nsi > win32.log
|
||||
"c:\Program Files\NSIS\makensis.exe" /DVERSION_INCLUDE=version_win64.txt install.nsi > win64.log
|
||||
@@ -1,26 +0,0 @@
|
||||
; Ini file generated by the HM NIS Edit IO designer.
|
||||
[Settings]
|
||||
NumFields=3
|
||||
|
||||
[Field 1]
|
||||
Type=Groupbox
|
||||
Text=Transport Tycoon Deluxe Installation location
|
||||
Left=6
|
||||
Right=294
|
||||
Top=68
|
||||
Bottom=100
|
||||
|
||||
[Field 2]
|
||||
Type=DirRequest
|
||||
Left=10
|
||||
Right=290
|
||||
Top=80
|
||||
Bottom=92
|
||||
|
||||
[Field 3]
|
||||
Type=Label
|
||||
Left=17
|
||||
Right=282
|
||||
Top=6
|
||||
Bottom=64
|
||||
|
||||
@@ -1,744 +0,0 @@
|
||||
# Version numbers to update
|
||||
!define APPV_MAJOR 1
|
||||
!define APPV_MINOR 10
|
||||
!define APPV_MAINT 3
|
||||
!define APPV_BUILD 0
|
||||
!define APPV_EXTRA ""
|
||||
|
||||
!define APPNAME "OpenTTD" ; Define application name
|
||||
!define APPVERSION "${APPV_MAJOR}.${APPV_MINOR}.${APPV_MAINT}${APPV_EXTRA}" ; Define application version
|
||||
!define APPVERSIONINTERNAL "${APPV_MAJOR}.${APPV_MINOR}.${APPV_MAINT}.${APPV_BUILD}" ; Define application version in X.X.X.X
|
||||
!define INSTALLERVERSION ${APPV_MAJOR}${APPV_MINOR}${APPV_MAINT}${APPV_BUILD}
|
||||
!include ${VERSION_INCLUDE}
|
||||
|
||||
!define APPURLLINK "http://www.openttd.org"
|
||||
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}"
|
||||
|
||||
!define OPENGFX_BASE_VERSION "1.2.0"
|
||||
!define OPENSFX_BASE_VERSION "0.8.0"
|
||||
!define OPENMSX_BASE_VERSION "1.0.0"
|
||||
|
||||
!define MUI_ICON "..\..\..\media\openttd.ico"
|
||||
!define MUI_UNICON "..\..\..\media\openttd.ico"
|
||||
!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp"
|
||||
!define MUI_HEADERIMAGE
|
||||
!define MUI_HEADERIMAGE_BITMAP "top.bmp"
|
||||
|
||||
ManifestDPIAware true
|
||||
BrandingText "OpenTTD Installer"
|
||||
SetCompressor LZMA
|
||||
|
||||
; Version Info
|
||||
Var AddWinPrePopulate
|
||||
VIProductVersion "${APPVERSIONINTERNAL}"
|
||||
VIAddVersionKey "ProductName" "OpenTTD ${APPBITS}-bit Installer for Windows ${EXTRA_VERSION}"
|
||||
VIAddVersionKey "Comments" "Installs ${APPNAMEANDVERSION}"
|
||||
VIAddVersionKey "CompanyName" "OpenTTD Developers"
|
||||
VIAddVersionKey "FileDescription" "Installs ${APPNAMEANDVERSION}"
|
||||
VIAddVersionKey "ProductVersion" "${APPVERSION}"
|
||||
VIAddVersionKey "InternalName" "InstOpenTTD-${APPARCH}"
|
||||
VIAddVersionKey "FileVersion" "${APPVERSION}-${APPARCH}"
|
||||
VIAddVersionKey "LegalCopyright" " "
|
||||
; Main Install settings
|
||||
Name "${APPNAMEANDVERSION} ${APPBITS}-bit for Windows ${EXTRA_VERSION}"
|
||||
|
||||
; NOTE: Keep trailing backslash!
|
||||
InstallDirRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Install Folder"
|
||||
OutFile "openttd-${APPVERSION}-${APPARCH}.exe"
|
||||
CRCCheck force
|
||||
|
||||
ShowInstDetails show
|
||||
ShowUninstDetails show
|
||||
|
||||
RequestExecutionLevel admin
|
||||
|
||||
Var SHORTCUTS
|
||||
Var CDDRIVE
|
||||
|
||||
; Modern interface settings
|
||||
!include "MUI2.nsh"
|
||||
!include "InstallOptions.nsh"
|
||||
!include "WinVer.nsh"
|
||||
|
||||
!define MUI_ABORTWARNING
|
||||
!define MUI_WELCOMEPAGE_TITLE_3LINES
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
!insertmacro MUI_PAGE_LICENSE "..\..\..\COPYING.md"
|
||||
|
||||
!define MUI_COMPONENTSPAGE_SMALLDESC
|
||||
!insertmacro MUI_PAGE_COMPONENTS
|
||||
|
||||
;---------------------------------
|
||||
; Custom page for finding TTDLX CD
|
||||
Page custom SelectCDEnter SelectCDExit ": TTD folder"
|
||||
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
|
||||
;Start Menu Folder Page Configuration
|
||||
!define MUI_STARTMENUPAGE_DEFAULTFOLDER $SHORTCUTS
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKEY_LOCAL_MACHINE"
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD"
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Shortcut Folder"
|
||||
|
||||
!insertmacro MUI_PAGE_STARTMENU "OpenTTD" $SHORTCUTS
|
||||
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
|
||||
!define MUI_FINISHPAGE_TITLE_3LINES
|
||||
!define MUI_FINISHPAGE_RUN_TEXT "Run ${APPNAMEANDVERSION} now!"
|
||||
!define MUI_FINISHPAGE_RUN "$INSTDIR\openttd.exe"
|
||||
!define MUI_FINISHPAGE_LINK "Visit the OpenTTD site for more information"
|
||||
!define MUI_FINISHPAGE_LINK_LOCATION "${APPURLLINK}"
|
||||
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
|
||||
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.md"
|
||||
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
|
||||
!define MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT DisableBack
|
||||
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
!define MUI_PAGE_HEADER_TEXT "Uninstall ${APPNAMEANDVERSION}"
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
|
||||
; Set languages (first is default language)
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
!insertmacro MUI_RESERVEFILE_LANGDLL
|
||||
|
||||
;--------------------------------------------------------------
|
||||
; (Core) OpenTTD install section. Copies all internal game data
|
||||
Section "!OpenTTD" Section1
|
||||
; Make sure to be upgraded OpenTTD is not running
|
||||
Call CheckOpenTTDRunning
|
||||
|
||||
; Overwrite files by default, but don't complain on failure
|
||||
SetOverwrite try
|
||||
|
||||
SetShellVarContext all
|
||||
|
||||
; Define root variable relative to installer
|
||||
!define PATH_ROOT "..\..\..\"
|
||||
|
||||
; Copy language files
|
||||
SetOutPath "$INSTDIR\lang\"
|
||||
File ${PATH_ROOT}bin\lang\english.lng
|
||||
|
||||
; Copy AI files
|
||||
SetOutPath "$INSTDIR\ai\"
|
||||
File ${PATH_ROOT}bin\ai\compat_*.nut
|
||||
|
||||
; Copy Game Script files
|
||||
SetOutPath "$INSTDIR\game\"
|
||||
File ${PATH_ROOT}bin\game\compat_*.nut
|
||||
|
||||
; Copy data files
|
||||
SetOutPath "$INSTDIR\baseset\"
|
||||
File ${PATH_ROOT}bin\baseset\*.grf
|
||||
File ${PATH_ROOT}bin\baseset\*.obg
|
||||
File ${PATH_ROOT}bin\baseset\*.obm
|
||||
File ${PATH_ROOT}bin\baseset\*.obs
|
||||
File ${PATH_ROOT}bin\baseset\opntitle.dat
|
||||
|
||||
; Copy the scripts
|
||||
SetOutPath "$INSTDIR\scripts\"
|
||||
File ${PATH_ROOT}bin\scripts\*.*
|
||||
Push "$INSTDIR\scripts\README.md"
|
||||
Call unix2dos
|
||||
|
||||
; Copy some documentation files
|
||||
SetOutPath "$INSTDIR\docs\"
|
||||
File ${PATH_ROOT}docs\multiplayer.md
|
||||
Push "$INSTDIR\docs\multiplayer.md"
|
||||
Call unix2dos
|
||||
|
||||
; Copy the rest of the stuff
|
||||
SetOutPath "$INSTDIR\"
|
||||
|
||||
; Copy text files
|
||||
File ${PATH_ROOT}changelog.txt
|
||||
Push "$INSTDIR\changelog.txt"
|
||||
Call unix2dos
|
||||
File ${PATH_ROOT}COPYING.md
|
||||
Push "$INSTDIR\COPYING.md"
|
||||
Call unix2dos
|
||||
File ${PATH_ROOT}README.md
|
||||
Push "$INSTDIR\README.md"
|
||||
Call unix2dos
|
||||
File ${PATH_ROOT}known-bugs.txt
|
||||
Push "$INSTDIR\known-bugs.txt"
|
||||
Call unix2dos
|
||||
|
||||
; Copy executable
|
||||
File /oname=openttd.exe ${BINARY_DIR}\openttd.exe
|
||||
|
||||
|
||||
; Delete old files from the main dir. they are now placed in baseset/ and lang/
|
||||
Delete "$INSTDIR\*.lng"
|
||||
Delete "$INSTDIR\*.grf"
|
||||
Delete "$INSTDIR\sample.cat"
|
||||
Delete "$INSTDIR\ttd.exe"
|
||||
Delete "$INSTDIR\data\opntitle.dat"
|
||||
Delete "$INSTDIR\data\2ccmap.grf"
|
||||
Delete "$INSTDIR\data\airports.grf"
|
||||
Delete "$INSTDIR\data\autorail.grf"
|
||||
Delete "$INSTDIR\data\canalsw.grf"
|
||||
Delete "$INSTDIR\data\dosdummy.grf"
|
||||
Delete "$INSTDIR\data\elrailsw.grf"
|
||||
Delete "$INSTDIR\data\nsignalsw.grf"
|
||||
Delete "$INSTDIR\data\openttd.grf"
|
||||
Delete "$INSTDIR\data\roadstops.grf"
|
||||
Delete "$INSTDIR\data\trkfoundw.grf"
|
||||
Delete "$INSTDIR\data\openttdd.grf"
|
||||
Delete "$INSTDIR\data\openttdw.grf"
|
||||
Delete "$INSTDIR\data\orig_win.obg"
|
||||
Delete "$INSTDIR\data\orig_dos.obg"
|
||||
Delete "$INSTDIR\data\orig_dos_de.obg"
|
||||
Delete "$INSTDIR\data\orig_win.obs"
|
||||
Delete "$INSTDIR\data\orig_dos.obs"
|
||||
Delete "$INSTDIR\data\no_sound.obs"
|
||||
|
||||
; Create the Registry Entries
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Comments" "Visit ${APPURLLINK}"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayIcon" "$INSTDIR\openttd.exe,0"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayName" "OpenTTD ${APPVERSION}"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayVersion" "${APPVERSION}"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "HelpLink" "${APPURLLINK}"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Install Folder" "$INSTDIR"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Publisher" "OpenTTD"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Shortcut Folder" "$SHORTCUTS"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "UninstallString" "$INSTDIR\uninstall.exe"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "URLInfoAbout" "${APPURLLINK}"
|
||||
; This key sets the Version DWORD that new installers will check against
|
||||
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Version" ${INSTALLERVERSION}
|
||||
|
||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN "OpenTTD"
|
||||
CreateShortCut "$DESKTOP\OpenTTD.lnk" "$INSTDIR\openttd.exe"
|
||||
CreateDirectory "$SMPROGRAMS\$SHORTCUTS"
|
||||
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\OpenTTD.lnk" "$INSTDIR\openttd.exe"
|
||||
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Uninstall.lnk" "$INSTDIR\uninstall.exe"
|
||||
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Readme.lnk" "$INSTDIR\README.md"
|
||||
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Changelog.lnk" "$INSTDIR\Changelog.txt"
|
||||
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Known-bugs.lnk" "$INSTDIR\known-bugs.txt"
|
||||
CreateDirectory "$SMPROGRAMS\$SHORTCUTS\Docs"
|
||||
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Docs\Multiplayer.lnk" "$INSTDIR\docs\multiplayer.md"
|
||||
CreateDirectory "$SMPROGRAMS\$SHORTCUTS\Scripts"
|
||||
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Scripts\Readme.lnk" "$INSTDIR\scripts\README.md"
|
||||
!insertmacro MUI_STARTMENU_WRITE_END
|
||||
SectionEnd
|
||||
|
||||
;--------------------------------------------------------------
|
||||
; OpenTTD translation install section. Copies only translations
|
||||
Section "OpenTTD translations" Section6
|
||||
; Overwrite files by default, but don't complain on failure
|
||||
SetOverwrite try
|
||||
|
||||
; Copy language files
|
||||
SetOutPath "$INSTDIR\lang\"
|
||||
File ${PATH_ROOT}bin\lang\*.lng
|
||||
SectionEnd
|
||||
|
||||
;----------------------------------------------------------------------------------
|
||||
; OpenGFX files install section. Downloads OpenGFX and installs it
|
||||
Section "Download OpenGFX (free graphics set)" Section3
|
||||
SetOverwrite try
|
||||
|
||||
NSISdl::download "http://binaries.openttd.org/installer/opengfx-${OPENGFX_BASE_VERSION}.7z" "$INSTDIR\baseset\opengfx.7z"
|
||||
Pop $R0 ;Get the return value
|
||||
StrCmp $R0 "success" +3
|
||||
MessageBox MB_OK "Downloading of OpenGFX failed"
|
||||
Goto Done
|
||||
|
||||
; Let's extract the files
|
||||
SetOutPath "$INSTDIR\baseset\"
|
||||
NSIS7z::Extract "$INSTDIR\baseset\opengfx.7z"
|
||||
|
||||
Delete "$INSTDIR\baseset\opengfx.7z"
|
||||
SetOutPath "$INSTDIR\"
|
||||
Done:
|
||||
|
||||
SectionEnd
|
||||
|
||||
;----------------------------------------------------------------------------------
|
||||
; OpenSFX files install section. Downloads OpenSFX and installs it
|
||||
Section "Download OpenSFX (free sound set)" Section4
|
||||
SetOverwrite try
|
||||
|
||||
NSISdl::download "http://binaries.openttd.org/installer/opensfx-${OPENSFX_BASE_VERSION}.7z" "$INSTDIR\baseset\opensfx.7z"
|
||||
Pop $R0 ;Get the return value
|
||||
StrCmp $R0 "success" +3
|
||||
MessageBox MB_OK "Downloading of OpenSFX failed"
|
||||
Goto Done
|
||||
|
||||
; Let's extract the files
|
||||
SetOutPath "$INSTDIR\baseset\"
|
||||
NSIS7z::Extract "$INSTDIR\baseset\opensfx.7z"
|
||||
|
||||
Delete "$INSTDIR\baseset\opensfx.7z"
|
||||
SetOutPath "$INSTDIR\"
|
||||
Done:
|
||||
|
||||
SectionEnd
|
||||
|
||||
;----------------------------------------------------------------------------------
|
||||
; OpenMSX files install section. Downloads OpenMSX and installs it
|
||||
Section "Download OpenMSX (free music set)" Section5
|
||||
SetOverwrite try
|
||||
|
||||
NSISdl::download "http://binaries.openttd.org/installer/openmsx-${OPENMSX_BASE_VERSION}.7z" "$INSTDIR\baseset\openmsx.7z"
|
||||
Pop $R0 ;Get the return value
|
||||
StrCmp $R0 "success" +3
|
||||
MessageBox MB_OK "Downloading of OpenMSX failed"
|
||||
Goto Done
|
||||
|
||||
; Let's extract the files
|
||||
SetOutPath "$INSTDIR\baseset\"
|
||||
NSIS7z::Extract "$INSTDIR\baseset\openmsx.7z"
|
||||
|
||||
Delete "$INSTDIR\baseset\openmsx.7z"
|
||||
SetOutPath "$INSTDIR\"
|
||||
Done:
|
||||
|
||||
SectionEnd
|
||||
|
||||
;----------------------------------------------------------------------------------
|
||||
; TTDLX files install section. Copies all needed TTDLX files from CD or install dir
|
||||
Section /o "Copy data from Transport Tycoon Deluxe CD-ROM" Section2
|
||||
SetOverwrite try
|
||||
; Let's copy the files with size approximation
|
||||
SetOutPath "$INSTDIR\baseset"
|
||||
CopyFiles "$CDDRIVE\gm\*.gm" "$INSTDIR\baseset\" 1028
|
||||
CopyFiles "$CDDRIVE\gm.cat" "$INSTDIR\baseset\gm.cat" 415
|
||||
CopyFiles "$CDDRIVE\sample.cat" "$INSTDIR\baseset\sample.cat" 1566
|
||||
; Copy Windows files
|
||||
CopyFiles "$CDDRIVE\trg1r.grf" "$INSTDIR\baseset\trg1r.grf" 2365
|
||||
CopyFiles "$CDDRIVE\trgcr.grf" "$INSTDIR\baseset\trgcr.grf" 260
|
||||
CopyFiles "$CDDRIVE\trghr.grf" "$INSTDIR\baseset\trghr.grf" 400
|
||||
CopyFiles "$CDDRIVE\trgir.grf" "$INSTDIR\baseset\trgir.grf" 334
|
||||
CopyFiles "$CDDRIVE\trgtr.grf" "$INSTDIR\baseset\trgtr.grf" 546
|
||||
; Copy DOS files
|
||||
CopyFiles "$CDDRIVE\trg1.grf" "$INSTDIR\baseset\trg1.grf" 2365
|
||||
CopyFiles "$CDDRIVE\trgc.grf" "$INSTDIR\baseset\trgc.grf" 260
|
||||
CopyFiles "$CDDRIVE\trgh.grf" "$INSTDIR\baseset\trgh.grf" 400
|
||||
CopyFiles "$CDDRIVE\trgi.grf" "$INSTDIR\baseset\trgi.grf" 334
|
||||
CopyFiles "$CDDRIVE\trgt.grf" "$INSTDIR\baseset\trgt.grf" 546
|
||||
SetOutPath "$INSTDIR\"
|
||||
SectionEnd
|
||||
|
||||
;-------------------------------------------
|
||||
; Install the uninstaller (option is hidden)
|
||||
Section -FinishSection
|
||||
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||
SectionEnd
|
||||
|
||||
; Modern install component descriptions
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} "Minimal OpenTTD installation in English. You need at least one of the game graphics and sound sets installed."
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${Section6} "Translations of OpenTTD."
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${Section3} "Download the free OpenGFX game graphics set. This download is about 3 MiB."
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${Section4} "Download the free OpenSFX game sound set. This download is about 10 MiB."
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${Section5} "Download the free OpenMSX game music set. This download is about 200 KiB."
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${Section2} "Copies the game graphics, sounds and music from the Transport Tycoon Deluxe CD."
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
|
||||
;-----------------------------------------------
|
||||
; Uninstall section, deletes all installed files
|
||||
Section "Uninstall"
|
||||
SetShellVarContext all
|
||||
|
||||
IfFileExists "$INSTDIR\save" 0 NoRemoveSavedGames
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION \
|
||||
"Remove the save game folders located at $\"$INSTDIR\save$\"?$\n \
|
||||
If you choose Yes, your saved games will be deleted." \
|
||||
IDYES RemoveSavedGames IDNO NoRemoveSavedGames
|
||||
RemoveSavedGames:
|
||||
Delete "$INSTDIR\save\autosave\*"
|
||||
RMDir "$INSTDIR\save\autosave"
|
||||
Delete "$INSTDIR\save\*"
|
||||
RMDir "$INSTDIR\save"
|
||||
NoRemoveSavedGames:
|
||||
|
||||
IfFileExists "$INSTDIR\scenario" 0 NoRemoveScen
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION \
|
||||
"Remove the scenario folders located at $\"$INSTDIR\scenario$\"?$\n \
|
||||
If you choose Yes, your scenarios will be deleted." \
|
||||
IDYES RemoveScen IDNO NoRemoveScen
|
||||
RemoveScen:
|
||||
Delete "$INSTDIR\scenario\heightmap*"
|
||||
RMDir "$INSTDIR\scenario\heightmap"
|
||||
Delete "$INSTDIR\scenario\*"
|
||||
RMDir "$INSTDIR\scenario"
|
||||
NoRemoveScen:
|
||||
|
||||
; Remove from registry...
|
||||
!insertmacro MUI_STARTMENU_GETFOLDER "OpenTTD" $SHORTCUTS
|
||||
ReadRegStr $SHORTCUTS HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Shortcut Folder"
|
||||
|
||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD"
|
||||
|
||||
; Delete self
|
||||
Delete "$INSTDIR\uninstall.exe"
|
||||
|
||||
; Delete Shortcuts
|
||||
Delete "$DESKTOP\OpenTTD.lnk"
|
||||
Delete "$SMPROGRAMS\$SHORTCUTS\OpenTTD.lnk"
|
||||
Delete "$SMPROGRAMS\$SHORTCUTS\Uninstall.lnk"
|
||||
Delete "$SMPROGRAMS\$SHORTCUTS\Readme.lnk"
|
||||
Delete "$SMPROGRAMS\$SHORTCUTS\Changelog.lnk"
|
||||
Delete "$SMPROGRAMS\$SHORTCUTS\Known-bugs.lnk"
|
||||
Delete "$SMPROGRAMS\$SHORTCUTS\Docs\Multiplayer.lnk"
|
||||
Delete "$SMPROGRAMS\$SHORTCUTS\Docs\32bpp.lnk"
|
||||
Delete "$SMPROGRAMS\$SHORTCUTS\Scripts\Readme.lnk"
|
||||
|
||||
; Clean up OpenTTD dir
|
||||
Delete "$INSTDIR\changelog.txt"
|
||||
Delete "$INSTDIR\README.md"
|
||||
Delete "$INSTDIR\known-bugs.txt"
|
||||
Delete "$INSTDIR\openttd.exe"
|
||||
Delete "$INSTDIR\COPYING.md"
|
||||
Delete "$INSTDIR\INSTALL.LOG"
|
||||
Delete "$INSTDIR\crash.log"
|
||||
Delete "$INSTDIR\crash.dmp"
|
||||
Delete "$INSTDIR\openttd.cfg"
|
||||
Delete "$INSTDIR\hs.dat"
|
||||
Delete "$INSTDIR\cached_sprites.*"
|
||||
Delete "$INSTDIR\save\autosave\network*.tmp" ; temporary network file
|
||||
|
||||
; AI files
|
||||
Delete "$INSTDIR\ai\compat_*.nut"
|
||||
|
||||
; Game Script files
|
||||
Delete "$INSTDIR\game\compat_*.nut"
|
||||
|
||||
; Baseset files
|
||||
Delete "$INSTDIR\baseset\opntitle.dat"
|
||||
Delete "$INSTDIR\baseset\openttd.grf"
|
||||
Delete "$INSTDIR\baseset\orig_extra.grf"
|
||||
Delete "$INSTDIR\baseset\orig_win.obg"
|
||||
Delete "$INSTDIR\baseset\orig_dos.obg"
|
||||
Delete "$INSTDIR\baseset\orig_dos_de.obg"
|
||||
Delete "$INSTDIR\baseset\orig_win.obs"
|
||||
Delete "$INSTDIR\baseset\orig_dos.obs"
|
||||
Delete "$INSTDIR\baseset\no_sound.obs"
|
||||
Delete "$INSTDIR\baseset\sample.cat"
|
||||
Delete "$INSTDIR\baseset\trg1r.grf"
|
||||
Delete "$INSTDIR\baseset\trghr.grf"
|
||||
Delete "$INSTDIR\baseset\trgtr.grf"
|
||||
Delete "$INSTDIR\baseset\trgcr.grf"
|
||||
Delete "$INSTDIR\baseset\trgir.grf"
|
||||
Delete "$INSTDIR\baseset\trg1.grf"
|
||||
Delete "$INSTDIR\baseset\trgh.grf"
|
||||
Delete "$INSTDIR\baseset\trgt.grf"
|
||||
Delete "$INSTDIR\baseset\trgc.grf"
|
||||
Delete "$INSTDIR\baseset\trgi.grf"
|
||||
Delete "$INSTDIR\baseset\gm.cat"
|
||||
Delete "$INSTDIR\baseset\gm-tto.cat"
|
||||
Delete "$INSTDIR\baseset\*.gm"
|
||||
|
||||
Delete "$INSTDIR\data\sample.cat"
|
||||
Delete "$INSTDIR\data\trg1r.grf"
|
||||
Delete "$INSTDIR\data\trghr.grf"
|
||||
Delete "$INSTDIR\data\trgtr.grf"
|
||||
Delete "$INSTDIR\data\trgcr.grf"
|
||||
Delete "$INSTDIR\data\trgir.grf"
|
||||
Delete "$INSTDIR\data\trg1.grf"
|
||||
Delete "$INSTDIR\data\trgh.grf"
|
||||
Delete "$INSTDIR\data\trgt.grf"
|
||||
Delete "$INSTDIR\data\trgc.grf"
|
||||
Delete "$INSTDIR\data\trgi.grf"
|
||||
Delete "$INSTDIR\gm\*.gm"
|
||||
|
||||
; Downloaded OpenGFX/OpenSFX/OpenMSX
|
||||
Delete "$INSTDIR\baseset\opengfx\*"
|
||||
RMDir "$INSTDIR\baseset\opengfx"
|
||||
Delete "$INSTDIR\baseset\opensfx\*"
|
||||
RMDir "$INSTDIR\baseset\opensfx"
|
||||
Delete "$INSTDIR\baseset\openmsx\*"
|
||||
RMDir "$INSTDIR\baseset\openmsx"
|
||||
|
||||
Delete "$INSTDIR\data\opengfx\*"
|
||||
RMDir "$INSTDIR\data\opengfx"
|
||||
Delete "$INSTDIR\data\opensfx\*"
|
||||
RMDir "$INSTDIR\data\opensfx"
|
||||
Delete "$INSTDIR\gm\openmsx\*"
|
||||
RMDir "$INSTDIR\gm\openmsx"
|
||||
|
||||
; Language files
|
||||
Delete "$INSTDIR\lang\*.lng"
|
||||
|
||||
; Scripts
|
||||
Delete "$INSTDIR\scripts\*.*"
|
||||
|
||||
; Documentation
|
||||
Delete "$INSTDIR\docs\*.*"
|
||||
|
||||
; Base sets for music
|
||||
Delete "$INSTDIR\gm\orig_win.obm"
|
||||
Delete "$INSTDIR\gm\orig_dos.obm"
|
||||
Delete "$INSTDIR\gm\no_music.obm"
|
||||
Delete "$INSTDIR\baseset\orig_win.obm"
|
||||
Delete "$INSTDIR\baseset\orig_dos.obm"
|
||||
Delete "$INSTDIR\baseset\no_music.obm"
|
||||
|
||||
; Remove remaining directories
|
||||
RMDir "$SMPROGRAMS\$SHORTCUTS\Extras\"
|
||||
RMDir "$SMPROGRAMS\$SHORTCUTS\Scripts\"
|
||||
RMDir "$SMPROGRAMS\$SHORTCUTS\Docs\"
|
||||
RMDir "$SMPROGRAMS\$SHORTCUTS"
|
||||
RMDir "$INSTDIR\ai"
|
||||
RMDir "$INSTDIR\game"
|
||||
RMDir "$INSTDIR\data"
|
||||
RMDir "$INSTDIR\baseset"
|
||||
RMDir "$INSTDIR\gm"
|
||||
RMDir "$INSTDIR\lang"
|
||||
RMDir "$INSTDIR\scripts"
|
||||
RMDir "$INSTDIR\docs"
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
SectionEnd
|
||||
|
||||
;------------------------------------------------------------
|
||||
; Custom page function to find the TTDLX CD/install location
|
||||
Function SelectCDEnter
|
||||
SectionGetFlags ${Section2} $0
|
||||
IntOp $1 $0 & 0x80 ; bit 7 set by upgrade, no need to copy files
|
||||
IntCmp $1 1 DoneCD ; Upgrade doesn't need copy files
|
||||
|
||||
IntOp $0 $0 & 1
|
||||
IntCmp $0 1 NoAbort
|
||||
Abort
|
||||
NoAbort:
|
||||
|
||||
GetTempFileName $R0
|
||||
!insertmacro MUI_HEADER_TEXT "Locate TTD" "Setup needs the location of Transport Tycoon Deluxe in order to continue."
|
||||
!insertmacro INSTALLOPTIONS_EXTRACT_AS "CDFinder.ini" "CDFinder"
|
||||
|
||||
ClearErrors
|
||||
; Now, let's populate $CDDRIVE
|
||||
ReadRegStr $R0 HKLM "SOFTWARE\Fish Technology Group\Transport Tycoon Deluxe" "HDPath"
|
||||
IfErrors NoTTD
|
||||
StrCmp $CDDRIVE "" 0 Populated
|
||||
StrCpy $CDDRIVE $R0
|
||||
Populated:
|
||||
StrCpy $AddWinPrePopulate "Setup has detected your TTD folder. Don't change the folder. Simply press Next."
|
||||
Goto TruFinish
|
||||
NoTTD:
|
||||
StrCpy $AddWinPrePopulate "Setup couldn't find TTD. Please enter the path where the graphics files from TTD are stored and press Next to continue."
|
||||
TruFinish:
|
||||
ClearErrors
|
||||
!insertmacro INSTALLOPTIONS_WRITE "CDFinder" "Field 2" "State" $CDDRIVE ; TTDLX path
|
||||
!insertmacro INSTALLOPTIONS_WRITE "CDFinder" "Field 3" "Text" $AddWinPrePopulate ; Caption
|
||||
DoneCD:
|
||||
; Initialize the dialog *AFTER* we've changed the text otherwise we won't see the changes
|
||||
!insertmacro INSTALLOPTIONS_INITDIALOG "CDFinder"
|
||||
!insertmacro INSTALLOPTIONS_SHOW
|
||||
FunctionEnd
|
||||
|
||||
;----------------------------------------------------------------
|
||||
; Custom page function when 'next' is selected for the TTDLX path
|
||||
Function SelectCDExit
|
||||
!insertmacro INSTALLOPTIONS_READ $CDDRIVE "CDFinder" "Field 2" "State"
|
||||
; If trg1r.grf does not exist at the path, retry with DOS version
|
||||
IfFileExists $CDDRIVE\trg1r.grf "" DosCD
|
||||
IfFileExists $CDDRIVE\trgir.grf "" NoCD
|
||||
IfFileExists $CDDRIVE\sample.cat hasCD NoCD
|
||||
DosCD:
|
||||
IfFileExists $CDDRIVE\TRG1.GRF "" NoCD
|
||||
IfFileExists $CDDRIVE\TRGI.GRF "" NoCD
|
||||
IfFileExists $CDDRIVE\SAMPLE.CAT hasCD NoCD
|
||||
NoCD:
|
||||
MessageBox MB_OK "Setup cannot continue without the Transport Tycoon Deluxe location!"
|
||||
Abort
|
||||
hasCD:
|
||||
FunctionEnd
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
; Determine windows version, returns "win9x" if Win9x/Me/2000/XP SP2- or "winnt" for the rest on the stack
|
||||
Function GetWindowsVersion
|
||||
GetVersion::WindowsPlatformArchitecture
|
||||
Pop $R0
|
||||
IntCmp $R0 64 WinNT 0
|
||||
ClearErrors
|
||||
StrCpy $R0 "win9x"
|
||||
${If} ${IsNT}
|
||||
${If} ${IsWinXP}
|
||||
${AndIf} ${AtLeastServicePack} 3
|
||||
${OrIf} ${AtLeastWin2003}
|
||||
GoTo WinNT
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
GoTo Done
|
||||
WinNT:
|
||||
StrCpy $R0 "winnt"
|
||||
Done:
|
||||
Push $R0
|
||||
FunctionEnd
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
; Check whether we're not running an installer for 64 bits on 32 bits and vice versa
|
||||
Function CheckProcessorArchitecture
|
||||
GetVersion::WindowsPlatformArchitecture
|
||||
Pop $R0
|
||||
IntCmp $R0 64 Win64 0
|
||||
ClearErrors
|
||||
IntCmp ${APPBITS} 64 0 Done
|
||||
MessageBox MB_YESNO|MB_ICONSTOP "You are trying to install the 64-bit OpenTTD on a 32-bit operating system. This is not going to work. Please download the correct version. Do you really want to continue?" IDYES Done IDNO Abort
|
||||
GoTo Done
|
||||
Win64:
|
||||
ClearErrors
|
||||
IntCmp ${APPBITS} 64 Done 0
|
||||
MessageBox MB_YESNO|MB_ICONINFORMATION "You are trying to install the 32-bit OpenTTD on a 64-bit operating system. This is not advised, but will work with reduced capabilities. We suggest that you download the correct version. Do you really want to continue?" IDYES Done IDNO Abort
|
||||
GoTo Done
|
||||
Abort:
|
||||
Quit
|
||||
Done:
|
||||
FunctionEnd
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
; Check whether we're not running an installer for NT on 9x and vice versa
|
||||
Function CheckWindowsVersion
|
||||
Call GetWindowsVersion
|
||||
Pop $R0
|
||||
StrCmp $R0 "win9x" 0 WinNT
|
||||
ClearErrors
|
||||
StrCmp ${APPARCH} "win9x" Done 0
|
||||
MessageBox MB_YESNO|MB_ICONSTOP "You are trying to install the Windows XP SP3 and newer version on Windows 95, 98, ME, 2000, or XP without SP3. This will not work - please download the correct version. Do you really want to continue?" IDYES Done IDNO Abort
|
||||
GoTo Done
|
||||
WinNT:
|
||||
ClearErrors
|
||||
StrCmp ${APPARCH} "win9x" 0 Done
|
||||
MessageBox MB_YESNO|MB_ICONEXCLAMATION "You are trying to install the Windows 95, 98, 2000 and XP without SP3 version on Windows XP SP3 or newer. This is not advised, but will work with reduced capabilities. We suggest that you download the correct version. Do you really want to continue?" IDYES Done IDNO Abort
|
||||
Abort:
|
||||
Quit
|
||||
Done:
|
||||
FunctionEnd
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
; Check whether OpenTTD is running
|
||||
Function CheckOpenTTDRunning
|
||||
IfFileExists "$INSTDIR\openttd.exe" 0 Done
|
||||
Retry:
|
||||
FindProcDLL::FindProc "openttd.exe"
|
||||
Pop $R0
|
||||
IntCmp $R0 1 0 Done
|
||||
ClearErrors
|
||||
Delete "$INSTDIR\openttd.exe"
|
||||
IfErrors 0 Done
|
||||
ClearErrors
|
||||
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "OpenTTD is running. Please close it and retry." IDRETRY Retry
|
||||
Abort
|
||||
Done:
|
||||
FunctionEnd
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
; strips all CRs
|
||||
; and then converts all LFs into CRLFs
|
||||
; (this is roughly equivalent to "cat file | dos2unix | unix2dos")
|
||||
;
|
||||
; usage:
|
||||
; Push "infile"
|
||||
; Call unix2dos
|
||||
;
|
||||
; beware that this function destroys $0 $1 $2
|
||||
Function unix2dos
|
||||
ClearErrors
|
||||
|
||||
Pop $2
|
||||
Rename $2 $2.U2D
|
||||
FileOpen $1 $2 w
|
||||
|
||||
FileOpen $0 $2.U2D r
|
||||
|
||||
Push $2 ; save name for deleting
|
||||
|
||||
IfErrors unix2dos_done
|
||||
|
||||
; $0 = file input (opened for reading)
|
||||
; $1 = file output (opened for writing)
|
||||
|
||||
unix2dos_loop:
|
||||
; read a byte (stored in $2)
|
||||
FileReadByte $0 $2
|
||||
IfErrors unix2dos_done ; EOL
|
||||
; skip CR
|
||||
StrCmp $2 13 unix2dos_loop
|
||||
; if LF write an extra CR
|
||||
StrCmp $2 10 unix2dos_cr unix2dos_write
|
||||
|
||||
unix2dos_cr:
|
||||
FileWriteByte $1 13
|
||||
|
||||
unix2dos_write:
|
||||
; write byte
|
||||
FileWriteByte $1 $2
|
||||
; read next byte
|
||||
Goto unix2dos_loop
|
||||
|
||||
unix2dos_done:
|
||||
; close files
|
||||
FileClose $0
|
||||
FileClose $1
|
||||
|
||||
; delete original
|
||||
Pop $0
|
||||
Delete $0.U2D
|
||||
|
||||
FunctionEnd
|
||||
|
||||
|
||||
Var OLDVERSION
|
||||
Var UninstallString
|
||||
|
||||
;-----------------------------------------------------------------------------------
|
||||
; NSIS Initialize function, determine if we are going to install/upgrade or uninstall
|
||||
Function .onInit
|
||||
StrCpy $SHORTCUTS "OpenTTD"
|
||||
|
||||
SectionSetSize ${Section3} 6144
|
||||
SectionSetSize ${Section4} 13312
|
||||
SectionSetSize ${Section5} 1024
|
||||
|
||||
SectionSetFlags 0 17
|
||||
|
||||
; Starts Setup - let's look for an older version of OpenTTD
|
||||
ReadRegDWORD $R8 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Version"
|
||||
|
||||
IfErrors ShowWelcomeMessage ShowUpgradeMessage
|
||||
ShowWelcomeMessage:
|
||||
ReadRegStr $R8 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Version"
|
||||
; In the event someone still has OpenTTD 0.1, this will detect that (that installer used a string instead of dword entry)
|
||||
IfErrors FinishCallback
|
||||
|
||||
ShowUpgradeMessage:
|
||||
IntCmp ${INSTALLERVERSION} $R8 VersionsAreEqual InstallerIsOlder WelcomeToSetup
|
||||
WelcomeToSetup:
|
||||
; An older version was found. Let's let the user know there's an upgrade that will take place.
|
||||
ReadRegStr $OLDVERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayVersion"
|
||||
; Gets the older version then displays it in a message box
|
||||
MessageBox MB_OK|MB_ICONINFORMATION \
|
||||
"Welcome to ${APPNAMEANDVERSION} Setup.$\nThis will allow you to upgrade from version $OLDVERSION."
|
||||
SectionSetFlags ${Section2} 0x80 ; set bit 7
|
||||
SectionSetFlags ${Section3} 0x80 ; set bit 7
|
||||
SectionSetFlags ${Section4} 0x80 ; set bit 7
|
||||
SectionSetFlags ${Section5} 0x80 ; set bit 7
|
||||
Goto FinishCallback
|
||||
|
||||
VersionsAreEqual:
|
||||
ReadRegStr $UninstallString HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "UninstallString"
|
||||
IfFileExists "$UninstallString" "" FinishCallback
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION \
|
||||
"Setup detected ${APPNAMEANDVERSION} on your system. This is the same version that this program will install.$\nAre you trying to uninstall it?" \
|
||||
IDYES DoUninstall IDNO FinishCallback
|
||||
DoUninstall: ; You have the same version as this installer. This allows you to uninstall.
|
||||
Exec "$UninstallString"
|
||||
Quit
|
||||
|
||||
InstallerIsOlder:
|
||||
MessageBox MB_OK|MB_ICONSTOP \
|
||||
"You have a newer version of ${APPNAME}.$\nSetup will now exit."
|
||||
Quit
|
||||
|
||||
FinishCallback:
|
||||
ClearErrors
|
||||
Call CheckProcessorArchitecture
|
||||
Call CheckWindowsVersion
|
||||
FunctionEnd
|
||||
; eof
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
!define APPBITS 32 ; Define number of bits for the architecture
|
||||
!define EXTRA_VERSION "XP SP3 and newer"
|
||||
!define APPARCH "win32" ; Define the application architecture
|
||||
!define BINARY_DIR "${PATH_ROOT}objs\win32\Release"
|
||||
InstallDir "$PROGRAMFILES32\OpenTTD\"
|
||||
@@ -1,5 +0,0 @@
|
||||
!define APPBITS 64 ; Define number of bits for the architecture
|
||||
!define EXTRA_VERSION "XP and newer"
|
||||
!define APPARCH "win64" ; Define the application architecture
|
||||
!define BINARY_DIR "${PATH_ROOT}objs\x64\Release"
|
||||
InstallDir "$PROGRAMFILES64\OpenTTD\"
|
||||
@@ -1,5 +0,0 @@
|
||||
!define APPBITS 32 ; Define number of bits for the architecture
|
||||
!define EXTRA_VERSION "95, 98, ME, 2000 and XP SP2 or older"
|
||||
!define APPARCH "win9x" ; Define the application architecture
|
||||
!define BINARY_DIR "${PATH_ROOT}objs\release"
|
||||
InstallDir "$PROGRAMFILES32\OpenTTD\"
|
||||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 151 KiB |
BIN
os/windows/openttd.ico
Normal file
|
After Width: | Height: | Size: 39 KiB |
29
os/windows/openttd.manifest
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!--This Id value indicates the application supports Windows Vista functionality -->
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||
<!--This Id value indicates the application supports Windows 7 functionality-->
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||
<!--This Id value indicates the application supports Windows 8 functionality-->
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||
<!--This Id value indicates the application supports Windows 8.1 functionality-->
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<!--This Id value indicates the application supports Windows 10 functionality-->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
</application>
|
||||
</compatibility>
|
||||
</assembly>
|
||||