Select the correct plugin in the Installer, based on Windows version

This commit is contained in:
Ken Cooke 2016-10-03 21:46:55 -07:00
parent eb5b03d008
commit 541f7ebb05

View file

@ -23,6 +23,11 @@
;Default installation folder
InstallDir "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
;--------------------------------
;Include WinVer to get Windows version
!include "WinVer.nsh"
;--------------------------------
;General
; leverage the UAC NSIS plugin to promote uninstaller to elevated privileges
@ -600,6 +605,19 @@ Section "-Core installation"
Delete "$INSTDIR\version"
Delete "$INSTDIR\xinput1_3.dll"
; The installer includes two different Qt audio plugins.
; On Windows 8 and above, only qtaudio_wasapi.dll should be installed.
; On Windows 7 and below, only qtaudio_windows.dll should be installed.
${If} ${AtLeastWin8}
Delete "$INSTDIR\audio\qtaudio_windows.dll"
Delete "$INSTDIR\audio\qtaudio_windows.pdb"
MessageBox MB_OK "Detected Windows 8+"
${Else}
Delete "$INSTDIR\audio\qtaudio_wasapi.dll"
Delete "$INSTDIR\audio\qtaudio_wasapi.pdb"
MessageBox MB_OK "Detected Windows 7-"
${EndIf}
; Delete old desktop shortcuts before they were renamed during Sandbox rename
Delete "$DESKTOP\@PRE_SANDBOX_INTERFACE_SHORTCUT_NAME@.lnk"
Delete "$DESKTOP\@PRE_SANDBOX_CONSOLE_SHORTCUT_NAME@.lnk"