mirror of
https://github.com/etlegacy/etlegacy-tools.git
synced 2024-11-21 19:41:37 +00:00
Installer has an option to download required pk3 files and creates desktop shortcut
This commit is contained in:
parent
85cf771468
commit
4911bea265
1 changed files with 231 additions and 0 deletions
231
etl-installer.nsi
Executable file
231
etl-installer.nsi
Executable file
|
@ -0,0 +1,231 @@
|
|||
####################################################
|
||||
# Wolfenstein Enemy Territory - Legacy Project #
|
||||
# Auto-generated by EclipseNSIS Script Wizard #
|
||||
####################################################
|
||||
|
||||
Name "Wolfenstein ET: Legacy"
|
||||
|
||||
# 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
|
||||
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Create Desktop Shortcut"
|
||||
!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}"
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} FileDescription ""
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} LegalCopyright ""
|
||||
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
|
||||
File libfreetype-6.dll
|
||||
File libjpeg-8.dll
|
||||
File README-SDL.txt
|
||||
File SDL.dll
|
||||
SetOutPath $INSTDIR\etmain
|
||||
File etmain\cgame_mp_x86.dll
|
||||
File etmain\qagame_mp_x86.dll
|
||||
File etmain\ui_mp_x86.dll
|
||||
SetOutPath $DESKTOP
|
||||
WriteRegStr HKLM "${REGKEY}\Components" ET:L 1
|
||||
SectionEnd
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
CreateShortcut "$DESKTOP\ET Legacy.lnk" "$INSTDIR\etl.exe" "" "$INSTDIR\wolfet.ico"
|
||||
FunctionEnd
|
||||
|
||||
Section -post PostInstall
|
||||
WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
|
||||
SetOutPath $INSTDIR
|
||||
WriteUninstaller $INSTDIR\uninstall.exe
|
||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
||||
SetOutPath $SMPROGRAMS\$StartMenuGroup
|
||||
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk" $INSTDIR\uninstall.exe
|
||||
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\ET Legacy.lnk" "$INSTDIR\etl.exe" "" "$INSTDIR\wolfet.ico"
|
||||
!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"
|
||||
Delete /REBOOTOK $INSTDIR\etmain\ui_mp_x86.dll
|
||||
Delete /REBOOTOK $INSTDIR\etmain\qagame_mp_x86.dll
|
||||
Delete /REBOOTOK $INSTDIR\etmain\cgame_mp_x86.dll
|
||||
Delete /REBOOTOK $INSTDIR\SDL.dll
|
||||
Delete /REBOOTOK $INSTDIR\README-SDL.txt
|
||||
Delete /REBOOTOK $INSTDIR\libjpeg-8.dll
|
||||
Delete /REBOOTOK $INSTDIR\libfreetype-6.dll
|
||||
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
|
||||
Delete "$DESKTOP\ET Legacy.lnk"
|
||||
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
|
||||
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk"
|
||||
Delete /REBOOTOK "$SMPROGRAMS\ET Legacy.lnk"
|
||||
Delete /REBOOTOK $INSTDIR\uninstall.exe
|
||||
DeleteRegValue HKLM "${REGKEY}" StartMenuGroup
|
||||
DeleteRegValue HKLM "${REGKEY}" Path
|
||||
DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components"
|
||||
DeleteRegKey /IfEmpty HKLM "${REGKEY}"
|
||||
RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
|
||||
RmDir /r /REBOOTOK $INSTDIR\etmain ; this deletes EVERYTHING recursively! Maybe a bad idea.
|
||||
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)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${GameData} $(GameData_DESC)
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
|
||||
# Installer Language Strings
|
||||
# TODO Update the Language Strings with the appropriate translations.
|
||||
|
||||
LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)"
|
||||
LangString ^UninstallLink ${LANG_CZECH} "Uninstall $(^Name)"
|
||||
LangString ^UninstallLink ${LANG_GERMAN} "Uninstall $(^Name)"
|
||||
LangString ^UninstallLink ${LANG_POLISH} "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."
|
||||
|
||||
LangString MainProgram_DESC ${LANG_CZECH} "Game binaries"
|
||||
LangString GameData_DESC ${LANG_CZECH} "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."
|
||||
|
||||
LangString MainProgram_DESC ${LANG_GERMAN} "Game binaries"
|
||||
LangString GameData_DESC ${LANG_GERMAN} "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."
|
||||
|
||||
LangString MainProgram_DESC ${LANG_POLISH} "Game binaries"
|
||||
LangString GameData_DESC ${LANG_POLISH} "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."
|
Loading…
Reference in a new issue