| 1 |
; AddSharedDLL |
| 2 |
; |
| 3 |
; Increments a shared DLLs reference count. |
| 4 |
; Use by passing one item on the stack (the full path of the DLL). |
| 5 |
; |
| 6 |
; Usage: |
| 7 |
; Push $SYSDIR\myDll.dll |
| 8 |
; Call AddSharedDLL |
| 9 |
; |
| 10 |
|
| 11 |
Function AddSharedDLL |
| 12 |
Exch $R1 |
| 13 |
Push $R0 |
| 14 |
ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 |
| 15 |
IntOp $R0 $R0 + 1 |
| 16 |
WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0 |
| 17 |
Pop $R0 |
| 18 |
Pop $R1 |
| 19 |
FunctionEnd |
| 20 |
|
| 21 |
; un.RemoveSharedDLL |
| 22 |
; |
| 23 |
; Decrements a shared DLLs reference count, and removes if necessary. |
| 24 |
; Use by passing one item on the stack (the full path of the DLL). |
| 25 |
; Note: for use in the main installer (not the uninstaller), rename the |
| 26 |
; function to RemoveSharedDLL. |
| 27 |
; |
| 28 |
; Usage: |
| 29 |
; Push $SYSDIR\myDll.dll |
| 30 |
; Call un.RemoveSharedDLL |
| 31 |
; |
| 32 |
|
| 33 |
Function un.RemoveSharedDLL |
| 34 |
Exch $R1 |
| 35 |
Push $R0 |
| 36 |
ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 |
| 37 |
StrCmp $R0 "" remove |
| 38 |
IntOp $R0 $R0 - 1 |
| 39 |
IntCmp $R0 0 rk rk uk |
| 40 |
rk: |
| 41 |
DeleteRegValue HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 |
| 42 |
goto Remove |
| 43 |
uk: |
| 44 |
WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0 |
| 45 |
Goto noremove |
| 46 |
remove: |
| 47 |
Delete /REBOOTOK $R1 |
| 48 |
noremove: |
| 49 |
Pop $R0 |
| 50 |
Pop $R1 |
| 51 |
FunctionEnd |