2012-08-12 15:38:20 +00:00
####################################################
# Wolfenstein Enemy Territory - Legacy Project #
# Auto-generated by EclipseNSIS Script Wizard #
####################################################
Name "Wolfenstein ET: Legacy"
2012-10-26 08:46:19 +00:00
# FIXME/TODO
#
2012-10-26 12:28:29 +00:00
# add etlded to windows menu (done/feedback)
2012-10-26 08:46:19 +00:00
# rename this "ET: L" in installer options to ET:Legacy V2.70
2012-10-26 12:28:29 +00:00
# add +set fs_game legacy to etl and etlded (done/feedback)
2012-10-26 08:46:19 +00:00
# add option to set fs_hompath
2012-10-26 09:05:17 +00:00
# add options to complete install (missing genuine files)
2012-10-26 08:46:19 +00:00
# - do a search for installed W:ET and get the files from
# -- search by key
# -- search by user input path
2012-10-26 09:05:17 +00:00
# --- if install is found
# ---- add option to use key
# ---- copy mp_bin.pk3, pa0.pk3, pak1.pk3, pak2.pk3 to etmain
2012-10-26 08:46:19 +00:00
# -- ask to download and install genuine files
# --- run installer again
# --- worst case points to http://www.etlegacy.com/projects/etlegacy/wiki/Windows
# add omnibot files to installer options (default: true)
2012-08-13 09:56:54 +00:00
RequestExecutionLevel admin #NOTE: You still need to check user rights with UserInfo!
2012-08-12 15:38:20 +00:00
# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
!define VERSION "2.70 alpha (git ${__DATE__})"
!define COMPANY "ET:L Dev Team"
!define URL http://www.etlegacy.com
!define DL_URL http://mirror.etlegacy.com/installer
# MUI Symbol Definitions
!define MUI_ICON wolfet.ico
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "WolfET Legacy"
!define MUI_FINISHPAGE_SHOWREADME ""
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
2012-08-13 09:56:54 +00:00
!define MUI_FINISHPAGE_SHOWREADME_TEXT $(^CreateDesktopShortcut)
2012-08-12 15:38:20 +00:00
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION finishpageaction
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
!define MUI_LANGDLL_REGISTRY_ROOT HKLM
!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY}
!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage
# Included files
!include Sections.nsh
!include MUI2.nsh
# Reserved Files
!insertmacro MUI_RESERVEFILE_LANGDLL
# Variables
Var StartMenuGroup
Var FileToDownload
# Installer pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE COPYING.txt
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
# Installer languages
!insertmacro MUI_LANGUAGE English
!insertmacro MUI_LANGUAGE Czech
!insertmacro MUI_LANGUAGE German
!insertmacro MUI_LANGUAGE Polish
# Installer attributes
OutFile etlegacy-2.70-git-${__DATE__}-setup.exe
InstallDir "$PROGRAMFILES\WolfET Legacy"
CRCCheck on
XPStyle on
ShowInstDetails show
VIProductVersion 2.70.0.0
VIAddVersionKey /LANG=${LANG_ENGLISH} ProductName "Wolfenstein Enemy Territory: Legacy"
VIAddVersionKey /LANG=${LANG_ENGLISH} ProductVersion "${VERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyName "${COMPANY}"
VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyWebsite "${URL}"
VIAddVersionKey /LANG=${LANG_ENGLISH} FileVersion "${VERSION}"
2012-10-26 08:46:19 +00:00
VIAddVersionKey /LANG=${LANG_ENGLISH} FileDescription "Wolfenstein Enemy Territory: Legacy - best multiplayer game ever."
VIAddVersionKey /LANG=${LANG_ENGLISH} LegalCopyright "GNU GENERAL PUBLIC LICENSE V3"
2012-08-12 15:38:20 +00:00
InstallDirRegKey HKLM "${REGKEY}" Path
ShowUninstDetails show
# Installer sections
Section !ET:L MainProgram
SectionIn RO ;mark section as mandatory
SetOutPath $INSTDIR
SetOverwrite on
File etl.exe
File etlded.exe
File wolfet.ico
File libcurl.dll
2012-10-26 11:02:18 +00:00
;File libfreetype-6.dll
2012-10-26 08:46:19 +00:00
File README-libjpeg-8.txt
2012-08-12 15:38:20 +00:00
File libjpeg-8.dll
File README-SDL.txt
File SDL.dll
SetOutPath $INSTDIR\etmain
2012-10-26 08:46:19 +00:00
File etmain\etl_server.cfg
File etmain\lmscycle.cfg
File etmain\objectivecycle.cfg
File etmain\campaigncycle.cfg
SetOutPath $INSTDIR\legacy
File legacy\etl_bin.pk3
File legacy\pak3.pk3
File legacy\qagame_mp_x86.dll
2012-08-12 15:38:20 +00:00
SetOutPath $DESKTOP
WriteRegStr HKLM "${REGKEY}\Components" ET:L 1
SectionEnd
2012-08-13 10:06:56 +00:00
# Distributing these files is illegal
# we have to find another way.
;Section "Download required datafiles" GameData
; StrCpy $FileToDownload "pak0.pk3"
; Call Download
; StrCpy $FileToDownload "pak1.pk3"
; Call Download
; StrCpy $FileToDownload "pak2.pk3"
; Call Download
; StrCpy $FileToDownload "mp_bin.pk3"
; Call Download
;SectionEnd
2012-08-12 15:38:20 +00:00
Function Download
StrCpy $2 "$INSTDIR\etmain\$FileToDownload"
nsisdl::download /TIMEOUT=30000 ${DL_URL}/$FileToDownload $2
Pop $R0 ;get the return value
StrCmp $R0 "success" +3
MessageBox MB_OK "Download failed: $R0"
Quit
;MessageBox MB_OK "Download complete: $R0"
Return
FunctionEnd
Function finishpageaction
2012-10-26 12:28:29 +00:00
CreateShortcut "$DESKTOP\ET Legacy.lnk" "$INSTDIR\etl.exe" "+set fs_game legacy" "$INSTDIR\wolfet.ico"
CreateShortcut "$DESKTOP\ET Legacy dedicated.lnk" "$INSTDIR\etlded.exe" "+set fs_game legacy" "$INSTDIR\wolfet.ico"
2012-08-12 15:38:20 +00:00
FunctionEnd
Section -post PostInstall
2012-08-13 09:56:54 +00:00
SetShellVarContext all
2012-08-12 15:38:20 +00:00
WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
SetOutPath $INSTDIR
WriteUninstaller $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
SetOutPath $SMPROGRAMS\$StartMenuGroup
2012-08-13 09:56:54 +00:00
;CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk" $INSTDIR\uninstall.exe
2012-10-26 12:28:29 +00:00
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\ET Legacy.lnk" "$INSTDIR\etl.exe" "+set fs_game legacy" "$INSTDIR\wolfet.ico"
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\ET Legacy dedicated.lnk" "$INSTDIR\etlded.exe" "+set fs_game legacy" "$INSTDIR\wolfet.ico"
2012-08-12 15:38:20 +00:00
!insertmacro MUI_STARTMENU_WRITE_END
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
SectionEnd
# Macro for selecting uninstaller sections
!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
Push $R0
ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}"
StrCmp $R0 1 0 next${UNSECTION_ID}
!insertmacro SelectSection "${UNSECTION_ID}"
GoTo done${UNSECTION_ID}
next${UNSECTION_ID}:
!insertmacro UnselectSection "${UNSECTION_ID}"
done${UNSECTION_ID}:
Pop $R0
!macroend
# Uninstaller sections
Section /o -un.ET:L UNMainProgram
Delete /REBOOTOK "$DESKTOP\ET Legacy.lnk"
2012-10-26 12:28:29 +00:00
Delete /REBOOTOK "$DESKTOP\ET Legacy dedicated.lnk"
2012-10-26 08:46:19 +00:00
2012-10-05 12:09:14 +00:00
#etmain
2012-10-26 08:46:19 +00:00
Delete /REBOOTOK $INSTDIR\etmain\etl_server.cfg
Delete /REBOOTOK $INSTDIR\etmain\lmscycle.cfg
Delete /REBOOTOK $INSTDIR\etmain\objectivecycle.cfg
Delete /REBOOTOK $INSTDIR\etmain\campaigncycle.cfg
2012-08-13 09:56:54 +00:00
RmDir /r /REBOOTOK $INSTDIR\etmain ; this deletes EVERYTHING recursively! Maybe a bad idea.
2012-10-05 12:09:14 +00:00
2012-10-26 08:46:19 +00:00
#legacy
Delete /REBOOTOK $INSTDIR\legacy\pak3.pk3
Delete /REBOOTOK $INSTDIR\legacy\etl_bin.pk3
Delete /REBOOTOK $INSTDIR\legacy\qagame_mp_x86.dll
RmDir /r /REBOOTOK $INSTDIR\legacy ; this deletes EVERYTHING recursively! Maybe a bad idea.
2012-10-05 12:09:14 +00:00
#root
2012-08-12 15:38:20 +00:00
Delete /REBOOTOK $INSTDIR\SDL.dll
Delete /REBOOTOK $INSTDIR\README-SDL.txt
2012-10-26 08:46:19 +00:00
Delete /REBOOTOK $INSTDIR\README-libjpeg-8.txt
2012-08-12 15:38:20 +00:00
Delete /REBOOTOK $INSTDIR\libjpeg-8.dll
2012-10-26 11:02:18 +00:00
;Delete /REBOOTOK $INSTDIR\libfreetype-6.dll
2012-08-12 15:38:20 +00:00
Delete /REBOOTOK $INSTDIR\libcurl.dll
Delete /REBOOTOK $INSTDIR\etlded.exe
Delete /REBOOTOK $INSTDIR\etl.exe
Delete /REBOOTOK $INSTDIR\wolfet.ico
DeleteRegValue HKLM "${REGKEY}\Components" ET:L
SectionEnd
Section -un.post UNPostInstall
2012-08-13 09:56:54 +00:00
SetShellVarContext all
2012-08-12 15:38:20 +00:00
Delete "$DESKTOP\ET Legacy.lnk"
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
2012-08-13 09:56:54 +00:00
;Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\ET Legacy.lnk"
2012-10-26 12:28:29 +00:00
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\ET Legacy dedicated.lnk"
2012-08-13 09:56:54 +00:00
RmDir /REBOOTOK "$SMPROGRAMS\$StartMenuGroup"
2012-08-12 15:38:20 +00:00
Delete /REBOOTOK $INSTDIR\uninstall.exe
DeleteRegValue HKLM "${REGKEY}" StartMenuGroup
DeleteRegValue HKLM "${REGKEY}" Path
DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components"
DeleteRegKey /IfEmpty HKLM "${REGKEY}"
RmDir /REBOOTOK $INSTDIR
Push $R0
StrCpy $R0 $StartMenuGroup 1
StrCmp $R0 ">" no_smgroup
no_smgroup:
Pop $R0
SectionEnd
# Installer functions
Function .onInit
InitPluginsDir
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
# Uninstaller functions
Function un.onInit
ReadRegStr $INSTDIR HKLM "${REGKEY}" Path
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
!insertmacro MUI_UNGETLANGUAGE
!insertmacro SELECT_UNSECTION ET:L ${UNMainProgram}
FunctionEnd
# Section Descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${MainProgram} $(MainProgram_DESC)
2012-08-13 10:06:56 +00:00
; !insertmacro MUI_DESCRIPTION_TEXT ${GameData} $(GameData_DESC)
2012-08-12 15:38:20 +00:00
!insertmacro MUI_FUNCTION_DESCRIPTION_END
# Installer Language Strings
2012-08-13 09:56:54 +00:00
#
# ENGLISH
#
2012-08-12 15:38:20 +00:00
LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)"
LangString MainProgram_DESC ${LANG_ENGLISH} "Game binaries"
LangString GameData_DESC ${LANG_ENGLISH} "Download game datafiles required to play, i.e. pak0.pk3, pak1.pk3, pak2.pk3 and mp_bin.pk3. You will NOT be able to play without them."
2012-08-13 09:56:54 +00:00
LangString ^CreateDesktopShortcut ${LANG_ENGLISH} "Create Desktop Shortcut"
#
# CZECH
#
LangString ^UninstallLink ${LANG_CZECH} "Odinstaluj $(^Name)"
LangString MainProgram_DESC ${LANG_CZECH} "Soubory se hrou"
LangString GameData_DESC ${LANG_CZECH} "Stáhnout soubory s herními daty, t.j. pak0.pk3, pak1.pk3, pak2.pk3 a mp_bin.pk3. Bez nich hru nebude možné spustit."
LangString ^CreateDesktopShortcut ${LANG_CZECH} "Vytvořit zástupce na ploše"
#
# GERMAN
#
2012-10-05 12:09:14 +00:00
LangString ^UninstallLink ${LANG_GERMAN} "Deinstallieren $(^Name)"
LangString MainProgram_DESC ${LANG_GERMAN} "Spiel Binaries"
LangString GameData_DESC ${LANG_GERMAN} "Lade die erforderlichen Spieledateien herunter, z.B. pak0.pk3, pak1.pk3, pak2.pk3 und mp_bin.pk3. Diese werden für das Spiel benötigt."
LangString ^CreateDesktopShortcut ${LANG_GERMAN} "Desktop Shortcut erstellen"
2012-08-12 15:38:20 +00:00
2012-08-13 09:56:54 +00:00
#
# POLISH
#
LangString ^UninstallLink ${LANG_POLISH} "Odinstaluj $(^Name)"
2012-08-12 16:08:37 +00:00
LangString MainProgram_DESC ${LANG_POLISH} "Pliki wykonywalne"
LangString GameData_DESC ${LANG_POLISH} "Pobierz pliki wymagane do gry. Są to pliki pak0.pk3, pak1.pk3, pak2.pk3 oraz mp_bin.pk3. Nie jest możliwe granie bez tych plików."
2012-08-13 09:56:54 +00:00
LangString ^CreateDesktopShortcut ${LANG_POLISH} "Create Desktop Shortcut"