2010-05-13 04:15:32 +00:00
|
|
|
|
2010-05-26 19:46:37 +00:00
|
|
|
; PCSX2 Full/Complete Install Package!
|
|
|
|
; (a NSIS installer script)
|
|
|
|
;
|
2016-12-15 03:02:06 +00:00
|
|
|
; Copyright 2009-2016 PCSX2 Dev Team
|
2010-05-26 19:46:37 +00:00
|
|
|
;
|
2009-08-30 01:48:08 +00:00
|
|
|
|
2010-05-15 13:13:55 +00:00
|
|
|
|
2015-12-21 10:40:38 +00:00
|
|
|
!ifndef INC_CRT_2015
|
|
|
|
; Set to 0 to disable inclusion of Visual Studio 2013 SP1 CRT Redists
|
|
|
|
!define INC_CRT_2015 1
|
|
|
|
!endif
|
|
|
|
|
2016-12-29 20:20:52 +00:00
|
|
|
ManifestDPIAware true
|
2013-12-30 17:50:07 +00:00
|
|
|
ShowInstDetails nevershow
|
|
|
|
ShowUninstDetails nevershow
|
|
|
|
|
2010-05-27 12:13:51 +00:00
|
|
|
!define OUTFILE_POSTFIX "setup"
|
2010-05-30 02:00:19 +00:00
|
|
|
!include "SharedBase.nsh"
|
2014-01-05 21:23:46 +00:00
|
|
|
!include "x64.nsh"
|
2009-08-30 01:48:08 +00:00
|
|
|
|
2010-05-27 12:13:51 +00:00
|
|
|
; Reserve features for improved performance with solid archiving.
|
|
|
|
; (uncomment if we add our own install options ini files)
|
|
|
|
;!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
|
|
|
|
;!insertmacro MUI_RESERVEFILE_LANGDLL
|
|
|
|
|
2016-12-29 20:20:52 +00:00
|
|
|
!insertmacro MUI_PAGE_COMPONENTS
|
2010-05-15 13:13:55 +00:00
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
2016-12-29 20:20:52 +00:00
|
|
|
|
2016-12-15 03:02:06 +00:00
|
|
|
; This hack is required to launch pcsx2.exe from the FINISHPAGE of the installer.
|
|
|
|
; RequestExecutionLevel defaults to admin as of NSIS 3.0; and UAC behavior is defined
|
|
|
|
; as such that any elevation rights are transferred to child processes
|
|
|
|
|
|
|
|
!define MUI_FINISHPAGE_RUN "$WINDIR\explorer.exe"
|
|
|
|
!define MUI_FINISHPAGE_RUN_PARAMETERS "$INSTDIR\pcsx2.exe"
|
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ModifyRunCheckbox
|
|
|
|
!insertmacro MUI_PAGE_FINISH
|
|
|
|
|
2010-05-15 13:13:55 +00:00
|
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
|
|
!insertmacro MUI_UNPAGE_COMPONENTS
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
|
2010-05-17 04:52:31 +00:00
|
|
|
!include "ApplyExeProps.nsh"
|
2010-05-15 13:13:55 +00:00
|
|
|
|
|
|
|
; =======================================================================
|
|
|
|
; Installer Sections
|
|
|
|
; =======================================================================
|
2009-08-30 01:48:08 +00:00
|
|
|
|
2010-05-15 13:13:55 +00:00
|
|
|
; -----------------------------------------------------------------------
|
2016-12-15 03:02:06 +00:00
|
|
|
|
|
|
|
; The "" makes the section hidden.
|
|
|
|
Section "" SecUninstallPrevious
|
|
|
|
|
2016-12-29 20:20:52 +00:00
|
|
|
Call UninstallPrevious
|
|
|
|
|
2016-12-15 03:02:06 +00:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Function UninstallPrevious
|
2016-12-29 20:20:52 +00:00
|
|
|
;Check for uninstaller.
|
|
|
|
ReadRegStr $R0 HKLM "${INSTDIR_REG_KEY}" "UninstallString"
|
|
|
|
${If} $R0 == ""
|
|
|
|
Goto Done
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
;Check if any other version is installed
|
|
|
|
ReadRegStr $R1 HKLM "${INSTDIR_REG_KEY}" "InstalledVersion"
|
|
|
|
|
|
|
|
;This check for older versions (pre 1.6.0) without InstalledVersion string will bypass this section
|
|
|
|
${If} $R1 == ""
|
|
|
|
DetailPrint "InstalledVersion string not found, skipping version check"
|
|
|
|
Goto Done
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
;Installing same version
|
|
|
|
${If} $R1 S== ${APP_VERSION}
|
|
|
|
MessageBox MB_ICONEXCLAMATION|MB_OKCANCEL "This version of PCSX2 is already installed. Do you want to continue?" IDCANCEL false
|
|
|
|
DetailPrint "Overwriting current install"
|
|
|
|
Goto Done
|
|
|
|
false:
|
|
|
|
Quit
|
|
|
|
${Else}
|
|
|
|
DetailPrint "Not the same version"
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
;Installing newer version (and old version is detected)
|
|
|
|
${If} $R1 S< ${APP_VERSION}
|
|
|
|
MessageBox MB_ICONEXCLAMATION|MB_OKCANCEL "An older version of PCSX2 is installed. Do you want to uninstall it?" IDOK true2 IDCANCEL false2
|
|
|
|
true2:
|
|
|
|
DetailPrint "Uninstalling old PCSX2 version"
|
|
|
|
Goto Next
|
|
|
|
false2:
|
|
|
|
Quit
|
|
|
|
${Else}
|
|
|
|
DetailPrint "Not installing a new version"
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
;Run the uninstaller silently.
|
|
|
|
Next:
|
|
|
|
DetailPrint "Running silent uninstall"
|
|
|
|
|
|
|
|
;Copy files to a temp dir to prevent conflicts when removing $INSTDIR/uninstaller
|
|
|
|
ReadRegStr $R2 HKLM Software\PCSX2 "Install_Dir"
|
|
|
|
CreateDirectory "$TEMP\pcsx2_uninst_temp"
|
|
|
|
CopyFiles /SILENT /FILESONLY "$R2\uninst-pcsx2.exe" "$TEMP\pcsx2_uninst_temp"
|
|
|
|
|
|
|
|
ExecWait '"$TEMP\pcsx2_uninst_temp\uninst-pcsx2.exe" /S _?=$R2'
|
|
|
|
RMDir /r $TEMP\pcsx2_uninst_temp
|
|
|
|
Done:
|
2016-12-15 03:02:06 +00:00
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
2009-08-30 01:48:08 +00:00
|
|
|
; Basic section (emulation proper)
|
2010-05-17 04:52:31 +00:00
|
|
|
Section "!${APP_NAME} (required)" SEC_CORE
|
2009-08-30 01:48:08 +00:00
|
|
|
|
|
|
|
SectionIn RO
|
2010-05-15 13:13:55 +00:00
|
|
|
|
2010-05-27 12:13:51 +00:00
|
|
|
!include "SectionCoreReqs.nsh"
|
2009-09-20 20:54:45 +00:00
|
|
|
|
2010-05-15 13:13:55 +00:00
|
|
|
; ------------------------------------------
|
|
|
|
; -- Plugins Section --
|
|
|
|
; ------------------------------------------
|
2009-08-30 01:48:08 +00:00
|
|
|
|
2010-05-17 04:52:31 +00:00
|
|
|
!if ${INC_PLUGINS} > 0
|
2009-09-20 20:54:45 +00:00
|
|
|
|
2010-05-17 04:52:31 +00:00
|
|
|
SetOutPath "$INSTDIR\Plugins"
|
|
|
|
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
|
2009-09-20 20:54:45 +00:00
|
|
|
|
2016-12-15 03:02:06 +00:00
|
|
|
File /nonfatal ..\bin\Plugins\gsdx32-sse2.dll
|
|
|
|
File /nonfatal ..\bin\Plugins\gsdx32-ssse3.dll
|
|
|
|
File /nonfatal ..\bin\Plugins\gsdx32-sse4.dll
|
|
|
|
File /nonfatal ..\bin\Plugins\gsdx32-avx.dll
|
2016-12-29 20:20:52 +00:00
|
|
|
File /nonfatal ..\bin\Plugins\gsdx32-avx2.dll
|
2016-12-15 03:02:06 +00:00
|
|
|
File /nonfatal ..\bin\Plugins\spu2-x.dll
|
2016-12-29 20:20:52 +00:00
|
|
|
File /nonfatal ..\bin\Plugins\cdvdGigaherz.dll
|
2016-12-15 03:02:06 +00:00
|
|
|
File /nonfatal ..\bin\Plugins\lilypad.dll
|
2016-12-29 20:20:52 +00:00
|
|
|
File /nonfatal ..\bin\Plugins\padPokopom.dll
|
2009-08-30 01:48:08 +00:00
|
|
|
|
2010-05-15 13:13:55 +00:00
|
|
|
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
|
|
|
|
|
2010-05-17 04:52:31 +00:00
|
|
|
!endif
|
2009-08-30 01:48:08 +00:00
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
2010-05-29 16:24:26 +00:00
|
|
|
!include "SectionShortcuts.nsh"
|
2010-05-13 13:21:45 +00:00
|
|
|
|
2016-12-15 03:02:06 +00:00
|
|
|
Section "Additional Languages" SEC_LANGS
|
2016-12-29 20:20:52 +00:00
|
|
|
SetOutPath $INSTDIR\Langs
|
|
|
|
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
|
|
|
|
File /nonfatal /r ..\bin\Langs\*.mo
|
|
|
|
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
|
|
|
|
SectionEnd
|
|
|
|
|
2016-12-15 03:02:06 +00:00
|
|
|
SectionGroup "DirectX Packages (required for PCSX2)" SEC_DXPACKS
|
2015-12-21 10:40:38 +00:00
|
|
|
!if ${INC_CRT_2015} > 0
|
|
|
|
Section "Microsoft Visual C++ 2015 Redist" SEC_CRT2015
|
2013-12-31 10:59:17 +00:00
|
|
|
|
|
|
|
;SectionIn RO
|
|
|
|
|
2015-12-21 10:40:38 +00:00
|
|
|
; Detection made easy: Unlike previous redists, VC2015 now generates a platform
|
2013-12-31 10:59:17 +00:00
|
|
|
; independent key for checking availability.
|
2015-12-21 10:40:38 +00:00
|
|
|
; HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x86 for x64 Windows
|
|
|
|
; HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86 for x86 Windows
|
2016-12-29 20:20:52 +00:00
|
|
|
|
2013-12-31 10:59:17 +00:00
|
|
|
; Downloaded from:
|
2015-12-21 10:40:38 +00:00
|
|
|
; https://www.microsoft.com/en-us/download/details.aspx?id=49984
|
2013-12-31 10:59:17 +00:00
|
|
|
|
|
|
|
ClearErrors
|
2016-12-29 20:20:52 +00:00
|
|
|
|
2014-01-05 21:23:46 +00:00
|
|
|
${If} ${RunningX64}
|
2015-12-21 10:40:38 +00:00
|
|
|
ReadRegDword $R0 HKLM "SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x86" "Installed"
|
2014-01-05 21:23:46 +00:00
|
|
|
${Else}
|
2015-12-21 10:40:38 +00:00
|
|
|
ReadRegDword $R0 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86" "Installed"
|
2014-01-05 21:23:46 +00:00
|
|
|
${EndIf}
|
2016-12-29 20:20:52 +00:00
|
|
|
|
2013-12-31 10:59:17 +00:00
|
|
|
IfErrors 0 +2
|
2015-12-21 10:40:38 +00:00
|
|
|
DetailPrint "Visual C++ 2015 Redistributable registry key was not found; assumed to be uninstalled."
|
2013-12-31 10:59:17 +00:00
|
|
|
StrCmp $R0 "1" 0 +3
|
2015-12-21 10:40:38 +00:00
|
|
|
DetailPrint "Visual C++ 2015 Redistributable is already installed; skipping!"
|
2013-12-31 10:59:17 +00:00
|
|
|
Goto done
|
|
|
|
|
|
|
|
SetOutPath "$TEMP"
|
2015-12-21 10:40:38 +00:00
|
|
|
File "vcredist_2015_Update_1_x86.exe"
|
|
|
|
DetailPrint "Running Visual C++ 2015 Redistributable Setup..."
|
|
|
|
ExecWait '"$TEMP\vcredist_2015_Update_1_x86.exe" /qb'
|
|
|
|
DetailPrint "Finished Visual C++ 2015 Redistributable Setup"
|
2016-12-29 20:20:52 +00:00
|
|
|
|
2015-12-21 10:40:38 +00:00
|
|
|
Delete "$TEMP\vcredist_2015_Update_1_x86.exe"
|
2013-12-31 10:59:17 +00:00
|
|
|
|
|
|
|
done:
|
|
|
|
SectionEnd
|
|
|
|
!endif
|
|
|
|
|
2010-05-15 13:13:55 +00:00
|
|
|
; -----------------------------------------------------------------------
|
2010-05-13 04:15:32 +00:00
|
|
|
; This section needs to be last, so that in case it fails, the rest of the program will
|
2010-05-15 13:13:55 +00:00
|
|
|
; be installed cleanly.
|
|
|
|
;
|
|
|
|
; This section could be optional, but why not? It's pretty painless to double-check that
|
|
|
|
; all the libraries are up-to-date.
|
|
|
|
;
|
2012-07-03 10:30:26 +00:00
|
|
|
Section "DirectX Web Setup" SEC_DIRECTX
|
2016-12-29 20:20:52 +00:00
|
|
|
|
2010-05-17 04:52:31 +00:00
|
|
|
;SectionIn RO
|
2010-05-15 13:13:55 +00:00
|
|
|
|
2010-05-14 18:15:27 +00:00
|
|
|
SetOutPath "$TEMP"
|
|
|
|
File "dxwebsetup.exe"
|
|
|
|
DetailPrint "Running DirectX Web Setup..."
|
|
|
|
ExecWait '"$TEMP\dxwebsetup.exe" /Q' $DirectXSetupError
|
2016-12-29 20:20:52 +00:00
|
|
|
DetailPrint "Finished DirectX Web Setup"
|
|
|
|
|
2010-05-14 18:15:27 +00:00
|
|
|
Delete "$TEMP\dxwebsetup.exe"
|
|
|
|
|
|
|
|
SectionEnd
|
2016-12-15 03:02:06 +00:00
|
|
|
SectionGroupEnd
|
2010-05-13 04:15:32 +00:00
|
|
|
|
2010-05-29 16:24:26 +00:00
|
|
|
!include "SectionUninstaller.nsh"
|
2009-08-30 01:48:08 +00:00
|
|
|
|
2016-12-15 03:02:06 +00:00
|
|
|
LangString DESC_CORE ${LANG_ENGLISH} "Core components (binaries, plugins, documentation, etc)."
|
2009-09-20 20:54:45 +00:00
|
|
|
|
2010-05-17 04:52:31 +00:00
|
|
|
LangString DESC_STARTMENU ${LANG_ENGLISH} "Adds shortcuts for PCSX2 to the start menu (all users)."
|
|
|
|
LangString DESC_DESKTOP ${LANG_ENGLISH} "Adds a shortcut for PCSX2 to the desktop (all users)."
|
2016-12-29 20:20:52 +00:00
|
|
|
LangString DESC_LANGS ${LANG_ENGLISH} "Adds additional languages other than the system default to PCSX2."
|
2009-08-30 01:48:08 +00:00
|
|
|
|
2016-12-29 20:20:52 +00:00
|
|
|
LangString DESC_DXPACKS ${LANG_ENGLISH} "Installs the Visual C++ Redistributable and DirectX SDK"
|
2015-12-22 16:56:59 +00:00
|
|
|
LangString DESC_CRT2015 ${LANG_ENGLISH} "Required by the PCSX2 binaries packaged in this installer."
|
2010-05-17 04:52:31 +00:00
|
|
|
LangString DESC_DIRECTX ${LANG_ENGLISH} "Only uncheck this if you are quite certain your Direct3D runtimes are up to date."
|
2009-08-30 01:48:08 +00:00
|
|
|
|
2010-05-17 04:52:31 +00:00
|
|
|
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_CORE} $(DESC_CORE)
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_STARTMENU} $(DESC_STARTMENU)
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_DESKTOP} $(DESC_DESKTOP)
|
2016-12-29 20:20:52 +00:00
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LANGS} $(DESC_LANGS)
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_DXPACKS} $(DESC_DXPACKS)
|
|
|
|
|
2015-12-21 10:40:38 +00:00
|
|
|
!if ${INC_CRT_2015} > 0
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_CRT2015} $(DESC_CRT2015)
|
|
|
|
!endif
|
|
|
|
|
2010-05-17 04:52:31 +00:00
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_DIRECTX} $(DESC_DIRECTX)
|
|
|
|
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
2010-05-29 16:24:26 +00:00
|
|
|
|
2016-12-15 03:02:06 +00:00
|
|
|
Section "" SID_PCSX2
|
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Function ModifyRunCheckbox
|
|
|
|
${IfNot} ${SectionIsSelected} ${SID_PCSX2}
|
2016-12-29 20:20:52 +00:00
|
|
|
SendMessage $MUI.FINISHPAGE.RUN ${BM_SETCHECK} ${BST_UNCHECKED} 0
|
|
|
|
EnableWindow $MUI.FINISHPAGE.RUN 0
|
2016-12-15 03:02:06 +00:00
|
|
|
${EndIf}
|
|
|
|
FunctionEnd
|