From 3b5bd4ef5082e109cfa057d4507dbe092fdc6003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Mon, 5 Aug 2013 11:41:09 +0200 Subject: [PATCH] Automatically install DirectX when it's not installed. Please test on machines without installed DirectX. --- Installer/installer.nsi | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Installer/installer.nsi b/Installer/installer.nsi index 23350f52..f623cce7 100644 --- a/Installer/installer.nsi +++ b/Installer/installer.nsi @@ -114,6 +114,21 @@ Section $(TITLE_MAIN) SecMain File "..\Output\*.txt" File "..\Output\CreditsRessourcesDB.sqlite" + ReadRegStr $0 HKLM "SOFTWARE\Microsoft\DirectX" "Version" + StrCpy $1 $0 4 3 + ${If} $1 < 9 + SetOutPath "$TEMP" + File "Requirements\dxwebsetup.exe" + DetailPrint "Running DirectX Setup..." + ExecWait '"$TEMP\dxwebsetup.exe" /Q' $DirectXSetupError + DetailPrint "Finished DirectX Setup" + + Delete "$TEMP\dxwebsetup.exe" + + SetOutPath "$INSTDIR" + ${EndIf} + + ${IfNot} ${HasDotNet4.0} SetOutPath "$TEMP" File "Requirements\dotNetFx40_Full_setup.exe" @@ -185,20 +200,6 @@ Section $(TITLE_bg_videos) SecVideos SectionEnd -Section $(TITLE_directx) SecDirectX - - SetOutPath "$TEMP" - File "Requirements\dxwebsetup.exe" - DetailPrint "Running DirectX Setup..." - ExecWait '"$TEMP\dxwebsetup.exe" /Q' $DirectXSetupError - DetailPrint "Finished DirectX Setup" - - Delete "$TEMP\dxwebsetup.exe" - - SetOutPath "$INSTDIR" - -SectionEnd - ;-------------------------------- ;Installer Functions