Changeset - r22890:7221eb475acb
[Not reviewed]
master
0 1 0
Niels Martin Hansen - 6 years ago 2018-03-21 17:29:30
nielsm@indvikleren.dk
Update: Install DOS music data in Windows installer
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
os/windows/installer/install.nsi
Show inline comments
 
@@ -259,96 +259,97 @@ SectionEnd
 
; OpenSFX files install section. Downloads OpenSFX and installs it
 
Section "Download OpenSFX (free sound set)" Section4
 
	SetOverwrite try
 

	
 
	NSISdl::download "http://binaries.openttd.org/installer/opensfx-${OPENSFX_BASE_VERSION}.7z" "$INSTDIR\baseset\opensfx.7z"
 
	Pop $R0 ;Get the return value
 
	StrCmp $R0 "success" +3
 
		MessageBox MB_OK "Downloading of OpenSFX failed"
 
		Goto Done
 

	
 
	; Let's extract the files
 
	SetOutPath "$INSTDIR\baseset\"
 
	NSIS7z::Extract "$INSTDIR\baseset\opensfx.7z"
 

	
 
	Delete "$INSTDIR\baseset\opensfx.7z"
 
	SetOutPath "$INSTDIR\"
 
Done:
 

	
 
SectionEnd
 

	
 
;----------------------------------------------------------------------------------
 
; OpenMSX files install section. Downloads OpenMSX and installs it
 
Section "Download OpenMSX (free music set)" Section5
 
	SetOverwrite try
 

	
 
	NSISdl::download "http://binaries.openttd.org/installer/openmsx-${OPENMSX_BASE_VERSION}.7z" "$INSTDIR\baseset\openmsx.7z"
 
	Pop $R0 ;Get the return value
 
	StrCmp $R0 "success" +3
 
		MessageBox MB_OK "Downloading of OpenMSX failed"
 
		Goto Done
 

	
 
	; Let's extract the files
 
	SetOutPath "$INSTDIR\baseset\"
 
	NSIS7z::Extract "$INSTDIR\baseset\openmsx.7z"
 

	
 
	Delete "$INSTDIR\baseset\openmsx.7z"
 
	SetOutPath "$INSTDIR\"
 
Done:
 

	
 
SectionEnd
 

	
 
;----------------------------------------------------------------------------------
 
; TTDLX files install section. Copies all needed TTDLX files from CD or install dir
 
Section /o "Copy data from Transport Tycoon Deluxe CD-ROM" Section2
 
	SetOverwrite try
 
	; Let's copy the files with size approximation
 
	SetOutPath "$INSTDIR\baseset"
 
	CopyFiles "$CDDRIVE\gm\*.gm" "$INSTDIR\baseset\" 1028
 
	CopyFiles "$CDDRIVE\gm.cat" "$INSTDIR\baseset\gm.cat" 415
 
	CopyFiles "$CDDRIVE\sample.cat" "$INSTDIR\baseset\sample.cat" 1566
 
	; Copy Windows files
 
	CopyFiles "$CDDRIVE\trg1r.grf" "$INSTDIR\baseset\trg1r.grf" 2365
 
	CopyFiles "$CDDRIVE\trgcr.grf" "$INSTDIR\baseset\trgcr.grf" 260
 
	CopyFiles "$CDDRIVE\trghr.grf" "$INSTDIR\baseset\trghr.grf" 400
 
	CopyFiles "$CDDRIVE\trgir.grf" "$INSTDIR\baseset\trgir.grf" 334
 
	CopyFiles "$CDDRIVE\trgtr.grf" "$INSTDIR\baseset\trgtr.grf" 546
 
	; Copy DOS files
 
	CopyFiles "$CDDRIVE\trg1.grf" "$INSTDIR\baseset\trg1.grf" 2365
 
	CopyFiles "$CDDRIVE\trgc.grf" "$INSTDIR\baseset\trgc.grf" 260
 
	CopyFiles "$CDDRIVE\trgh.grf" "$INSTDIR\baseset\trgh.grf" 400
 
	CopyFiles "$CDDRIVE\trgi.grf" "$INSTDIR\baseset\trgi.grf" 334
 
	CopyFiles "$CDDRIVE\trgt.grf" "$INSTDIR\baseset\trgt.grf" 546
 
	SetOutPath "$INSTDIR\"
 
SectionEnd
 

	
 
;-------------------------------------------
 
; Install the uninstaller (option is hidden)
 
Section -FinishSection
 
	WriteUninstaller "$INSTDIR\uninstall.exe"
 
SectionEnd
 

	
 
; Modern install component descriptions
 
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
 
	!insertmacro MUI_DESCRIPTION_TEXT ${Section1} "Minimal OpenTTD installation in English. You need at least one of the game graphics and sound sets installed."
 
	!insertmacro MUI_DESCRIPTION_TEXT ${Section6} "Translations of OpenTTD."
 
	!insertmacro MUI_DESCRIPTION_TEXT ${Section3} "Download the free OpenGFX game graphics set. This download is about 3 MiB."
 
	!insertmacro MUI_DESCRIPTION_TEXT ${Section4} "Download the free OpenSFX game sound set. This download is about 10 MiB."
 
	!insertmacro MUI_DESCRIPTION_TEXT ${Section5} "Download the free OpenMSX game music set. This download is about 200 KiB."
 
	!insertmacro MUI_DESCRIPTION_TEXT ${Section2} "Copies the game graphics, sounds and music from the Transport Tycoon Deluxe CD."
 
!insertmacro MUI_FUNCTION_DESCRIPTION_END
 

	
 
;-----------------------------------------------
 
; Uninstall section, deletes all installed files
 
Section "Uninstall"
 
	SetShellVarContext all
 

	
 
	IfFileExists "$INSTDIR\save" 0 NoRemoveSavedGames
 
	MessageBox MB_YESNO|MB_ICONQUESTION \
 
		"Remove the save game folders located at $\"$INSTDIR\save$\"?$\n \
 
		If you choose Yes, your saved games will be deleted." \
 
		IDYES RemoveSavedGames IDNO NoRemoveSavedGames
 
	RemoveSavedGames:
 
		Delete "$INSTDIR\save\autosave\*"
 
		RMDir "$INSTDIR\save\autosave"
 
		Delete "$INSTDIR\save\*"
 
		RMDir "$INSTDIR\save"
 
	NoRemoveSavedGames:
 
@@ -381,139 +382,143 @@ Section "Uninstall"
 
	Delete "$SMPROGRAMS\$SHORTCUTS\Readme.lnk"
 
	Delete "$SMPROGRAMS\$SHORTCUTS\Changelog.lnk"
 
	Delete "$SMPROGRAMS\$SHORTCUTS\Known-bugs.lnk"
 
	Delete "$SMPROGRAMS\$SHORTCUTS\Docs\Multiplayer.lnk"
 
	Delete "$SMPROGRAMS\$SHORTCUTS\Docs\32bpp.lnk"
 
	Delete "$SMPROGRAMS\$SHORTCUTS\Scripts\Readme.lnk"
 

	
 
	; Clean up OpenTTD dir
 
	Delete "$INSTDIR\changelog.txt"
 
	Delete "$INSTDIR\README.md"
 
	Delete "$INSTDIR\known-bugs.txt"
 
	Delete "$INSTDIR\openttd.exe"
 
	Delete "$INSTDIR\COPYING"
 
	Delete "$INSTDIR\INSTALL.LOG"
 
	Delete "$INSTDIR\crash.log"
 
	Delete "$INSTDIR\crash.dmp"
 
	Delete "$INSTDIR\openttd.cfg"
 
	Delete "$INSTDIR\hs.dat"
 
	Delete "$INSTDIR\cached_sprites.*"
 
	Delete "$INSTDIR\save\autosave\network*.tmp" ; temporary network file
 

	
 
	; AI files
 
	Delete "$INSTDIR\ai\compat_*.nut"
 

	
 
	; Game Script files
 
	Delete "$INSTDIR\game\compat_*.nut"
 

	
 
	; Baseset files
 
	Delete "$INSTDIR\baseset\opntitle.dat"
 
	Delete "$INSTDIR\baseset\openttd.grf"
 
	Delete "$INSTDIR\baseset\orig_extra.grf"
 
	Delete "$INSTDIR\baseset\orig_win.obg"
 
	Delete "$INSTDIR\baseset\orig_dos.obg"
 
	Delete "$INSTDIR\baseset\orig_dos_de.obg"
 
	Delete "$INSTDIR\baseset\orig_win.obs"
 
	Delete "$INSTDIR\baseset\orig_dos.obs"
 
	Delete "$INSTDIR\baseset\no_sound.obs"
 
	Delete "$INSTDIR\baseset\sample.cat"
 
	Delete "$INSTDIR\baseset\trg1r.grf"
 
	Delete "$INSTDIR\baseset\trghr.grf"
 
	Delete "$INSTDIR\baseset\trgtr.grf"
 
	Delete "$INSTDIR\baseset\trgcr.grf"
 
	Delete "$INSTDIR\baseset\trgir.grf"
 
	Delete "$INSTDIR\baseset\trg1.grf"
 
	Delete "$INSTDIR\baseset\trgh.grf"
 
	Delete "$INSTDIR\baseset\trgt.grf"
 
	Delete "$INSTDIR\baseset\trgc.grf"
 
	Delete "$INSTDIR\baseset\trgi.grf"
 
	Delete "$INSTDIR\baseset\gm.cat"
 
	Delete "$INSTDIR\baseset\gm-tto.cat"
 
	Delete "$INSTDIR\baseset\*.gm"
 

	
 
	Delete "$INSTDIR\data\sample.cat"
 
	Delete "$INSTDIR\data\trg1r.grf"
 
	Delete "$INSTDIR\data\trghr.grf"
 
	Delete "$INSTDIR\data\trgtr.grf"
 
	Delete "$INSTDIR\data\trgcr.grf"
 
	Delete "$INSTDIR\data\trgir.grf"
 
	Delete "$INSTDIR\data\trg1.grf"
 
	Delete "$INSTDIR\data\trgh.grf"
 
	Delete "$INSTDIR\data\trgt.grf"
 
	Delete "$INSTDIR\data\trgc.grf"
 
	Delete "$INSTDIR\data\trgi.grf"
 
	Delete "$INSTDIR\gm\*.gm"
 

	
 
	; Downloaded OpenGFX/OpenSFX/OpenMSX
 
	Delete "$INSTDIR\baseset\opengfx\*"
 
	RMDir  "$INSTDIR\baseset\opengfx"
 
	Delete "$INSTDIR\baseset\opensfx\*"
 
	RMDir  "$INSTDIR\baseset\opensfx"
 
	Delete "$INSTDIR\baseset\openmsx\*"
 
	RMDir  "$INSTDIR\baseset\openmsx"
 

	
 
	Delete "$INSTDIR\data\opengfx\*"
 
	RMDir  "$INSTDIR\data\opengfx"
 
	Delete "$INSTDIR\data\opensfx\*"
 
	RMDir  "$INSTDIR\data\opensfx"
 
	Delete "$INSTDIR\gm\openmsx\*"
 
	RMDir  "$INSTDIR\gm\openmsx"
 

	
 
	; Language files
 
	Delete "$INSTDIR\lang\*.lng"
 

	
 
	; Scripts
 
	Delete "$INSTDIR\scripts\*.*"
 

	
 
	; Documentation
 
	Delete "$INSTDIR\docs\*.*"
 

	
 
	; Base sets for music
 
	Delete "$INSTDIR\gm\orig_win.obm"
 
	Delete "$INSTDIR\gm\orig_dos.obm"
 
	Delete "$INSTDIR\gm\no_music.obm"
 
	Delete "$INSTDIR\baseset\orig_win.obm"
 
	Delete "$INSTDIR\baseset\orig_dos.obm"
 
	Delete "$INSTDIR\baseset\no_music.obm"
 

	
 
	; Remove remaining directories
 
	RMDir "$SMPROGRAMS\$SHORTCUTS\Extras\"
 
	RMDir "$SMPROGRAMS\$SHORTCUTS\Scripts\"
 
	RMDir "$SMPROGRAMS\$SHORTCUTS\Docs\"
 
	RMDir "$SMPROGRAMS\$SHORTCUTS"
 
	RMDir "$INSTDIR\ai"
 
	RMDir "$INSTDIR\game"
 
	RMDir "$INSTDIR\data"
 
	RMDir "$INSTDIR\baseset"
 
	RMDir "$INSTDIR\gm"
 
	RMDir "$INSTDIR\lang"
 
	RMDir "$INSTDIR\scripts"
 
	RMDir "$INSTDIR\docs"
 
	RMDir "$INSTDIR"
 

	
 
SectionEnd
 

	
 
;------------------------------------------------------------
 
; Custom page function to find the TTDLX CD/install location
 
Function SelectCDEnter
 
	SectionGetFlags ${Section2} $0
 
	IntOp $1 $0 & 0x80 ; bit 7 set by upgrade, no need to copy files
 
	IntCmp $1 1 DoneCD ; Upgrade doesn't need copy files
 

	
 
	IntOp $0 $0 & 1
 
	IntCmp $0 1 NoAbort
 
	Abort
 
NoAbort:
 

	
 
	GetTempFileName $R0
 
	!insertmacro MUI_HEADER_TEXT "Locate TTD" "Setup needs the location of Transport Tycoon Deluxe in order to continue."
 
	!insertmacro INSTALLOPTIONS_EXTRACT_AS "CDFinder.ini" "CDFinder"
 

	
 
	ClearErrors
 
	; Now, let's populate $CDDRIVE
 
	ReadRegStr $R0 HKLM "SOFTWARE\Fish Technology Group\Transport Tycoon Deluxe" "HDPath"
 
	IfErrors NoTTD
 
	StrCmp $CDDRIVE "" 0 Populated
 
	StrCpy $CDDRIVE $R0
 
Populated:
 
	StrCpy $AddWinPrePopulate "Setup has detected your TTD folder. Don't change the folder. Simply press Next."
 
	Goto TruFinish
 
NoTTD:
 
	StrCpy $AddWinPrePopulate "Setup couldn't find TTD. Please enter the path where the graphics files from TTD are stored and press Next to continue."
 
TruFinish:
 
	ClearErrors
0 comments (0 inline, 0 general)