Block installation on XP/fix an uninstaller regression and add ManifestDPIAware to the installer. Remove NSIS dirs from .gitignore.

Typo ;)

Remove XPStyle parameter. It isn't needed anymore

Updated copyright, added ManifestDPIAware for rich folks, removed IDOK true and Cheats folder from $INSTDIR as Turtleli suggested, formatting adjustments.

Gitignore: remove now unused NSIS directories

Fixed a nasty regression I introduced after a registry pointer was assumed to be incorrect. It contained UserMode data generated by the First Time Wizard. This was causing conflicts and the FTW to fail randomly when running PCSX2 after a reinstall due to old configuration data being read.

I added clarifcation below the original comment to reduce confusion in the future.
This commit is contained in:
Christian Kenny 2016-12-29 15:20:52 -05:00 committed by Gregory Hainaut
parent 5298c2016f
commit 732dc881e4
6 changed files with 105 additions and 135 deletions

8
.gitignore vendored
View File

@ -76,7 +76,6 @@ oprofile_data/
/bin/sstates /bin/sstates
/deps /deps
/ipch /ipch
/nsis/output/
!/3rdparty/libjpeg/change.log !/3rdparty/libjpeg/change.log
/3rdparty/portaudio/portaudio-2.0.pc /3rdparty/portaudio/portaudio-2.0.pc
@ -95,13 +94,6 @@ oprofile_data/
/3rdparty/portaudio/src/hostapi/wasapi/mingw-include /3rdparty/portaudio/src/hostapi/wasapi/mingw-include
/3rdparty/**/include/wx/setup.h /3rdparty/**/include/wx/setup.h
/3rdparty/**/wx/msw/rcdefs.h /3rdparty/**/wx/msw/rcdefs.h
/nsis/svnrev_cdvdiso.nsh
/nsis/svnrev_gsdx.nsh
/nsis/svnrev_lilypad.nsh
/nsis/svnrev_pcsx2.nsh
/nsis/svnrev_spu2x.nsh
/nsis/svnrev_zerogs.nsh
/nsis/svnrev_zerospu2.nsh
/pcsx2/gui/Resources/*.h /pcsx2/gui/Resources/*.h
!/pcsx2/gui/Resources/EmbeddedImage.h !/pcsx2/gui/Resources/EmbeddedImage.h
/plugins/CDVDolio/Template /plugins/CDVDolio/Template

View File

@ -6,7 +6,7 @@
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APP_NAME}" VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APP_NAME}"
;VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "A test comment" ;VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "A test comment"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "© 2016 PCSX2 Dev Team" VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "© 2017 PCSX2 Dev Team"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Installs PCSX2, a Playstation 2 Emulator for the PC." VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Installs PCSX2, a Playstation 2 Emulator for the PC."
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${APP_VERSION}" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${APP_VERSION}"

View File

@ -18,7 +18,7 @@
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
!insertmacro UNINSTALL.LOG_OPEN_INSTALL !insertmacro UNINSTALL.LOG_OPEN_INSTALL
File ..\bin\pcsx2.exe File ..\bin\pcsx2.exe
;File /nonfatal ..\bin\pcsx2-dev.exe ;File /nonfatal ..\bin\pcsx2-dev.exe
; ------------------------------------------ ; ------------------------------------------
@ -26,39 +26,30 @@
; ------------------------------------------ ; ------------------------------------------
; (Binaries, shared DLLs, null plugins, game database, languages, etc) ; (Binaries, shared DLLs, null plugins, game database, languages, etc)
File ..\bin\GameIndex.dbf File ..\bin\GameIndex.dbf
File ..\bin\cheats_ws.zip File ..\bin\cheats_ws.zip
File ..\bin\PCSX2_keys.ini.default File ..\bin\PCSX2_keys.ini.default
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
;/bin/Cheats needs CreateDirectory to prevent MakeNSIS from failing due to the folder being empty
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
CreateDirectory "$INSTDIR\Cheats"
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
SetOutPath "$INSTDIR\Docs" SetOutPath "$INSTDIR\Docs"
!insertmacro UNINSTALL.LOG_OPEN_INSTALL !insertmacro UNINSTALL.LOG_OPEN_INSTALL
File ..\bin\docs\* File ..\bin\docs\*
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
SetOutPath "$INSTDIR\Shaders" SetOutPath "$INSTDIR\Shaders"
!insertmacro UNINSTALL.LOG_OPEN_INSTALL !insertmacro UNINSTALL.LOG_OPEN_INSTALL
File ..\bin\shaders\* File ..\bin\shaders\*
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
SetOutPath "$INSTDIR\Plugins" SetOutPath "$INSTDIR\Plugins"
!insertmacro UNINSTALL.LOG_OPEN_INSTALL !insertmacro UNINSTALL.LOG_OPEN_INSTALL
; NULL plugins are required, because the PCSX2 plugin selector needs a dummy plugin in every slot ; NULL plugins are required, because the PCSX2 plugin selector needs a dummy plugin in every slot
; in order to run (including CDVD!) -- and really there should be more but we don't have working ; in order to run (including CDVD!)
; SPU2 null plugins right now.
;File ..\bin\Plugins\GSnull.dll
;File ..\bin\Plugins\SPU2null.dll
File ..\bin\Plugins\USBnull.dll File ..\bin\Plugins\USBnull.dll
File ..\bin\Plugins\DEV9null.dll File ..\bin\Plugins\DEV9null.dll
File ..\bin\Plugins\FWnull.dll File ..\bin\Plugins\FWnull.dll
;File ..\bin\Plugins\CDVDnull.dll
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL !insertmacro UNINSTALL.LOG_CLOSE_INSTALL

View File

@ -7,9 +7,11 @@ Function .onInit
;prepare Advanced Uninstall log always within .onInit function ;prepare Advanced Uninstall log always within .onInit function
!insertmacro UNINSTALL.LOG_PREPARE_INSTALL !insertmacro UNINSTALL.LOG_PREPARE_INSTALL
; MORE UAC HELL ---------- > !include WinVer.nsh
;call IsUserAdmin ${IfNot} ${AtLeastWinVista}
MessageBox MB_OK "Your operating system is unsupported by PCSX2. Please upgrade your operating system or install PCSX2 1.4.0."
Quit
${EndIf}
FunctionEnd FunctionEnd
Function .onInstSuccess Function .onInstSuccess
@ -69,6 +71,11 @@ Section "Un.Program and Plugins ${APP_NAME}"
; otherwise, pcsx2 will be "confused" if it's re-installed later. ; otherwise, pcsx2 will be "confused" if it's re-installed later.
DeleteRegKey HKLM Software\PCSX2 DeleteRegKey HKLM Software\PCSX2
; Please note that pointing to HKCU here is intentional. It is the only key generated by PCSX2 and *not* NSIS!
; The key stores configuration data used by the First Time Wizard (check AppConfig.cpp for details) such as DocumentsFolderMode, ect.
; Failure to delete this key can result in configuration errors
DeleteRegKey HKCU Software\PCSX2
!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR" !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR"
; Remove uninstaller info reg key ( Wow6432Node on 64bit Windows! ) ; Remove uninstaller info reg key ( Wow6432Node on 64bit Windows! )
@ -79,7 +86,6 @@ Section "Un.Program and Plugins ${APP_NAME}"
!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\Langs" !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\Langs"
!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\Plugins" !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\Plugins"
!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\Docs" !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\Docs"
!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\Cheats"
!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\Shaders" !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\Shaders"
; Remove files and registry key that store PCSX2 paths configurations ; Remove files and registry key that store PCSX2 paths configurations
SetShellVarContext current SetShellVarContext current

View File

@ -27,8 +27,6 @@
!define INSTDIR_REG_ROOT "HKLM" !define INSTDIR_REG_ROOT "HKLM"
XPStyle on
; LZMA is the best, by far, so let's make sure it's always in use: ; LZMA is the best, by far, so let's make sure it's always in use:
; (dictionaries larger than 24MB don't seem to help) ; (dictionaries larger than 24MB don't seem to help)
SetCompressor /SOLID lzma SetCompressor /SOLID lzma

View File

@ -5,15 +5,13 @@
; Copyright 2009-2016 PCSX2 Dev Team ; Copyright 2009-2016 PCSX2 Dev Team
; ;
!ifndef INC_LANGS
!define INC_LANGS 1
!endif
!ifndef INC_CRT_2015 !ifndef INC_CRT_2015
; Set to 0 to disable inclusion of Visual Studio 2013 SP1 CRT Redists ; Set to 0 to disable inclusion of Visual Studio 2013 SP1 CRT Redists
!define INC_CRT_2015 1 !define INC_CRT_2015 1
!endif !endif
ManifestDPIAware true
ShowInstDetails nevershow ShowInstDetails nevershow
ShowUninstDetails nevershow ShowUninstDetails nevershow
@ -46,7 +44,6 @@ ShowUninstDetails nevershow
!insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "English"
!include "ApplyExeProps.nsh" !include "ApplyExeProps.nsh"
!include "SharedRedtape.nsh"
; ======================================================================= ; =======================================================================
; Installer Sections ; Installer Sections
@ -57,62 +54,61 @@ ShowUninstDetails nevershow
; The "" makes the section hidden. ; The "" makes the section hidden.
Section "" SecUninstallPrevious Section "" SecUninstallPrevious
Call UninstallPrevious Call UninstallPrevious
SectionEnd SectionEnd
Function UninstallPrevious Function UninstallPrevious
;Check for uninstaller. ;Check for uninstaller.
ReadRegStr $R0 HKLM "${INSTDIR_REG_KEY}" "UninstallString" ReadRegStr $R0 HKLM "${INSTDIR_REG_KEY}" "UninstallString"
${If} $R0 == "" ${If} $R0 == ""
Goto Done Goto Done
${EndIf} ${EndIf}
;Check if any other version is installed ;Check if any other version is installed
ReadRegStr $R1 HKLM "${INSTDIR_REG_KEY}" "InstalledVersion" ReadRegStr $R1 HKLM "${INSTDIR_REG_KEY}" "InstalledVersion"
;This check for older versions (pre 1.6.0) without InstalledVersion string will bypass this section ;This check for older versions (pre 1.6.0) without InstalledVersion string will bypass this section
${If} $R1 == "" ${If} $R1 == ""
DetailPrint "InstalledVersion string not found, skipping version check" DetailPrint "InstalledVersion string not found, skipping version check"
Goto Done Goto Done
${EndIf} ${EndIf}
;Installing same version ;Installing same version
${If} $R1 S== ${APP_VERSION} ${If} $R1 S== ${APP_VERSION}
MessageBox MB_ICONEXCLAMATION|MB_OKCANCEL "This version of PCSX2 is already installed. Do you want to continue?" IDOK true IDCANCEL false MessageBox MB_ICONEXCLAMATION|MB_OKCANCEL "This version of PCSX2 is already installed. Do you want to continue?" IDCANCEL false
true: DetailPrint "Overwriting current install"
DetailPrint "Overwriting current install" Goto Done
Goto Done false:
false: Quit
Quit ${Else}
${Else} DetailPrint "Not the same version"
DetailPrint "Not the same version" ${EndIf}
${EndIf}
;Installing newer version (and old version is detected) ;Installing newer version (and old version is detected)
${If} $R1 S< ${APP_VERSION} ${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 MessageBox MB_ICONEXCLAMATION|MB_OKCANCEL "An older version of PCSX2 is installed. Do you want to uninstall it?" IDOK true2 IDCANCEL false2
true2: true2:
DetailPrint "Uninstalling old PCSX2 version" DetailPrint "Uninstalling old PCSX2 version"
Goto Next Goto Next
false2: false2:
Quit Quit
${Else} ${Else}
DetailPrint "Not installing a new version" DetailPrint "Not installing a new version"
${EndIf} ${EndIf}
;Run the uninstaller silently. ;Run the uninstaller silently.
Next: Next:
DetailPrint "Running silent uninstall" DetailPrint "Running silent uninstall"
;Copy files to a temp dir to prevent conflicts when removing $INSTDIR/uninstaller ;Copy files to a temp dir to prevent conflicts when removing $INSTDIR/uninstaller
ReadRegStr $R2 HKLM Software\PCSX2 "Install_Dir" ReadRegStr $R2 HKLM Software\PCSX2 "Install_Dir"
CreateDirectory "$TEMP\pcsx2_uninst_temp" CreateDirectory "$TEMP\pcsx2_uninst_temp"
CopyFiles /SILENT /FILESONLY "$R2\uninst-pcsx2.exe" "$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' ExecWait '"$TEMP\pcsx2_uninst_temp\uninst-pcsx2.exe" /S _?=$R2'
RMDir /r $TEMP\pcsx2_uninst_temp RMDir /r $TEMP\pcsx2_uninst_temp
Done: Done:
FunctionEnd FunctionEnd
@ -136,17 +132,11 @@ Section "!${APP_NAME} (required)" SEC_CORE
File /nonfatal ..\bin\Plugins\gsdx32-ssse3.dll File /nonfatal ..\bin\Plugins\gsdx32-ssse3.dll
File /nonfatal ..\bin\Plugins\gsdx32-sse4.dll File /nonfatal ..\bin\Plugins\gsdx32-sse4.dll
File /nonfatal ..\bin\Plugins\gsdx32-avx.dll File /nonfatal ..\bin\Plugins\gsdx32-avx.dll
File /nonfatal ..\bin\Plugins\gsdx32-avx2.dll File /nonfatal ..\bin\Plugins\gsdx32-avx2.dll
;File /nonfatal ..\bin\Plugins\zerogs.dll
File /nonfatal ..\bin\Plugins\spu2-x.dll File /nonfatal ..\bin\Plugins\spu2-x.dll
;File /nonfatal ..\bin\Plugins\zerospu2.dll File /nonfatal ..\bin\Plugins\cdvdGigaherz.dll
;File /nonfatal ..\bin\Plugins\cdvdiso.dll
File ..\bin\Plugins\cdvdGigaherz.dll
File /nonfatal ..\bin\Plugins\lilypad.dll File /nonfatal ..\bin\Plugins\lilypad.dll
File /nonfatal ..\bin\Plugins\padPokopom.dll File /nonfatal ..\bin\Plugins\padPokopom.dll
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
@ -157,14 +147,11 @@ SectionEnd
!include "SectionShortcuts.nsh" !include "SectionShortcuts.nsh"
Section "Additional Languages" SEC_LANGS Section "Additional Languages" SEC_LANGS
!if ${INC_LANGS} > 0 SetOutPath $INSTDIR\Langs
SetOutPath $INSTDIR\Langs !insertmacro UNINSTALL.LOG_OPEN_INSTALL
!insertmacro UNINSTALL.LOG_OPEN_INSTALL File /nonfatal /r ..\bin\Langs\*.mo
File /nonfatal /r ..\bin\Langs\*.mo !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL SectionEnd
!endif
SectionEnd
SectionGroup "DirectX Packages (required for PCSX2)" SEC_DXPACKS SectionGroup "DirectX Packages (required for PCSX2)" SEC_DXPACKS
!if ${INC_CRT_2015} > 0 !if ${INC_CRT_2015} > 0
@ -234,9 +221,9 @@ LangString DESC_CORE ${LANG_ENGLISH} "Core components (binaries, plugins,
LangString DESC_STARTMENU ${LANG_ENGLISH} "Adds shortcuts for PCSX2 to the start menu (all users)." 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)." LangString DESC_DESKTOP ${LANG_ENGLISH} "Adds a shortcut for PCSX2 to the desktop (all users)."
LangString DESC_LANGS ${LANG_ENGLISH} "Adds additional languages other than the system default to PCSX2." LangString DESC_LANGS ${LANG_ENGLISH} "Adds additional languages other than the system default to PCSX2."
LangString DESC_DXPACKS ${LANG_ENGLISH} "Installs the Visual C++ Redistributable and DirectX SDK" LangString DESC_DXPACKS ${LANG_ENGLISH} "Installs the Visual C++ Redistributable and DirectX SDK"
LangString DESC_CRT2015 ${LANG_ENGLISH} "Required by the PCSX2 binaries packaged in this installer." LangString DESC_CRT2015 ${LANG_ENGLISH} "Required by the PCSX2 binaries packaged in this installer."
LangString DESC_DIRECTX ${LANG_ENGLISH} "Only uncheck this if you are quite certain your Direct3D runtimes are up to date." LangString DESC_DIRECTX ${LANG_ENGLISH} "Only uncheck this if you are quite certain your Direct3D runtimes are up to date."
@ -244,12 +231,8 @@ LangString DESC_DIRECTX ${LANG_ENGLISH} "Only uncheck this if you are quite c
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_CORE} $(DESC_CORE) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_CORE} $(DESC_CORE)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_STARTMENU} $(DESC_STARTMENU) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_STARTMENU} $(DESC_STARTMENU)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_DESKTOP} $(DESC_DESKTOP) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_DESKTOP} $(DESC_DESKTOP)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LANGS} $(DESC_LANGS)
!if ${INC_LANGS} > 0 !insertmacro MUI_DESCRIPTION_TEXT ${SEC_DXPACKS} $(DESC_DXPACKS)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LANGS} $(DESC_LANGS)
!endif
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_DXPACKS} $(DESC_DXPACKS)
!if ${INC_CRT_2015} > 0 !if ${INC_CRT_2015} > 0
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_CRT2015} $(DESC_CRT2015) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_CRT2015} $(DESC_CRT2015)
@ -264,7 +247,7 @@ SectionEnd
Function ModifyRunCheckbox Function ModifyRunCheckbox
${IfNot} ${SectionIsSelected} ${SID_PCSX2} ${IfNot} ${SectionIsSelected} ${SID_PCSX2}
SendMessage $MUI.FINISHPAGE.RUN ${BM_SETCHECK} ${BST_UNCHECKED} 0 SendMessage $MUI.FINISHPAGE.RUN ${BM_SETCHECK} ${BST_UNCHECKED} 0
EnableWindow $MUI.FINISHPAGE.RUN 0 EnableWindow $MUI.FINISHPAGE.RUN 0
${EndIf} ${EndIf}
FunctionEnd FunctionEnd