os/win32/installer/install.nsi
author Darkvater
Tue, 27 Feb 2007 15:29:11 +0000
branch0.5
changeset 5453 61bfaa6036eb
parent 5449 b5b26de8e06a
child 5454 26572e97b611
permissions -rw-r--r--
(svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
     1
!define APPNAME "OpenTTD"   ; Define application name
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
     2
!define APPVERSION "0.5.0"  ; Define application version
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
     3
!define INSTALLERVERSION 28 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
     4
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
     5
!define APPURLLINK "http://www.openttd.org"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
     6
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
     7
!define APPVERSIONINTERNAL "${APPVERSION}.0" ; Needs to be of the format X.X.X.X
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
     8
1215
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
     9
!define MUI_ICON "..\..\..\openttd.ico"
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
    10
!define MUI_UNICON "..\..\..\openttd.ico"
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
    11
!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp"
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
    12
!define MUI_HEADERIMAGE
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
    13
!define MUI_HEADERIMAGE_BITMAP "top.bmp"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    14
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    15
BrandingText "OpenTTD Installer"
1215
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
    16
SetCompressor LZMA
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    17
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    18
; Version Info
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    19
Var AddWinPrePopulate
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    20
VIProductVersion "${APPVERSIONINTERNAL}"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    21
VIAddVersionKey "ProductName" "OpenTTD Installer"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    22
VIAddVersionKey "Comments" "Installs ${APPNAMEANDVERSION}"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    23
VIAddVersionKey "CompanyName" "OpenTTD Developers"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    24
VIAddVersionKey "FileDescription" "Installs ${APPNAMEANDVERSION}"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    25
VIAddVersionKey "ProductVersion" "${APPVERSION}"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    26
VIAddVersionKey "InternalName" "InstOpenTTD"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    27
VIAddVersionKey "FileVersion" "${APPVERSION}"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    28
VIAddVersionKey "LegalCopyright" " "
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    29
; Main Install settings
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    30
Name "${APPNAMEANDVERSION}"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    31
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    32
; NOTE: Keep trailing backslash!
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    33
InstallDir "$PROGRAMFILES\OpenTTD\"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    34
InstallDirRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Install Folder"
801
bfa47ec110b0 (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 254
diff changeset
    35
OutFile "openttd-${APPVERSION}-win32.exe"
1215
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
    36
CRCCheck force
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    37
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    38
ShowInstDetails show
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    39
ShowUninstDetails show
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    40
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    41
Var SHORTCUTS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    42
Var CDDRIVE
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    43
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    44
; Modern interface settings
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    45
!include "MUI.nsh"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    46
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    47
!define MUI_ABORTWARNING
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    48
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    49
!insertmacro MUI_PAGE_WELCOME
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    50
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    51
!define MUI_LICENSEPAGE_RADIOBUTTONS
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    52
!insertmacro MUI_DEFAULT MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT "I &accept this agreement"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    53
!insertmacro MUI_DEFAULT MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE "I &do not accept this agreement"
1215
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
    54
!insertmacro MUI_PAGE_LICENSE "..\..\..\COPYING"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    55
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    56
!insertmacro MUI_PAGE_COMPONENTS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    57
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    58
;---------------------------------
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    59
; Custom page for finding TTDLX CD
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    60
Page custom SelectCDEnter SelectCDExit ": TTD folder"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    61
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    62
!insertmacro MUI_PAGE_DIRECTORY
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    63
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    64
;Start Menu Folder Page Configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    65
!define MUI_STARTMENUPAGE_DEFAULTFOLDER $SHORTCUTS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    66
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKEY_LOCAL_MACHINE"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    67
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    68
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Shortcut Folder"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    69
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    70
!insertmacro MUI_PAGE_STARTMENU "OpenTTD" $SHORTCUTS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    71
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    72
!insertmacro MUI_PAGE_INSTFILES
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    73
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    74
;-----------------------------------------------------
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    75
; New custom page to show UNICODE and MSLU information
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    76
Page custom ShowWarningsPage
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    77
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    78
!define MUI_FINISHPAGE_RUN "$INSTDIR\openttd.exe"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    79
!define MUI_FINISHPAGE_LINK "Visit OpenTTD's homepage"
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    80
!define MUI_FINISHPAGE_LINK_LOCATION "${APPURLLINK}"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    81
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    82
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\readme.txt"
1821
6b13b0210b07 (svn r2325) - Update OpenTTD for 0.4.0 release
Darkvater
parents: 1215
diff changeset
    83
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    84
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    85
!insertmacro MUI_PAGE_FINISH
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    86
!insertmacro MUI_UNPAGE_CONFIRM
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    87
!insertmacro MUI_UNPAGE_INSTFILES
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    88
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    89
; Set languages (first is default language)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    90
!insertmacro MUI_LANGUAGE "English"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    91
!insertmacro MUI_RESERVEFILE_LANGDLL
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    92
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    93
;--------------------------------------------------------------
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    94
; (Core) OpenTTD install section. Copies all internal game data
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    95
Section "!OpenTTD" Section1
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
    96
	; Overwrite files by default, but don't complain on failure
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    97
	SetOverwrite try
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    98
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    99
	; Make savegame folder
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   100
	SetOutPath "$INSTDIR\save"
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   101
	; Define root variable relative to installer
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   102
	!define PATH_ROOT "..\..\..\"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   103
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   104
	; Copy language files
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   105
	SetOutPath "$INSTDIR\lang\"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   106
	File ${PATH_ROOT}lang\*.lng
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   107
	File ${PATH_ROOT}lang\english.txt
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   108
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   109
	; Copy data files
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   110
	SetOutPath "$INSTDIR\data\"
1166
18a43f099e76 (svn r1668) -Fixed windows installer (autorail.grf) and a changelog typo
darkvater
parents: 1157
diff changeset
   111
	File ${PATH_ROOT}data\*.grf
18a43f099e76 (svn r1668) -Fixed windows installer (autorail.grf) and a changelog typo
darkvater
parents: 1157
diff changeset
   112
	File ${PATH_ROOT}data\opntitle.dat
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   113
	; Copy scenario files (don't choke if they don't exist)
1157
5cbea454ba1c (svn r1658) -Update readme and windows installer for 0.3.6
darkvater
parents: 801
diff changeset
   114
	SetOutPath "$INSTDIR\scenario\"
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   115
	File /nonfatal ${PATH_ROOT}scenario\*.scn
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   116
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   117
	; Copy the rest of the stuff
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   118
	SetOutPath "$INSTDIR\"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   119
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   120
	; Copy text files
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   121
	File ${PATH_ROOT}changelog.txt
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   122
	File ${PATH_ROOT}COPYING
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   123
	File ${PATH_ROOT}readme.txt
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   124
	File ${PATH_ROOT}known-bugs.txt
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   125
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   126
	; Copy executable
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   127
	File /oname=openttd.exe ${PATH_ROOT}Release\openttd.exe
1157
5cbea454ba1c (svn r1658) -Update readme and windows installer for 0.3.6
darkvater
parents: 801
diff changeset
   128
	File ${PATH_ROOT}strgen\Debug\strgen.exe
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   129
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   130
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   131
	; Delete old files from the main dir. they are now placed in data/ and lang/
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   132
	Delete "$INSTDIR\*.lng"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   133
	Delete "$INSTDIR\*.grf"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   134
	Delete "$INSTDIR\sample.cat"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   135
	Delete "$INSTDIR\ttd.exe"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   136
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   137
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   138
	; Create the Registry Entries
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   139
	WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Comments" "Visit ${APPURLLINK}"
1215
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
   140
	WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayIcon" "$INSTDIR\openttd.exe,0"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   141
	WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayName" "OpenTTD ${APPVERSION}"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   142
	WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayVersion" "${APPVERSION}"
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   143
	WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "HelpLink" "${APPURLLINK}"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   144
	WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Install Folder" "$INSTDIR"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   145
	WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Publisher" "OpenTTD"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   146
	WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Shortcut Folder" "$SHORTCUTS"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   147
	WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "UninstallString" "$INSTDIR\uninstall.exe"
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   148
	WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "URLInfoAbout" "${APPURLLINK}"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   149
	; This key sets the Version DWORD that new installers will check against
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   150
	WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Version" ${INSTALLERVERSION}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   151
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   152
	!insertmacro MUI_STARTMENU_WRITE_BEGIN "OpenTTD"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   153
	CreateShortCut "$DESKTOP\OpenTTD.lnk" "$INSTDIR\openttd.exe"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   154
	CreateDirectory "$SMPROGRAMS\$SHORTCUTS"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   155
	CreateShortCut "$SMPROGRAMS\$SHORTCUTS\OpenTTD.lnk" "$INSTDIR\openttd.exe"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   156
	CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Uninstall.lnk" "$INSTDIR\uninstall.exe"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   157
	CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Readme.lnk" "$INSTDIR\Readme.txt"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   158
	CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Changelog.lnk" "$INSTDIR\Changelog.txt"
801
bfa47ec110b0 (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 254
diff changeset
   159
	CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Known-bugs.lnk" "$INSTDIR\known-bugs.txt"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   160
	!insertmacro MUI_STARTMENU_WRITE_END
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   161
SectionEnd
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   162
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   163
;----------------------------------------------------------------------------------
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   164
; TTDLX files install section. Copies all needed TTDLX files from CD or install dir
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   165
Section "Copy Game Graphics" Section2
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   166
	; Let's copy the files with size approximation
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   167
	SetOutPath "$INSTDIR\gm"
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   168
	CopyFiles "$CDDRIVE\gm\*.gm" "$INSTDIR\gm\" 1028
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   169
	SetOutPath "$INSTDIR\data\"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   170
	CopyFiles "$CDDRIVE\sample.cat" "$INSTDIR\data\sample.cat" 1566
5449
b5b26de8e06a (svn r8905) [0.5] -Update readme's, bugs, installers, changelogs etc. to prepare for 0.5.0.
Darkvater
parents: 5435
diff changeset
   171
	; Copy Windows files
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   172
	CopyFiles "$CDDRIVE\trg1r.grf" "$INSTDIR\data\trg1r.grf" 2365
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   173
	CopyFiles "$CDDRIVE\trgcr.grf" "$INSTDIR\data\trgcr.grf" 260
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   174
	CopyFiles "$CDDRIVE\trghr.grf" "$INSTDIR\data\trghr.grf" 400
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   175
	CopyFiles "$CDDRIVE\trgir.grf" "$INSTDIR\data\trgir.grf" 334
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   176
	CopyFiles "$CDDRIVE\trgtr.grf" "$INSTDIR\data\trgtr.grf" 546
1215
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
   177
	; Copy DOS files
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
   178
	CopyFiles "$CDDRIVE\trg1.grf" "$INSTDIR\data\trg1.grf" 2365
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
   179
	CopyFiles "$CDDRIVE\trgc.grf" "$INSTDIR\data\trgc.grf" 260
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
   180
	CopyFiles "$CDDRIVE\trgh.grf" "$INSTDIR\data\trgh.grf" 400
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
   181
	CopyFiles "$CDDRIVE\trgi.grf" "$INSTDIR\data\trgi.grf" 334
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
   182
	CopyFiles "$CDDRIVE\trgt.grf" "$INSTDIR\data\trgt.grf" 546
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   183
	SetOutPath "$INSTDIR\"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   184
SectionEnd
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   185
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   186
;-------------------------------------------
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   187
; Install the uninstaller (option is hidden)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   188
Section -FinishSection
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   189
	WriteUninstaller "$INSTDIR\uninstall.exe"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   190
SectionEnd
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   191
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   192
; Modern install component descriptions
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   193
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   194
	!insertmacro MUI_DESCRIPTION_TEXT ${Section1} "OpenTTD is a fully functional clone of TTD and is very playable."
5449
b5b26de8e06a (svn r8905) [0.5] -Update readme's, bugs, installers, changelogs etc. to prepare for 0.5.0.
Darkvater
parents: 5435
diff changeset
   195
	!insertmacro MUI_DESCRIPTION_TEXT ${Section2} "Copies the game graphics. Requires TTD (for Windows)."
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   196
!insertmacro MUI_FUNCTION_DESCRIPTION_END
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   197
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   198
;-----------------------------------------------
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   199
; Uninstall section, deletes all installed files
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   200
Section "Uninstall"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   201
	MessageBox MB_YESNO|MB_ICONQUESTION \
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   202
		"Remove the save game folders located at $\"$INSTDIR\save?$\"$\n \
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   203
		If you choose Yes, your saved games will be deleted." \
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   204
		IDYES RemoveSavedGames IDNO NoRemoveSavedGames
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   205
	RemoveSavedGames:
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   206
		Delete "$INSTDIR\save\autosave\*"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   207
		RMDir "$INSTDIR\save\autosave"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   208
		Delete "$INSTDIR\save\*"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   209
		RMDir "$INSTDIR\save"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   210
	NoRemoveSavedGames:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   211
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   212
	MessageBox MB_YESNO|MB_ICONQUESTION \
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   213
		"Remove the scenario folders located at $\"$INSTDIR\scenario?$\"$\n \
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   214
		If you choose Yes, your scenarios will be deleted." \
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   215
		IDYES RemoveScen IDNO NoRemoveScen
31
85a8c911441c (svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents: 0
diff changeset
   216
	RemoveScen:
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   217
		Delete "$INSTDIR\scenario\*"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   218
		RMDir "$INSTDIR\scenario"
31
85a8c911441c (svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents: 0
diff changeset
   219
	NoRemoveScen:
85a8c911441c (svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents: 0
diff changeset
   220
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   221
	; Remove from registry...
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   222
	!insertmacro MUI_STARTMENU_GETFOLDER "OpenTTD" $SHORTCUTS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   223
	ReadRegStr $SHORTCUTS HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Shortcut Folder"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   224
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   225
	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   226
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   227
	; Delete self
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   228
	Delete "$INSTDIR\uninstall.exe"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   229
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   230
	; Delete Shortcuts
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   231
	Delete "$DESKTOP\OpenTTD.lnk"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   232
	Delete "$SMPROGRAMS\$SHORTCUTS\OpenTTD.lnk"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   233
	Delete "$SMPROGRAMS\$SHORTCUTS\Uninstall.lnk"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   234
	Delete "$SMPROGRAMS\$SHORTCUTS\Readme.lnk"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   235
	Delete "$SMPROGRAMS\$SHORTCUTS\Changelog.lnk"
801
bfa47ec110b0 (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 254
diff changeset
   236
	Delete "$SMPROGRAMS\$SHORTCUTS\Known-bugs.lnk"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   237
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   238
	; Clean up OpenTTD dir
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   239
	Delete "$INSTDIR\changelog.txt"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   240
	Delete "$INSTDIR\readme.txt"
801
bfa47ec110b0 (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 254
diff changeset
   241
	Delete "$INSTDIR\known-bugs.txt"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   242
	Delete "$INSTDIR\openttd.exe"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   243
	Delete "$INSTDIR\strgen.exe"
250
733e18ca6e93 (svn r251) -Project ready for 0.3.4 release. Updated installer, readme and fileinformation
darkvater
parents: 32
diff changeset
   244
	Delete "$INSTDIR\COPYING"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   245
	Delete "$INSTDIR\INSTALL.LOG"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   246
	Delete "$INSTDIR\crash.log"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   247
	Delete "$INSTDIR\openttd.cfg"
1166
18a43f099e76 (svn r1668) -Fixed windows installer (autorail.grf) and a changelog typo
darkvater
parents: 1157
diff changeset
   248
	Delete "$INSTDIR\hs.dat"
1841
b41b821d9a23 (svn r2346) - Fix: Have the windows installer also delete any spritecache.xx files on uninstall
Darkvater
parents: 1821
diff changeset
   249
	Delete "$INSTDIR\cached_sprites.*"
801
bfa47ec110b0 (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 254
diff changeset
   250
	Delete "$INSTDIR\save\autosave\network*.tmp" ; temporary network file
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   251
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   252
	; Data files
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   253
	Delete "$INSTDIR\data\opntitle.dat"
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   254
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   255
	Delete "$INSTDIR\data\2ccmap.grf"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   256
	Delete "$INSTDIR\data\airports.grf"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   257
	Delete "$INSTDIR\data\autorail.grf"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   258
	Delete "$INSTDIR\data\canalsw.grf"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   259
	Delete "$INSTDIR\data\dosdummy.grf"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   260
	Delete "$INSTDIR\data\elrailsw.grf"
2946
576b2836633c (svn r3502) - Update appropiate files with release information for 0.4.5
Darkvater
parents: 1848
diff changeset
   261
	Delete "$INSTDIR\data\nsignalsw.grf"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   262
	Delete "$INSTDIR\data\openttd.grf"
250
733e18ca6e93 (svn r251) -Project ready for 0.3.4 release. Updated installer, readme and fileinformation
darkvater
parents: 32
diff changeset
   263
	Delete "$INSTDIR\data\trkfoundw.grf"
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   264
1215
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
   265
	Delete "$INSTDIR\data\sample.cat"
5449
b5b26de8e06a (svn r8905) [0.5] -Update readme's, bugs, installers, changelogs etc. to prepare for 0.5.0.
Darkvater
parents: 5435
diff changeset
   266
	; Windows Data files
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   267
	Delete "$INSTDIR\data\trg1r.grf"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   268
	Delete "$INSTDIR\data\trghr.grf"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   269
	Delete "$INSTDIR\data\trgtr.grf"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   270
	Delete "$INSTDIR\data\trgcr.grf"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   271
	Delete "$INSTDIR\data\trgir.grf"
1215
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
   272
	; Dos Data files
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
   273
	Delete "$INSTDIR\data\trg1.grf"
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
   274
	Delete "$INSTDIR\data\trgh.grf"
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
   275
	Delete "$INSTDIR\data\trgt.grf"
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
   276
	Delete "$INSTDIR\data\trgc.grf"
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
   277
	Delete "$INSTDIR\data\trgi.grf"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   278
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   279
	; Music
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   280
	Delete "$INSTDIR\gm\*.gm"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   281
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   282
	; Language files
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   283
	Delete "$INSTDIR\lang\*.lng"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   284
	Delete "$INSTDIR\lang\english.txt"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   285
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   286
	; Remove remaining directories
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   287
	RMDir "$SMPROGRAMS\$SHORTCUTS\Extras\"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   288
	RMDir "$SMPROGRAMS\$SHORTCUTS"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   289
	RMDir "$INSTDIR\gm"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   290
	RMDir "$INSTDIR\lang"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   291
	RMDir "$INSTDIR\data"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   292
	RMDir "$INSTDIR"
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   293
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   294
SectionEnd
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   295
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   296
;------------------------------------------------------------
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   297
; Custom page function to find the TTDLX CD/install location
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   298
Function SelectCDEnter
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   299
	SectionGetFlags ${Section2} $0
801
bfa47ec110b0 (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 254
diff changeset
   300
	IntOp $1 $0 & 0x80 ; bit 7 set by upgrade, no need to copy files
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   301
	IntCmp $1 1 DoneCD ; Upgrade doesn't need copy files
1215
6c2fe2311e52 (svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents: 1166
diff changeset
   302
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   303
	IntOp $0 $0 & 1
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   304
	IntCmp $0 1 NoAbort
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   305
	Abort
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   306
NoAbort:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   307
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   308
	GetTempFileName $R0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   309
	!insertmacro MUI_HEADER_TEXT "Locate TTD" "Setup needs the location of Transport Tycoon Deluxe in order to continue."
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   310
	!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "CDFinder.ini" "CDFinder"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   311
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   312
	ClearErrors
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   313
	; Now, let's populate $CDDRIVE
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   314
	ReadRegStr $CDDRIVE HKLM "SOFTWARE\Fish Technology Group\Transport Tycoon Deluxe" "HDPath"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   315
	IfErrors NoTTD
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   316
	StrCpy $AddWinPrePopulate "Setup has detected your TTD folder. Don't change the folder. Simply press Next."
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   317
	!insertmacro MUI_INSTALLOPTIONS_WRITE "CDFinder" "Field 2" "State" $CDDRIVE          ; TTDLX path
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   318
	Goto TruFinish
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   319
NoTTD:
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   320
	StrCpy $AddWinPrePopulate "Setup couldn't find TTD. Please enter the path where the graphics files from TTD are stored and press Next to continue."
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   321
TruFinish:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   322
	ClearErrors
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   323
	!insertmacro MUI_INSTALLOPTIONS_WRITE "CDFinder" "Field 3" "Text" $AddWinPrePopulate ; Caption
801
bfa47ec110b0 (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 254
diff changeset
   324
DoneCD:
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   325
	; Initialize the dialog *AFTER* we've changed the text otherwise we won't see the changes
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   326
	!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "CDFinder"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   327
	!insertmacro MUI_INSTALLOPTIONS_SHOW
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   328
FunctionEnd
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   329
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   330
;----------------------------------------------------------------
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   331
; Custom page function when 'next' is selected for the TTDLX path
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   332
Function SelectCDExit
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   333
	!insertmacro MUI_INSTALLOPTIONS_READ $CDDRIVE "CDFinder" "Field 2" "State"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   334
	; If trg1r.grf does not exist at the path, retry with DOS version
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   335
	IfFileExists $CDDRIVE\trg1r.grf "" DosCD
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   336
	IfFileExists $CDDRIVE\trgir.grf "" NoCD
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   337
	IfFileExists $CDDRIVE\sample.cat hasCD NoCD
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   338
DosCD:
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   339
	IfFileExists $CDDRIVE\TRG1.GRF "" NoCD
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   340
	IfFileExists $CDDRIVE\TRGI.GRF "" NoCD
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   341
	IfFileExists $CDDRIVE\SAMPLE.CAT hasCD NoCD
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   342
NoCD:
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   343
	MessageBox MB_OK "Setup cannot continue without the Transport Tycoon Deluxe Location!"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   344
	Abort
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   345
hasCD:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   346
FunctionEnd
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   347
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   348
;---------------------------------------------------------------------
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   349
; Custom page function to show notices for running OpenTTD
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   350
; We have extracted this custom page as Notice in the .onInit function
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   351
Function ShowWarningsPage
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   352
	!insertmacro MUI_HEADER_TEXT "Installation Complete" "Important notices for OpenTTD usage."
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   353
	!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "notice.ini" "Notice"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   354
	!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "Notice"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   355
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   356
	Call GetWindowsVersion
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   357
	Pop $R0
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   358
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   359
	; Hide the MSLU text if the installer is not run on Win9x systems
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   360
	StrCmp $R0 "winnt" 0 Win9x
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   361
	!insertmacro MUI_INSTALLOPTIONS_READ $R1 "Notice" "Field 1" "HWND" ; MSLU groupbox
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   362
	ShowWindow $R1 0
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   363
	!insertmacro MUI_INSTALLOPTIONS_READ $R1 "Notice" "Field 2" "HWND" ; MSLU text
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   364
	ShowWindow $R1 0
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   365
	!insertmacro MUI_INSTALLOPTIONS_READ $R1 "Notice" "Field 3" "HWND" ; MSLU link
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   366
	ShowWindow $R1 0
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   367
Win9x:
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   368
	ClearErrors
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   369
	!insertmacro MUI_INSTALLOPTIONS_SHOW
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   370
FunctionEnd
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   371
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   372
;-------------------------------------------------------------------------------
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   373
; Determine windows version, returns "win9x" if Win9x/Me or "winnt" on the stack
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   374
Function GetWindowsVersion
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   375
	ClearErrors
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   376
	StrCpy $R0 "winnt"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   377
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   378
	ReadRegStr $R1 HKLM "SOFTWARE\MICROSOFT\WINDOWS NT\CurrentVersion" CurrentVersion
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   379
	IfErrors 0 WinNT
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   380
	StrCpy $R0 "win9x"
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   381
WinNT:
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   382
	ClearErrors
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   383
	Push $R0
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   384
FunctionEnd
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   385
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   386
Var OLDVERSION
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   387
Var UninstallString
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   388
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   389
;-----------------------------------------------------------------------------------
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   390
; NSIS Initialize function, determin if we are going to install/upgrade or uninstall
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   391
Function .onInit
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   392
	StrCpy $SHORTCUTS "OpenTTD"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   393
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   394
	SectionSetFlags 0 17
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   395
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   396
	; Starts Setup - let's look for an older version of OpenTTD
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   397
	ReadRegDWORD $R8 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Version"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   398
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   399
	IfErrors ShowWelcomeMessage ShowUpgradeMessage
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   400
ShowWelcomeMessage:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   401
	ReadRegStr $R8 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Version"
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   402
	; In the event someone still has OpenTTD 0.1, this will detect that (that installer used a string instead of dword entry)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   403
	IfErrors FinishCallback
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   404
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   405
ShowUpgradeMessage:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   406
	IntCmp ${INSTALLERVERSION} $R8 VersionsAreEqual InstallerIsOlder  WelcomeToSetup
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   407
WelcomeToSetup:
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   408
	; An older version was found.  Let's let the user know there's an upgrade that will take place.
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   409
	ReadRegStr $OLDVERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayVersion"
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   410
	; Gets the older version then displays it in a message box
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   411
	MessageBox MB_OK|MB_ICONINFORMATION \
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   412
		"Welcome to ${APPNAMEANDVERSION} Setup.$\n \
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   413
		This will allow you to upgrade from version $OLDVERSION."
801
bfa47ec110b0 (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 254
diff changeset
   414
	SectionSetFlags ${Section2} 0x80 ; set bit 7
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   415
	Goto FinishCallback
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   416
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   417
VersionsAreEqual:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   418
	ReadRegStr $UninstallString HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "UninstallString"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   419
	IfFileExists "$UninstallString" "" FinishCallback
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   420
	MessageBox MB_YESNO|MB_ICONQUESTION \
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   421
		"Setup detected ${APPNAMEANDVERSION} on your system. That's the version this program will install.$\n \
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   422
		Are you trying to uninstall it?" \
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   423
		IDYES DoUninstall IDNO FinishCallback
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   424
DoUninstall: ; You have the same version as this installer.  This allows you to uninstall.
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   425
	Exec "$UninstallString"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   426
	Quit
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   427
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   428
InstallerIsOlder:
5453
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   429
	MessageBox MB_OK|MB_ICONSTOP \
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   430
		"You have a newer version of ${APPNAME}.$\n \
61bfaa6036eb (svn r8916) [0.5] -Codechange (win32): Update the installer, add proper indentation, use MUI throughout and add a custom page about UNICODE and MSLU (remove some obsolete files)
Darkvater
parents: 5449
diff changeset
   431
		Setup will now exit."
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   432
	Quit
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   433
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   434
FinishCallback:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   435
	ClearErrors
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   436
FunctionEnd
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   437
; eof
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   438