1
0
mirror of https://github.com/ncblakely/GiantsTools synced 2024-11-24 23:25:37 +01:00
GiantsTools/GPatch/GPatch.nsi

120 lines
3.0 KiB
Plaintext
Raw Normal View History

Unicode True
2020-08-10 07:26:15 +02:00
SetCompressor /SOLID lzma
!define PRODUCT_NAME "Giants: Citizen Kabuto"
!define PRODUCT_VERSION "1.498"
; MUI 1.67 compatible ------
!include "MUI2.nsh"
2020-08-11 08:38:26 +02:00
!include "DotNetChecker.nsh"
2020-08-10 07:26:15 +02:00
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "GPatch.ico"
; Welcome page
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
;!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\readme.txt
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!insertmacro MUI_PAGE_FINISH
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\PlanetMoon\Giants"
!define MUI_LANGDLL_REGISTRY_VALUENAME "SetupLanguage"
; Language files
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Spanish"
; Language selection settings
!define MUI_LANGDLL_WINDOWTITLE "Setup Language"
!include LogicLib.nsh
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
2020-08-16 10:24:49 +02:00
OutFile "Output\GPatch1_498_181_0.exe"
2020-08-10 07:26:15 +02:00
InstallDir "$PROGRAMFILES\Giants\"
InstallDirRegKey HKCU "SOFTWARE\PlanetMoon\Giants" "DestDir"
ShowInstDetails hide
;Request application privileges for Windows Vista+
RequestExecutionLevel admin
Section
SetDetailsView hide
SectionIn RO
SetOverwrite on
; Install DX redist for DX9 renderer
SetOutPath "$INSTDIR\Redist"
File /r "Files\Redist\*.*"
ExecWait "$INSTDIR\Redist\dxsetup.exe /silent" $0
${If} $0 != 0
MessageBox MB_OK "Setup failed to update DirectX ($0). Please visit www.microsoft.com and download the latest version of the DirectX end user redistributable."
RMDir /r "$INSTDIR\Redist" ; Delete temporary files
;return
${Else}
RMDir /r "$INSTDIR\Redist" ; Delete temporary files
${EndIf}
; Delete old files
Delete $INSTDIR\bin\Shaders\*.*
Delete $INSTDIR\gg_dx7r.dll
Delete $INSTDIR\gg_dx8r.dll
2020-08-11 10:38:49 +02:00
Delete $INSTDIR\gg_dx9r.dll
2020-08-10 07:26:15 +02:00
Delete $INSTDIR\Giants.exe
2020-08-11 10:38:49 +02:00
Delete $INSTDIR\GiantsMain.exe
2020-08-10 07:26:15 +02:00
Delete $INSTDIR\*.vso
Delete $INSTDIR\*.pso
SetOutPath "$INSTDIR"
File /r "Files\*.*"
; remove old mods (may have compatibility issues)
Delete $INSTDIR\bin\worldlist2.bin
Delete $INSTDIR\bin\worldlist3.bin
Delete $INSTDIR\bin\worldlist4.bin
Delete $INSTDIR\bin\worldlist5.bin
Delete $INSTDIR\bin\mappack1.gzp
Delete $INSTDIR\bin\A-GRM1.gzp
SectionEnd
2020-08-11 08:38:26 +02:00
!define NETVersion "4.7.2"
!define NETInstallerFileName "NDP472-KB4054531-Web.exe"
!define NETInstallerPath "Files\Redist\NDP472-KB4054531-Web.exe"
2020-08-10 07:26:15 +02:00
Section "MS .NET Framework v${NETVersion}" SecFramework
IfFileExists "$WINDIR\Microsoft.NET\Framework\v${NETVersion}" NETFrameworkInstalled 0
2020-08-11 08:38:26 +02:00
File /oname=$TEMP\${NETInstallerFileName} "${NETInstallerPath}"
!insertmacro CheckNetFramework 472
2020-08-10 07:26:15 +02:00
Return
NETFrameworkInstalled:
DetailPrint "Microsoft .NET Framework is already installed!"
SectionEnd
2020-08-11 08:38:26 +02:00
2020-08-10 07:26:15 +02:00
;--------------------------------
;Installer Functions
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
;--------------------------------