From d444353c5f3ac4006bf841b2855fe0ae6e308918 Mon Sep 17 00:00:00 2001 From: jackeri Date: Tue, 3 Jun 2014 17:04:31 +0300 Subject: [PATCH] added the vcredist installation if needed --- nsis/etlegacy.nsi | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/nsis/etlegacy.nsi b/nsis/etlegacy.nsi index c2bdf9d..1893733 100644 --- a/nsis/etlegacy.nsi +++ b/nsis/etlegacy.nsi @@ -8,7 +8,7 @@ ; - the ET:Legacy binary files in a "etlegacy-windows-${VERSION}" subfolder without Omni-bot files. ; Change the version number below. You don't need to change anything else. -!define VERSION "2.71rc3" +!define VERSION "2.71rc4" ; ------------------------ ; GENERAL @@ -73,6 +73,8 @@ Section "Enemy Territory: Legacy" FILES File /r "etlegacy-windows-${VERSION}\*.*" SimpleFC::AddApplication "ET:Legacy" "$INSTDIR\etl.exe" 0 2 "" 1 SimpleFC::AddApplication "ET:Legacy server" "$INSTDIR\etlded.exe" 0 2 "" 1 + ; If we compile with /MT we will not need to install the redist + ; Call InstallVC SectionEnd Section "Wolfenstein: Enemy Territory assets" ASSETS @@ -268,6 +270,28 @@ Section -Post WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninstall.exe" SectionEnd +; Functions +Function InstallVC + Push $R0 + ; TODO: Fix clsid:s to match 2013 VS version + ClearErrors + ReadRegDword $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9A25302D-30C0-39D9-BD6F-21E6EC160475}" "Version" + IfErrors 0 VSRedistInstalled + ClearErrors + ReadRegDword $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{86CE1746-9EFF-3C9C-8755-81EA8903AC34}" "Version" + IfErrors 0 VSRedistInstalled + ; Maybe we should just install it and not even comfirm? + MessageBox MB_ICONQUESTION|MB_YESNO "ET:Legacy requires MS VC++ 2013 Redistributable, do you want to install it ?" IDNO VSRedistInstalled + File /nonfatal "vcredist\vcredist_x86.exe" + ; we either use /quiet or /passive quiet shows nothing and passive show minimal UI with no user interactions + ; /nostart do not popup a restart window, we does not want it and we does not need it my precious! + ExecWait '"$INSTDIR\vcredist_x86.exe" /passive /norestart' + VSRedistInstalled: + Exch $R0 + + Delete "$INSTDIR\vcredist_x86.exe" +FunctionEnd + ; Section descriptions !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${FILES} "Install Enemy Territory: Legacy files."