DXGL r13 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r12‎ | r13 | r14 >
Date:17:40, 27 November 2011
Author:admin
Status:new
Tags:
Comment:
Delete ddraw.dll from installed folders on uninstall
Modified paths:
  • /Installer/dxgl.nsi (modified) (history)

Diff [purge]

Index: Installer/dxgl.nsi
@@ -188,5 +188,71 @@
189189
190190 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
191191 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
 192+
 193+ StrCpy $8 0
 194+ SetPluginUnload alwaysoff
 195+ regloop:
 196+ EnumRegKey $SUBKEY HKCU "Software\DXGL" $8
 197+ StrCmp $SUBKEY "" regdone
 198+ StrCpy $SUBKEY "Software\DXGL\$SUBKEY"
 199+ IntOp $8 $8 + 1
 200+ ;REG_MULTI_SZ reader based on code at http://nsis.sourceforge.net/REG_MULTI_SZ_Reader
 201+ StrCpy $0 ""
 202+ StrCpy $1 ""
 203+ StrCpy $2 ""
 204+ StrCpy $3 ""
 205+ System::Call "${RegOpenKeyEx}(${ROOT_KEY},'$SUBKEY',0, \
 206+ ${KEY_QUERY_VALUE}|${KEY_ENUMERATE_SUB_KEYS},.r0) .r3"
 207+ StrCmp $3 0 readvalue
 208+ Goto regloop
 209+ readvalue:
 210+ System::Call "${RegQueryValueEx}(r0,'${INSTPATH}',0,.r1,0,.r2) .r3"
 211+ StrCmp $3 0 checksz
 212+ goto readdone
 213+ checksz:
 214+ StrCmp $1 ${REG_MULTI_SZ} checkempty
 215+ Goto readdone
 216+ checkempty:
 217+ StrCmp $2 0 0 multiszalloc
 218+ Goto readdone
 219+ multiszalloc:
 220+ System::Alloc $2
 221+ Pop $1
 222+ StrCmp $1 0 0 multiszget
 223+ Goto readdone
 224+ multiszget:
 225+ System::Call "${RegQueryValueEx}(r0, '${INSTPATH}', 0, n, r1, r2) .r3"
 226+ StrCmp $3 0 multiszprocess
 227+ System::Free $1
 228+ Goto readdone
 229+ multiszprocess:
 230+ StrCpy $4 $1
 231+ IntOp $6 $4 + $2
 232+ !ifdef NSIS_UNICODE
 233+ IntOp $6 $6 - 2
 234+ !else
 235+ IntOp $6 $6 - 1
 236+ !endif
 237+ szloop:
 238+ System::Call "*$4(&t${NSIS_MAX_STRLEN} .r3)"
 239+ StrLen $5 $3
 240+ IntOp $5 $5 + 1
 241+ !ifdef NSIS_UNICODE
 242+ IntOp $5 $5 * 2
 243+ !endif
 244+ IntOp $4 $4 + $5
 245+ ;copy file here
 246+ DetailPrint "Removing ddraw.dll from $3"
 247+ Delete $3\ddraw.dll
 248+ IntCmp IntCmp $4 $6 0 szloop
 249+ System::Free $1
 250+
 251+ readdone:
 252+ StrCmp $0 0 regloop
 253+ System::Call "${RegCloseKey}(r0)"
 254+ goto regloop
 255+ regdone:
 256+ SetPluginUnload manual
 257+
192258 SetAutoClose true
193259 SectionEnd
\ No newline at end of file