mirror of https://github.com/PCSX2/pcsx2.git
NSIS: Remove installer as it is is not compatible with Qt
This commit is contained in:
parent
d279f61d0b
commit
66e663757a
BIN
nsis/AppIcon.ico
BIN
nsis/AppIcon.ico
Binary file not shown.
Before Width: | Height: | Size: 41 KiB |
|
@ -1,11 +0,0 @@
|
|||
; =======================================================================
|
||||
; Generated-Setup.exe Properties
|
||||
; =======================================================================
|
||||
; (for the professionalism!!)
|
||||
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APP_NAME}"
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright 2019 PCSX2 Dev Team"
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Installs PCSX2, a PlayStation 2 Emulator for the PC."
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${APP_VERSION}"
|
||||
|
||||
VIProductVersion "${APP_VERSION}.0"
|
|
@ -1,87 +0,0 @@
|
|||
; =======================================================================
|
||||
; Shared Install Functions
|
||||
; =======================================================================
|
||||
|
||||
Function .onInstSuccess
|
||||
; Remove unpacked files
|
||||
|
||||
RMDir /r "$TEMP\PCSX2 ${APP_VERSION}"
|
||||
|
||||
FunctionEnd
|
||||
|
||||
; =======================================================================
|
||||
; Shared Uninstall Functions
|
||||
; =======================================================================
|
||||
|
||||
Function un.onUninstSuccess
|
||||
; And remove the various install dir(s) but only if they're clean of user content:
|
||||
|
||||
Delete "$INSTDIR\Uninst-pcsx2.exe"
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
FunctionEnd
|
||||
; =======================================================================
|
||||
; Un.Installer Sections
|
||||
; =======================================================================
|
||||
Section "Un.Program ${APP_NAME}"
|
||||
SectionIn RO
|
||||
|
||||
; First thing, remove the registry entry in case uninstall doesn't complete successfully
|
||||
; otherwise, pcsx2 will be "confused" if it's re-installed later.
|
||||
DeleteRegKey HKLM Software\PCSX2
|
||||
|
||||
; This key is generated by PCSX2 and *not* NSIS!
|
||||
; Failure to delete this key can result in configuration errors after a fresh install.
|
||||
DeleteRegKey HKCU Software\PCSX2
|
||||
|
||||
; Remove regkey generated by NSIS for uninstall functions
|
||||
DeleteRegKey HKLM "${INSTDIR_REG_KEY}"
|
||||
|
||||
; Remove shortcuts, if any
|
||||
Delete "$DESKTOP\${APP_NAME}.lnk"
|
||||
Delete "$SMPROGRAMS\${APP_NAME}.lnk"
|
||||
|
||||
Delete "$INSTDIR\GameIndex.yaml"
|
||||
Delete "$INSTDIR\cheats_ws.zip"
|
||||
Delete "$INSTDIR\PCSX2_keys.ini.default"
|
||||
Delete "$INSTDIR\pcsx2.exe"
|
||||
RMDir /r "$INSTDIR\Langs"
|
||||
RMDir /r "$INSTDIR\Docs"
|
||||
RMDir /r "$INSTDIR\Shaders"
|
||||
|
||||
|
||||
; FIXME: PCSX2 currently does not account for non-default file paths in the uninstaller
|
||||
; These paths would either have to be written to the registry by PCSX2 itself or read directly
|
||||
; using a script in NSIS.
|
||||
|
||||
SetShellVarContext current
|
||||
Delete $DOCUMENTS\PCSX2\inis\PCSX2_ui.ini
|
||||
SectionEnd
|
||||
|
||||
; /o for optional and unticked by default
|
||||
Section /o "Un.Configuration files (Programs)"
|
||||
SetShellVarContext current
|
||||
RMDir /r "$DOCUMENTS\PCSX2\inis\"
|
||||
SectionEnd
|
||||
|
||||
; /o for optional and unticked by default
|
||||
Section /o "Un.Memory Cards and Savestates"
|
||||
SetShellVarContext current
|
||||
RMDir /r "$DOCUMENTS\PCSX2\memcards\"
|
||||
RMDir /r "$DOCUMENTS\PCSX2\sstates\"
|
||||
SectionEnd
|
||||
|
||||
; /o for optional and unticked by default
|
||||
Section /o "Un.User files (Cheats, Logs, Snapshots)"
|
||||
SetShellVarContext current
|
||||
RMDir /r "$DOCUMENTS\PCSX2\Cheats_ws\"
|
||||
RMDir /r "$DOCUMENTS\PCSX2\cheats\"
|
||||
RMDir /r "$DOCUMENTS\PCSX2\logs\"
|
||||
RMDir /r "$DOCUMENTS\PCSX2\snaps\"
|
||||
SectionEnd
|
||||
|
||||
; /o for optional and unticked by default
|
||||
Section /o "Un.BIOS files"
|
||||
SetShellVarContext current
|
||||
RMDir /r "$DOCUMENTS\PCSX2\bios\"
|
||||
SectionEnd
|
|
@ -1,40 +0,0 @@
|
|||
; Copyright (C) 2019 PCSX2 Team
|
||||
|
||||
Function UninstallPrevious
|
||||
|
||||
; This will become the primary version check
|
||||
ReadRegStr $R1 HKLM "${INSTDIR_REG_KEY}" "DisplayVersion"
|
||||
ReadRegStr $R2 HKLM Software\PCSX2 "Install_Dir"
|
||||
${If} $R1 != ""
|
||||
${AndIf} $R2 != ""
|
||||
Goto UserPrompt
|
||||
${EndIf}
|
||||
|
||||
; If all cases return null, our work here is done.
|
||||
${If} $R2 == ""
|
||||
Return
|
||||
${EndIf}
|
||||
|
||||
UserPrompt:
|
||||
; Installing another version
|
||||
MessageBox MB_ICONEXCLAMATION|MB_OKCANCEL "An existing version of PCSX2 has been detected and will be REMOVED. The config folder in Documents will be duplicated (if it exists) and renamed as PCSX2_backup. Backup any important files and click OK to uninstall PCSX2 or Cancel to abort the setup." /SD IDOK IDOK SetUninstPath IDCANCEL false
|
||||
|
||||
false:
|
||||
Quit
|
||||
|
||||
SetUninstPath:
|
||||
SetOutPath "$DOCUMENTS"
|
||||
CopyFiles /SILENT "$DOCUMENTS\PCSX2" "$DOCUMENTS\PCSX2_backup"
|
||||
RMDir /r "$DOCUMENTS\PCSX2"
|
||||
|
||||
${If} $R1 != ""
|
||||
Goto ExecNormal
|
||||
${EndIf}
|
||||
|
||||
ExecNormal:
|
||||
SetOutPath "$TEMP"
|
||||
CopyFiles /SILENT /FILESONLY "$R2\Uninst-pcsx2.exe" "$TEMP"
|
||||
ExecWait '"$TEMP\Uninst-pcsx2.exe" /S _?=$R2'
|
||||
Delete "$TEMP\Uninst-pcsx2.exe"
|
||||
Return
|
||||
FunctionEnd
|
|
@ -1,52 +0,0 @@
|
|||
|
||||
; --- UAC NIGHTMARES ---
|
||||
; Ideally this would default to 'current' for user-level installs and 'all' for admin-level installs.
|
||||
; There are problems to be aware of, however!
|
||||
;
|
||||
; * If the user is an admin, Windows will DEFAULT to an "all" shell context (installing shortcuts
|
||||
; for all users), even if we don't want it to (which causes the uninstaller to fail!)
|
||||
; * If the user is not an admin, setting Shell Context to all will cause the installer to fail because the
|
||||
; user won't have permission enough to install it at all (sigh).
|
||||
|
||||
; (note! the SetShellVarContext use in the uninstaller section must match this one!)
|
||||
|
||||
;SetShellVarContext all
|
||||
;SetShellVarContext current
|
||||
|
||||
Function RedistInstallation
|
||||
!include WinVer.nsh
|
||||
|
||||
; Check if the VC runtimes are installed
|
||||
ReadRegDword $R5 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86" "Installed"
|
||||
|
||||
${If} $R5 == "1"
|
||||
Return
|
||||
${EndIf}
|
||||
|
||||
; Download and install the VC redistributable from the internet
|
||||
inetc::get /CONNECTTIMEOUT 30 /RECEIVETIMEOUT 30 "https://aka.ms/vs/16/release/VC_redist.x86.exe" "$TEMP\VC_redist.x86.exe" /END
|
||||
ExecShellWait open "$TEMP\VC_redist.x86.exe" "/INSTALL /Q /NORESTART"
|
||||
Delete "$TEMP\VC_redist.x86.exe"
|
||||
FunctionEnd
|
||||
|
||||
Section "" SEC_REDIST
|
||||
Call RedistInstallation
|
||||
SectionEnd
|
||||
|
||||
; Copy unpacked files from TEMP to the user specified directory
|
||||
Section "!${APP_NAME} (required)" SEC_CORE
|
||||
SectionIn RO
|
||||
CopyFiles /SILENT "$TEMP\PCSX2 ${APP_VERSION}\*" "$INSTDIR\" 24000
|
||||
SectionEnd
|
||||
|
||||
!include "SharedShortcuts.nsh"
|
||||
|
||||
LangString DESC_CORE ${LANG_ENGLISH} "Core components (binaries, documentation, etc)."
|
||||
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)."
|
||||
|
||||
!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)
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
|
@ -1,123 +0,0 @@
|
|||
; Copyright (C) 2017 PCSX2 Team
|
||||
|
||||
; These definitions are shared between the 2 installers (pre-install/portable and full)
|
||||
; This reduces duplicate code throughout both installers.
|
||||
|
||||
!include "FileFunc.nsh"
|
||||
|
||||
ManifestDPIAware true
|
||||
Unicode true
|
||||
ShowInstDetails nevershow
|
||||
ShowUninstDetails nevershow
|
||||
|
||||
SetCompressor /SOLID lzma
|
||||
SetCompressorDictSize 24
|
||||
|
||||
Var UserPrivileges
|
||||
Var IsAdmin
|
||||
|
||||
!ifndef APP_VERSION
|
||||
!define APP_VERSION "1.8.0"
|
||||
!endif
|
||||
|
||||
!define APP_NAME "PCSX2 ${APP_VERSION}"
|
||||
|
||||
; The name of the installer
|
||||
Name "${APP_NAME}"
|
||||
|
||||
!define APP_FILENAME "pcsx2"
|
||||
!define APP_EXE "$INSTDIR\${APP_FILENAME}.exe"
|
||||
|
||||
;===============================
|
||||
; MUI STUFF
|
||||
!include "MUI2.nsh"
|
||||
|
||||
!define MUI_HEADERIMAGE
|
||||
!define MUI_HEADERIMAGE_BITMAP "banner.bmp"
|
||||
!define MUI_COMPONENTSPAGE_SMALLDESC
|
||||
!define MUI_ICON "AppIcon.ico"
|
||||
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\nsis3-uninstall.ico"
|
||||
|
||||
Function IsUserAdmin
|
||||
!include WinVer.nsh
|
||||
# No user should ever have to experience this pain ;)
|
||||
${IfNot} ${AtLeastWinVista}
|
||||
MessageBox MB_OK "Your operating system is unsupported by PCSX2. Please upgrade your operating system or install PCSX2 1.4.0."
|
||||
Quit
|
||||
${ElseIfNot} ${AtLeastWin8.1}
|
||||
MessageBox MB_OK "Your operating system is unsupported by PCSX2. Please upgrade your operating system or install PCSX2 1.6.0."
|
||||
Quit
|
||||
${EndIf}
|
||||
|
||||
UserInfo::GetOriginalAccountType
|
||||
Pop $UserPrivileges
|
||||
|
||||
# GetOriginalAccountType will check the tokens of the original user of the
|
||||
# current thread/process. If the user tokens were elevated or limited for
|
||||
# this process, GetOriginalAccountType will return the non-restricted
|
||||
# account type.
|
||||
# On Windows with UAC, for example, this is not the same value when running
|
||||
# with `RequestExecutionLevel user`. GetOriginalAccountType will return
|
||||
# "admin" while GetAccountType will return "user".
|
||||
;UserInfo::GetOriginalAccountType
|
||||
;Pop $R2
|
||||
|
||||
${If} $UserPrivileges == "Admin"
|
||||
StrCpy $IsAdmin 1
|
||||
${ElseIf} $UserPrivileges == "User"
|
||||
StrCpy $IsAdmin 0
|
||||
${EndIf}
|
||||
FunctionEnd
|
||||
|
||||
Function ShowHelpMessage
|
||||
!define line1 "Command line options:$\r$\n$\r$\n"
|
||||
!define line2 "/S - silent install (must be uppercase)$\r$\n"
|
||||
!define line3 "/D=path\to\install\folder - Change install directory (Must be uppercase, the last option given and no quotes)$\r$\n"
|
||||
!define line4 "/NoStart - Do not create start menu shortcut$\r$\n"
|
||||
!define line5 "/NoDesktop - Do not create desktop shortcut$\r$\n"
|
||||
!define line6 "/Portable- Install in portable mode instead of full install, no effect unless /S is passed as well"
|
||||
MessageBox MB_OK "${line1}${line2}${line3}${line4}${line5}${line6}"
|
||||
Abort
|
||||
FunctionEnd
|
||||
|
||||
Function .onInit
|
||||
Var /GLOBAL cmdLineParams
|
||||
Push $R0
|
||||
${GetParameters} $cmdLineParams
|
||||
ClearErrors
|
||||
|
||||
${GetOptions} $cmdLineParams '/?' $R0
|
||||
IfErrors +2 0
|
||||
Call ShowHelpMessage
|
||||
|
||||
${GetOptions} $cmdLineParams '/H' $R0
|
||||
IfErrors +2 0
|
||||
Call ShowHelpMessage
|
||||
|
||||
Pop $R0
|
||||
|
||||
|
||||
Var /GLOBAL option_startMenu
|
||||
Var /GLOBAL option_desktop
|
||||
Var /GLOBAL option_portable
|
||||
StrCpy $option_startMenu 1
|
||||
StrCpy $option_desktop 1
|
||||
StrCpy $option_portable 0
|
||||
|
||||
Push $R0
|
||||
|
||||
${GetOptions} $cmdLineParams '/NoStart' $R0
|
||||
IfErrors +2 0
|
||||
StrCpy $option_startMenu 0
|
||||
|
||||
${GetOptions} $cmdLineParams '/NoDesktop' $R0
|
||||
IfErrors +2 0
|
||||
StrCpy $option_desktop 0
|
||||
|
||||
${GetOptions} $cmdLineParams '/Portable' $R0
|
||||
IfErrors +2 0
|
||||
StrCpy $option_portable 1
|
||||
|
||||
Pop $R0
|
||||
|
||||
FunctionEnd
|
|
@ -1,15 +0,0 @@
|
|||
Section "Start Menu Shortcuts" SEC_STARTMENU
|
||||
${If} $option_startMenu == 1
|
||||
; CreateShortCut gets the working directory from OutPath
|
||||
SetOutPath "$INSTDIR"
|
||||
CreateShortCut "$SMPROGRAMS\${APP_NAME}.lnk" "${APP_EXE}" "" "${APP_EXE}" 0
|
||||
${EndIf}
|
||||
SectionEnd
|
||||
|
||||
Section "Desktop Shortcut" SEC_DESKTOP
|
||||
${If} $option_desktop == 1
|
||||
; CreateShortCut gets the working directory from OutPath
|
||||
SetOutPath "$INSTDIR"
|
||||
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "${APP_EXE}" "" "${APP_EXE}" 0 "" "" "A PlayStation 2 Emulator"
|
||||
${EndIf}
|
||||
SectionEnd
|
BIN
nsis/banner.bmp
BIN
nsis/banner.bmp
Binary file not shown.
Before Width: | Height: | Size: 27 KiB |
|
@ -1,51 +0,0 @@
|
|||
-------------------------------------
|
||||
PCSX2 NSIS Installer Instructions
|
||||
-------------------------------------
|
||||
|
||||
* Install NSIS (tested with 3.01), make sure to include the "Modern User Interface"
|
||||
*** Make sure "nsDialogs" is checked to be installed in the Plugins group of the NSIS installer.
|
||||
|
||||
* Install the Inetc plugin for NSIS (http://nsis.sourceforge.net/Inetc_plug-in)
|
||||
( Use the Winamp forum link on that page to find the most recent release )
|
||||
|
||||
* Install NSIS Script: Advanced Uninstall Log (you can find it on NSIS wiki)
|
||||
( Currently at http://nsis.sourceforge.net/Advanced_Uninstall_Log_NSIS_Header )
|
||||
|
||||
* If using NSIS 3.0+ (at the current time, the AdvUninst.zip hosted at the NSIS wiki URL above is version 1.0, so please let me know if this changes!)
|
||||
* Locate AdvUninstLog.nsh in "Program Files(x86)\NSIS\Include"
|
||||
* On line 428, change "!undef ID ${__LINE__}" to "!undef ID"
|
||||
|
||||
-----------------------------------------------
|
||||
Building plugins to include in the installer
|
||||
-----------------------------------------------
|
||||
|
||||
* Plugins must be built before running the NSIS script or they will not be included in the installer
|
||||
|
||||
* Load the PCSX2 Suite solution and rebuild all in the following targets:
|
||||
* Release SSE2
|
||||
* Release SSE4
|
||||
* Release AVX2
|
||||
|
||||
-----------------------------
|
||||
Compiling the NSIS scripts
|
||||
-----------------------------
|
||||
|
||||
* Once you have built the required PCSX2 plugins and pcsx2.exe; you are ready to compile! :)
|
||||
|
||||
* Open MakeNSIS.exe and compile both nsi scripts in THIS order:
|
||||
1. pcsx2_full_install.nsi
|
||||
2. pcsx2_shared_init.nsi
|
||||
|
||||
Output executables will be generated to the local git repo; in the "pcsx2/nsis" folder.
|
||||
|
||||
--------------------------------------------
|
||||
Recommendations to Developers
|
||||
--------------------------------------------
|
||||
|
||||
From Air: I use Eclipse to edit NSIS scripts. Do a google search for 'nsis eclipse' and it
|
||||
should take you to the NSIS wiki with instructions on how to set up a NSIS environment in
|
||||
Eclipse. This typically only takes me a few minutes (yes it's really that painless). Via
|
||||
Eclipse you can use F2 and F3 for online help and context help on NSIS commands, and the syntax
|
||||
highlighting is very clean and NSIS-specific. Additionally it'll give you Visual Studio-style
|
||||
hyperlinks for errors during compilation, so that you can simply click on an error and be taken
|
||||
right to the offending line of code. Highly recommended! :)
|
|
@ -1,76 +0,0 @@
|
|||
; PCSX2 Full/Complete Install Package!
|
||||
; (a NSIS installer script)
|
||||
;
|
||||
; Copyright 2009-2017 PCSX2 Dev Team
|
||||
|
||||
!include "SharedDefs.nsh"
|
||||
|
||||
RequestExecutionLevel admin
|
||||
|
||||
; This is the uninstaller name.
|
||||
!define INSTDIR_REG_ROOT "HKLM"
|
||||
!define OUTFILE_POSTFIX "include_standard"
|
||||
|
||||
; The installer name will read as "pcsx2-x.x.x-include_standard"
|
||||
OutFile "pcsx2-${APP_VERSION}-${OUTFILE_POSTFIX}.exe"
|
||||
|
||||
; The default installation directory for the full installer
|
||||
InstallDir "$PROGRAMFILES\PCSX2"
|
||||
|
||||
!define INSTDIR_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_FILENAME}"
|
||||
|
||||
!include "SectionVersionCheck.nsh"
|
||||
|
||||
!insertmacro MUI_PAGE_COMPONENTS
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
|
||||
; RequestExecutionLevel is admin for the full install, so we need to avoid transferring the elevated rights to PCSX2
|
||||
; if the user chooses to run from the installer upon completion.
|
||||
!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
|
||||
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_COMPONENTS
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
|
||||
|
||||
!include "nsDialogs.nsh"
|
||||
!include "ApplyExeProps.nsh"
|
||||
|
||||
Section ""
|
||||
Call UninstallPrevious
|
||||
SectionEnd
|
||||
|
||||
!include "SharedCore.nsh"
|
||||
!include "SectionUninstaller.nsh"
|
||||
|
||||
Section ""
|
||||
|
||||
; Write the installation path into the registry
|
||||
WriteRegStr HKLM Software\PCSX2 "Install_Dir" "$INSTDIR"
|
||||
; Write the uninstall keys for Windows
|
||||
WriteRegStr HKLM "${INSTDIR_REG_KEY}" "DisplayName" "PCSX2 - PlayStation 2 Emulator"
|
||||
WriteRegStr HKLM "${INSTDIR_REG_KEY}" "Publisher" "PCSX2 Team"
|
||||
WriteRegStr HKLM "${INSTDIR_REG_KEY}" "DisplayIcon" "$INSTDIR\pcsx2.exe"
|
||||
WriteRegStr HKLM "${INSTDIR_REG_KEY}" "DisplayVersion" "${APP_VERSION}"
|
||||
WriteRegStr HKLM "${INSTDIR_REG_KEY}" "HelpLink" "https://forums.pcsx2.net"
|
||||
WriteRegStr HKLM "${INSTDIR_REG_KEY}" "UninstallString" "$INSTDIR\Uninst-pcsx2.exe"
|
||||
WriteRegDWORD HKLM "${INSTDIR_REG_KEY}" "NoModify" 1
|
||||
WriteRegDWORD HKLM "${INSTDIR_REG_KEY}" "NoRepair" 1
|
||||
WriteUninstaller "$INSTDIR\Uninst-pcsx2.exe"
|
||||
SectionEnd
|
||||
|
||||
Section "" SID_PCSX2
|
||||
SectionEnd
|
||||
|
||||
; Gives the user a fancy checkbox to run PCSX2 right from the installer!
|
||||
Function ModifyRunCheckbox
|
||||
${IfNot} ${SectionIsSelected} ${SID_PCSX2}
|
||||
SendMessage $MUI.FINISHPAGE.RUN ${BM_SETCHECK} ${BST_UNCHECKED} 0
|
||||
EnableWindow $MUI.FINISHPAGE.RUN 0
|
||||
${EndIf}
|
||||
FunctionEnd
|
|
@ -1,205 +0,0 @@
|
|||
; PCSX2 Pre-Installer Script
|
||||
; Copyright (C) 2019 PCSX2 Team
|
||||
|
||||
!include "SharedDefs.nsh"
|
||||
|
||||
RequestExecutionLevel user
|
||||
|
||||
!define OUTFILE_POSTFIX "setup"
|
||||
OutFile "pcsx2-${APP_VERSION}-${OUTFILE_POSTFIX}.exe"
|
||||
|
||||
; Dialogs and Controls
|
||||
Var PreInstall_Dialog
|
||||
Var PreInstall_DlgBack
|
||||
Var PreInstall_DlgNext
|
||||
|
||||
Var InstallMode_Dialog
|
||||
Var InstallMode_DlgBack
|
||||
Var InstallMode_DlgNext
|
||||
Var InstallMode_Label
|
||||
|
||||
# Normal installer mode (writes to Program Files)
|
||||
Var InstallMode_Normal
|
||||
|
||||
# Portable installer mode
|
||||
Var InstallMode_Portable
|
||||
|
||||
!include "nsDialogs.nsh"
|
||||
|
||||
Page Custom IsUserAdmin
|
||||
Page Custom PreInstallDialog
|
||||
Page Custom InstallMode InstallModeLeave
|
||||
|
||||
; Function located in SharedDefs
|
||||
Section ""
|
||||
Call IsUserAdmin
|
||||
IfSilent 0 +5
|
||||
Call TempFilesOut
|
||||
${If} $option_portable == 0
|
||||
Call StartFullInstaller
|
||||
${EndIf}
|
||||
SectionEnd
|
||||
|
||||
Function PreInstallDialog
|
||||
|
||||
nsDialogs::Create /NOUNLOAD 1018
|
||||
Pop $PreInstall_Dialog
|
||||
|
||||
GetDlgItem $PreInstall_DlgBack $HWNDPARENT 3
|
||||
EnableWindow $PreInstall_DlgBack ${SW_HIDE}
|
||||
|
||||
GetDlgItem $PreInstall_DlgNext $HWNDPARENT 1
|
||||
EnableWindow $PreInstall_DlgNext 0
|
||||
|
||||
${NSD_CreateTimer} NSD_Timer.Callback 1
|
||||
|
||||
nsDialogs::Show
|
||||
FunctionEnd
|
||||
|
||||
Function NSD_Timer.Callback
|
||||
${NSD_KillTimer} NSD_Timer.Callback
|
||||
|
||||
;-----------------------------------------
|
||||
; Copy installer files to a temp directory instead of repacking twice (for each installer)
|
||||
${NSD_CreateLabel} 0 45 80% 10u "Unpacking files. Maybe it's time to upgrade that computer!"
|
||||
Call TempFilesOut
|
||||
${NSD_CreateLabel} 0 45 100% 10u "Moving on"
|
||||
;-----------------------------------------
|
||||
|
||||
Call PreInstall_UsrWait
|
||||
SendMessage $HWNDPARENT ${WM_COMMAND} 1 0
|
||||
FunctionEnd
|
||||
|
||||
Function TempFilesOut
|
||||
SetOutPath "$TEMP\PCSX2 ${APP_VERSION}"
|
||||
File ..\bin\pcsx2.exe
|
||||
File ..\bin\GameIndex.yaml
|
||||
File ..\bin\cheats_ws.zip
|
||||
File ..\bin\PCSX2_keys.ini.default
|
||||
SetOutPath "$TEMP\PCSX2 ${APP_VERSION}\Docs"
|
||||
File ..\bin\docs\*
|
||||
|
||||
SetOutPath "$TEMP\PCSX2 ${APP_VERSION}\Shaders"
|
||||
File ..\bin\shaders\GS.fx
|
||||
File ..\bin\shaders\GS_FX_Settings.ini
|
||||
|
||||
SetOutPath "$TEMP\PCSX2 ${APP_VERSION}\Langs"
|
||||
File /nonfatal /r ..\bin\Langs\*.mo
|
||||
FunctionEnd
|
||||
|
||||
Function PreInstall_UsrWait
|
||||
GetDlgItem $PreInstall_DlgNext $HWNDPARENT 1
|
||||
EnableWindow $PreInstall_DlgNext 1
|
||||
FunctionEnd
|
||||
|
||||
# Creates the first dialog "section" to display a choice of installer modes.
|
||||
Function InstallMode
|
||||
nsDialogs::Create /NOUNLOAD 1018
|
||||
Pop $InstallMode_Dialog
|
||||
|
||||
GetDlgItem $InstallMode_DlgBack $HWNDPARENT 3
|
||||
EnableWindow $InstallMode_DlgBack 0
|
||||
|
||||
GetDlgItem $InstallMode_DlgNext $HWNDPARENT 1
|
||||
EnableWindow $InstallMode_DlgNext 0
|
||||
|
||||
${NSD_CreateLabel} 0 0 100% 10u "Select an installation mode for PCSX2."
|
||||
Pop $InstallMode_Label
|
||||
|
||||
${NSD_CreateRadioButton} 0 35 100% 10u "Normal Installation"
|
||||
Pop $InstallMode_Normal
|
||||
|
||||
# If the user doesn't have admin rights, disable the button for the normal (non-portable) installer
|
||||
${If} $IsAdmin == 0
|
||||
EnableWindow $InstallMode_Normal 0
|
||||
${EndIf}
|
||||
|
||||
# Create labels/buttons for the normal installation
|
||||
${NSD_OnClick} $InstallMode_Normal InstallMode_UsrWait
|
||||
${NSD_CreateLabel} 10 55 100% 20u "PCSX2 will be installed in Program Files unless another directory is specified. User files are stored in the Documents/PCSX2 directory."
|
||||
|
||||
# Create labels/buttons for the portable installation
|
||||
${NSD_CreateRadioButton} 0 95 100% 10u "Portable Installation"
|
||||
Pop $InstallMode_Portable
|
||||
${NSD_OnClick} $InstallMode_Portable InstallMode_UsrWait
|
||||
${NSD_CreateLabel} 10 115 100% 20u "Install PCSX2 to any directory you want. Choose this option if you prefer to have all of your files in the same folder or frequently update PCSX2 through Orphis' Buildbot."
|
||||
|
||||
nsDialogs::Show
|
||||
|
||||
FunctionEnd
|
||||
|
||||
# Disables the "next" button until a selection has been made
|
||||
Function InstallMode_UsrWait
|
||||
GetDlgItem $InstallMode_DlgNext $HWNDPARENT 1
|
||||
EnableWindow $InstallMode_DlgNext 1
|
||||
|
||||
# Displays a UAC shield on the button
|
||||
${NSD_GetState} $InstallMode_Normal $0
|
||||
${NSD_GetState} $InstallMode_Portable $1
|
||||
|
||||
${If} ${BST_CHECKED} == $0
|
||||
SendMessage $InstallMode_DlgNext ${BCM_SETSHIELD} 0 1
|
||||
${Else}
|
||||
SendMessage $InstallMode_DlgNext ${BCM_SETSHIELD} 0 0
|
||||
${EndIf}
|
||||
|
||||
FunctionEnd
|
||||
|
||||
# Runs the elevated installer and quits the current one
|
||||
# If they chose portable mode, the current (unelevated installer)
|
||||
# will still be used.
|
||||
Function InstallModeLeave
|
||||
${NSD_GetState} $InstallMode_Normal $0
|
||||
${NSD_GetState} $InstallMode_Portable $1
|
||||
|
||||
${If} ${BST_CHECKED} == $0
|
||||
Call StartFullInstaller
|
||||
${EndIf}
|
||||
FunctionEnd
|
||||
|
||||
Function StartFullInstaller
|
||||
;Checks if install directory is changed from default with /D, and if not, changes to standard full install directory.
|
||||
${If} $INSTDIR == "$DOCUMENTS\PCSX2 ${APP_VERSION}"
|
||||
StrCpy $INSTDIR "$PROGRAMFILES\PCSX2"
|
||||
${EndIf}
|
||||
SetOutPath "$TEMP"
|
||||
File "pcsx2-${APP_VERSION}-include_standard.exe"
|
||||
ExecShell open "$TEMP\pcsx2-${APP_VERSION}-include_standard.exe" "$cmdLineParams /D=$INSTDIR"
|
||||
Quit
|
||||
FunctionEnd
|
||||
|
||||
; ----------------------------------
|
||||
; Portable Install Section
|
||||
; ----------------------------------
|
||||
!insertmacro MUI_PAGE_COMPONENTS
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
|
||||
!define MUI_FINISHPAGE_RUN "$INSTDIR\pcsx2.exe"
|
||||
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ModifyRunCheckbox
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
!include "ApplyExeProps.nsh"
|
||||
|
||||
; The default installation directory for the portable binary.
|
||||
InstallDir "$DOCUMENTS\PCSX2 ${APP_VERSION}"
|
||||
|
||||
; Path references for the core files here
|
||||
!include "SharedCore.nsh"
|
||||
|
||||
Section "" INST_PORTABLE
|
||||
SetOutPath "$INSTDIR"
|
||||
File portable.ini
|
||||
RMDir /r "$TEMP\PCSX2 ${APP_VERSION}"
|
||||
SectionEnd
|
||||
|
||||
Section "" SID_PCSX2
|
||||
SectionEnd
|
||||
|
||||
# Gives the user a fancy checkbox to run PCSX2 right from the installer!
|
||||
Function ModifyRunCheckbox
|
||||
${IfNot} ${SectionIsSelected} ${SID_PCSX2}
|
||||
SendMessage $MUI.FINISHPAGE.RUN ${BM_SETCHECK} ${BST_UNCHECKED} 0
|
||||
EnableWindow $MUI.FINISHPAGE.RUN 0
|
||||
${EndIf}
|
||||
FunctionEnd
|
Loading…
Reference in New Issue