|
@@ -116,33 +116,30 @@ Section "!OpenTTD" Section1
|
|
|
; 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 data files
|
|
|
SetOutPath "$INSTDIR\data\"
|
|
|
File ${PATH_ROOT}bin\data\*.grf
|
|
|
File ${PATH_ROOT}bin\data\*.obg
|
|
|
File ${PATH_ROOT}bin\data\*.obs
|
|
|
File ${PATH_ROOT}bin\data\opntitle.dat
|
|
|
|
|
|
; Copy the music base metadata files
|
|
|
SetOutPath "$INSTDIR\gm\"
|
|
|
File ${PATH_ROOT}bin\gm\*.obm
|
|
|
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.txt"
|
|
|
Call unix2dos
|
|
|
|
|
|
; Copy some documention files
|
|
|
SetOutPath "$INSTDIR\docs\"
|
|
|
File ${PATH_ROOT}docs\multiplayer.txt
|
|
|
Push "$INSTDIR\docs\multiplayer.txt"
|
|
|
Call unix2dos
|
|
@@ -162,30 +159,48 @@ Section "!OpenTTD" Section1
|
|
|
Call unix2dos
|
|
|
File ${PATH_ROOT}readme.txt
|
|
|
Push "$INSTDIR\readme.txt"
|
|
|
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 data/ and lang/
|
|
|
; 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}"
|
|
@@ -215,56 +230,56 @@ Section "OpenTTD translations" Section6
|
|
|
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\data\opengfx.7z"
|
|
|
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\data\"
|
|
|
NSIS7z::Extract "$INSTDIR\data\opengfx.7z"
|
|
|
SetOutPath "$INSTDIR\baseset\"
|
|
|
NSIS7z::Extract "$INSTDIR\baseset\opengfx.7z"
|
|
|
|
|
|
Delete "$INSTDIR\data\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\data\opensfx.7z"
|
|
|
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\data\"
|
|
|
NSIS7z::Extract "$INSTDIR\data\opensfx.7z"
|
|
|
SetOutPath "$INSTDIR\baseset\"
|
|
|
NSIS7z::Extract "$INSTDIR\baseset\opensfx.7z"
|
|
|
|
|
|
Delete "$INSTDIR\data\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\gm\openmsx.7z"
|
|
|
Pop $R0 ;Get the return value
|
|
@@ -278,40 +293,39 @@ Section "Download OpenMSX (free music se
|
|
|
|
|
|
Delete "$INSTDIR\gm\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\gm"
|
|
|
CopyFiles "$CDDRIVE\gm\*.gm" "$INSTDIR\gm\" 1028
|
|
|
SetOutPath "$INSTDIR\data\"
|
|
|
CopyFiles "$CDDRIVE\sample.cat" "$INSTDIR\data\sample.cat" 1566
|
|
|
SetOutPath "$INSTDIR\baseset"
|
|
|
CopyFiles "$CDDRIVE\gm\*.gm" "$INSTDIR\baseset\" 1028
|
|
|
CopyFiles "$CDDRIVE\sample.cat" "$INSTDIR\baseset\sample.cat" 1566
|
|
|
; Copy Windows files
|
|
|
CopyFiles "$CDDRIVE\trg1r.grf" "$INSTDIR\data\trg1r.grf" 2365
|
|
|
CopyFiles "$CDDRIVE\trgcr.grf" "$INSTDIR\data\trgcr.grf" 260
|
|
|
CopyFiles "$CDDRIVE\trghr.grf" "$INSTDIR\data\trghr.grf" 400
|
|
|
CopyFiles "$CDDRIVE\trgir.grf" "$INSTDIR\data\trgir.grf" 334
|
|
|
CopyFiles "$CDDRIVE\trgtr.grf" "$INSTDIR\data\trgtr.grf" 546
|
|
|
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\data\trg1.grf" 2365
|
|
|
CopyFiles "$CDDRIVE\trgc.grf" "$INSTDIR\data\trgc.grf" 260
|
|
|
CopyFiles "$CDDRIVE\trgh.grf" "$INSTDIR\data\trgh.grf" 400
|
|
|
CopyFiles "$CDDRIVE\trgi.grf" "$INSTDIR\data\trgi.grf" 334
|
|
|
CopyFiles "$CDDRIVE\trgt.grf" "$INSTDIR\data\trgt.grf" 546
|
|
|
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."
|
|
@@ -379,91 +393,97 @@ Section "Uninstall"
|
|
|
Delete "$INSTDIR\COPYING"
|
|
|
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"
|
|
|
|
|
|
; Data files
|
|
|
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"
|
|
|
; Baseset files
|
|
|
Delete "$INSTDIR\baseset\opntitle.dat"
|
|
|
Delete "$INSTDIR\baseset\openttd.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"
|
|
|
|
|
|
Delete "$INSTDIR\data\sample.cat"
|
|
|
; Windows Data files
|
|
|
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"
|
|
|
; Dos Data files
|
|
|
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"
|
|
|
|
|
|
; Music
|
|
|
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\no_music.obm"
|
|
|
Delete "$INSTDIR\baseset\orig_win.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\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
|