DXGL r208 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r207‎ | r208 | r209 >
Date:01:25, 9 July 2012
Author:admin
Status:new
Tags:
Comment:
Fix installer building. Add debug installer.
Modified paths:
  • /Installer/dxgl.nsi (modified) (history)
  • /buildtool/buildtool.cpp (modified) (history)
  • /common/version.nsh.in (modified) (history)

Diff [purge]

Index: Installer/dxgl.nsi
@@ -14,6 +14,13 @@
1515 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
1616 !include "..\common\version.nsh"
1717
 18+!ifdef _DEBUG
 19+!define SRCDIR "Debug"
 20+!else
 21+!define SRCDIR "Release"
 22+!endif
 23+
 24+
1825 ; MUI2
1926 !include "MUI2.nsh"
2027
@@ -58,7 +65,11 @@
5966 !define GetVersion "Kernel32::GetVersion() i"
6067 Var SUBKEY
6168
 69+!ifdef _DEBUG
 70+Name "${PRODUCT_NAME} ${PRODUCT_VERSION} DEBUG BUILD"
 71+!else
6272 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
 73+!endif
6374 OutFile "DXGL-${PRODUCT_VERSION}-win32.exe"
6475 InstallDir "$PROGRAMFILES\DXGL"
6576 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
@@ -65,7 +76,7 @@
6677 ShowInstDetails show
6778 ShowUnInstDetails show
6879
69 -VIProductVersion "${PRODUCT_VERSION}.0"
 80+VIProductVersion "${PRODUCT_VERSION}.${PRODUCT_REVISION}"
7081 VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "DXGL ${PRODUCT_VERSION} Installer"
7182 VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${PRODUCT_VERSION}"
7283 VIAddVersionKey /LANG=${LANG_ENGLISH} "InternalName" "DXGL"
@@ -78,12 +89,12 @@
7990 SectionIn RO
8091 SetOutPath "$INSTDIR"
8192 SetOverwrite ifnewer
82 - File "..\Release\dxgltest.exe"
 93+ File "..\${SRCDIR}\dxgltest.exe"
8394 CreateDirectory "$SMPROGRAMS\DXGL"
8495 CreateShortCut "$SMPROGRAMS\DXGL\DXGL Test.lnk" "$INSTDIR\dxgltest.exe"
85 - File "..\Release\dxglcfg.exe"
 96+ File "..\${SRCDIR}\dxglcfg.exe"
8697 CreateShortCut "$SMPROGRAMS\DXGL\Configure DXGL.lnk" "$INSTDIR\dxglcfg.exe"
87 - File "..\Release\ddraw.dll"
 98+ File "..\${SRCDIR}\ddraw.dll"
8899 File "..\ReadMe.txt"
89100 File "..\COPYING.txt"
90101 File "..\Help\dxgl.chm"
@@ -153,11 +164,11 @@
154165 goto regloop
155166 regdone:
156167 SetPluginUnload manual
157 - ReadRegDWORD $0 HKLM SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86 Installed
158168 WriteRegStr HKLM "Software\DXGL" "InstallDir" "$INSTDIR"
159 - ExecWait '"$INSTDIR\dxgltest.exe" install'
 169+ ExecWait '"$INSTDIR\dxgltest.exe" instaill'
160170 SectionEnd
161171
 172+!ifndef _DEBUG
162173 Section "Download Visual C++ 2010 Redistributable" SEC_VCREDIST
163174 DetailPrint "Downloading Visual C++ 2010 Runtime"
164175 NSISdl::download http://www.williamfeely.info/download/vc10/vcredist_x86.exe $TEMP\vcredist_x86.exe
@@ -165,6 +176,7 @@
166177 ExecWait '"$TEMP\vcredist_x86.exe" /q /norestart'
167178 Delete $TEMP\vcredist_x86.exe
168179 SectionEnd
 180+!endif
169181
170182 Section "Fix DDraw COM registration" SEC_COMFIX
171183 DetailPrint "Setting DDraw Runtime path in registry"
@@ -199,6 +211,10 @@
200212
201213
202214 Function .onInit
 215+ !ifdef _DEBUG
 216+ MessageBox MB_OK|MB_ICONEXCLAMATION "This is a debug build of DXGL. It is not meant for regular \
 217+ usage and requires the debug version of the Visual C++ runtime to work."
 218+ !else
203219 ReadRegDWORD $0 HKLM SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86 Installed
204220 StrCmp $0 1 skipvcredist
205221 goto vcinstall
@@ -206,6 +222,7 @@
207223 SectionSetFlags ${SEC_VCREDIST} 0
208224 SectionSetText ${SEC_VCREDIST} ""
209225 vcinstall:
 226+ !endif
210227
211228 System::Call "${GetVersion} () .r0"
212229 IntOp $1 $0 & 255
Index: buildtool/buildtool.cpp
@@ -160,7 +160,7 @@
161161 {
162162 if(revision)
163163 {
164 - strcpy(verbuffer,"\"r");
 164+ strcpy(verbuffer,"\"");
165165 _itoa(revision,numstring,10);
166166 strcat(verbuffer,numstring);
167167 strcat(verbuffer,"\"\n");
@@ -169,7 +169,7 @@
170170 else strncpy(findptr,"\"\"\n",17);
171171 }
172172 #ifdef _DEBUG
173 - if(strstr(buffer,";!define DEBUG")) strcpy(buffer,"!define DEBUG");
 173+ if(strstr(buffer,";!define _DEBUG")) strcpy(buffer,"!define _DEBUG");
174174 #endif
175175 fputs(buffer,fileout);
176176 }
Index: common/version.nsh.in
@@ -1,3 +1,3 @@
22 !define PRODUCT_VERSION $PRODUCTVERSTRING
33 !define PRODUCT_REVISION $PRODUCTREVISION
4 -;!define DEBUG
\ No newline at end of file
 4+;!define _DEBUG
\ No newline at end of file