DXGL r200 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r199‎ | r200 | r201 >
Date:14:46, 5 July 2012
Author:admin
Status:new
Tags:
Comment:
Move Visual C++ redist to components page of installer. Show only if uninstalled.
Modified paths:
  • /Installer/dxgl.nsi (modified) (history)

Diff [purge]

Index: Installer/dxgl.nsi
@@ -25,6 +25,8 @@
2626 !insertmacro MUI_PAGE_WELCOME
2727 ; License page
2828 !insertmacro MUI_PAGE_LICENSE "..\COPYING.txt"
 29+; Components page
 30+!insertmacro MUI_PAGE_COMPONENTS
2931 ; Directory page
3032 !insertmacro MUI_PAGE_DIRECTORY
3133 ; Instfiles page
@@ -43,7 +45,6 @@
4446
4547 ; MUI end ------
4648
47 -
4849 !define HKEY_CURRENT_USER 0x80000001
4950 !define RegOpenKeyEx "Advapi32::RegOpenKeyEx(i, t, i, i, *i) i"
5051 !define RegQueryValueEx "Advapi32::RegQueryValueEx(i, t, i, *i, i, *i) i"
@@ -71,7 +72,8 @@
7273 VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "DXGL"
7374 VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "${PRODUCT_VERSION}"
7475
75 -Section "MainSection" SEC01
 76+Section "DXGL Components (required)" SEC01
 77+ SectionIn RO
7678 SetOutPath "$INSTDIR"
7779 SetOverwrite ifnewer
7880 File "..\Release\dxgltest.exe"
@@ -151,19 +153,16 @@
152154 regdone:
153155 SetPluginUnload manual
154156 ReadRegDWORD $0 HKLM SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86 Installed
155 - StrCmp $0 1 skipvcredist
156 - MessageBox MB_YESNO|MB_ICONQUESTION "The Microsoft Visual C++ 2010 Runtime does not seem to be installed. Do you want to download and install it now?" IDNO novc
 157+ WriteRegStr HKLM "Software\DXGL" "InstallDir" "$INSTDIR"
 158+ ExecWait '"$INSTDIR\dxgltest.exe" install'
 159+SectionEnd
 160+
 161+Section "Visual C++ 2010 Redistributable" SEC_VCREDIST
157162 DetailPrint "Downloading Visual C++ 2010 Runtime"
158163 NSISdl::download http://www.williamfeely.info/download/vc10/vcredist_x86.exe $TEMP\vcredist_x86.exe
159164 DetailPrint "Installing Visual C++ 2010 Runtime"
160165 ExecWait '"$TEMP\vcredist_x86.exe" /q /norestart'
161166 Delete $TEMP\vcredist_x86.exe
162 - goto skipvcredist
163 - novc:
164 - MessageBox MB_OK|MB_ICONEXCLAMATION "DXGL will not work if the Visual C++ 2010 Runtime is not installed. Please install the Visual C++ 2010 Runtime before running DXGL."
165 - skipvcredist:
166 - WriteRegStr HKLM "Software\DXGL" "InstallDir" "$INSTDIR"
167 - ExecWait '"$INSTDIR\dxgltest.exe" install'
168167 SectionEnd
169168
170169 Section -AdditionalIcons
@@ -184,6 +183,18 @@
185184 SectionEnd
186185
187186
 187+
 188+Function .onInit
 189+ ReadRegDWORD $0 HKLM SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86 Installed
 190+ StrCmp $0 1 skipvcredist
 191+ goto vcinstall
 192+ skipvcredist:
 193+ SectionSetFlags ${SEC_VCREDIST} 0
 194+ SectionSetText ${SEC_VCREDIST} ""
 195+ vcinstall:
 196+FunctionEnd
 197+
 198+
188199 Function un.onUninstSuccess
189200 HideWindow
190201 MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."