- fixed "already defined" error

- fixed unused label warning


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3654 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2004-09-11 15:44:17 +00:00
parent 38d7adce15
commit a84b5fe2b1

View file

@ -33,17 +33,17 @@ install Specify the installation method
REBOOT_PROTECTED * Upgrade the library on reboot when in use (required for system files). REBOOT_PROTECTED * Upgrade the library on reboot when in use (required for system files).
* Upgrade the library if the file is not protected by Windows File Protection. * Upgrade the library if the file is not protected by Windows File Protection.
NOREBOOT_PROTECTED * Warns the user when the library is in use. The user will have to close NOREBOOT_PROTECTED * Warns the user when the library is in use. The user will have to close
applications using the library. applications using the library.
* Upgrade the library if the file is not protected by Windows File Protection. * Upgrade the library if the file is not protected by Windows File Protection.
REBOOT_NOTPROTECTED * Upgrade the library on reboot when in use (required for system files). REBOOT_NOTPROTECTED * Upgrade the library on reboot when in use (required for system files).
* Upgrade the library without checking for Windows File Protection. * Upgrade the library without checking for Windows File Protection.
NOREBOOT_NOTPROTECTED * Warns the user when the library is in use. The user will have to close NOREBOOT_NOTPROTECTED * Warns the user when the library is in use. The user will have to close
applications using the library. applications using the library.
* Upgrade the library without checking for Windows File Protection. * Upgrade the library without checking for Windows File Protection.
localfile Location of the library on the compiler system localfile Location of the library on the compiler system
@ -51,7 +51,7 @@ destfile Location to store the library on the user's system
tempbasedir Directory on the user's system to store a temporary file when the system has tempbasedir Directory on the user's system to store a temporary file when the system has
to be rebooted. to be rebooted.
For Windows 9x/ME support, this directory should be on the same volume as the For Windows 9x/ME support, this directory should be on the same volume as the
destination file (destfile). destination file (destfile).
The Windows temp directory could be located on any volume, so you cannot use The Windows temp directory could be located on any volume, so you cannot use
@ -104,20 +104,20 @@ uninstall Specify the uninstallation method
NOREMOVE The library should not be removed. NOREMOVE The library should not be removed.
You should use this option for common or important system files such as the You should use this option for common or important system files such as the
Visual Basic/C++/MFC runtimes. Visual Basic/C++/MFC runtimes.
REBOOT_PROTECTED * Remove the library on reboot when in use (required for system files). REBOOT_PROTECTED * Remove the library on reboot when in use (required for system files).
* Remove the library if the file is not protected by Windows File Protection. * Remove the library if the file is not protected by Windows File Protection.
NOREBOOT_PROTECTED * Warns the user when the library is in use. The user will have to close NOREBOOT_PROTECTED * Warns the user when the library is in use. The user will have to close
applications using the library. applications using the library.
* Remove the library if the file is not protected by Windows File Protection. * Remove the library if the file is not protected by Windows File Protection.
REBOOT_NOTPROTECTED * Remove the library on reboot when in use (required for system files). REBOOT_NOTPROTECTED * Remove the library on reboot when in use (required for system files).
* Remove the library without checking for Windows File Protection. * Remove the library without checking for Windows File Protection.
NOREBOOT_NOTPROTECTED * Warns the user when the library is in use. The user will have to close NOREBOOT_NOTPROTECTED * Warns the user when the library is in use. The user will have to close
applications using the library. applications using the library.
* Remove the library without checking for Windows File Protection. * Remove the library without checking for Windows File Protection.
file Location of the library file Location of the library
@ -137,7 +137,7 @@ Example:
!verbose push !verbose push
!verbose 3 !verbose 3
Push $R0 Push $R0
Push $R1 Push $R1
Push $R2 Push $R2
@ -147,9 +147,9 @@ Example:
;------------------------ ;------------------------
;Define ;Define
!define INSTALLLIB_UNIQUE ${__LINE__} !define INSTALLLIB_UNIQUE ${__LINE__}
!define INSTALLLIB_LIBTYPE_${libtype} !define INSTALLLIB_LIBTYPE_${libtype}
!define INSTALLLIB_LIBTYPE_SET INSTALLLIB_LIBTYPE_${libtype} !define INSTALLLIB_LIBTYPE_SET INSTALLLIB_LIBTYPE_${libtype}
!define INSTALLLIB_SHARED_${shared} !define INSTALLLIB_SHARED_${shared}
@ -159,7 +159,7 @@ Example:
;------------------------ ;------------------------
;Validate ;Validate
!ifndef INSTALLLIB_LIBTYPE_DLL & INSTALLLIB_LIBTYPE_REGDLL & INSTALLLIB_LIBTYPE_TLB & \ !ifndef INSTALLLIB_LIBTYPE_DLL & INSTALLLIB_LIBTYPE_REGDLL & INSTALLLIB_LIBTYPE_TLB & \
INSTALLLIB_LIBTYPE_REGDLLTLB INSTALLLIB_LIBTYPE_REGDLLTLB
!error "InstallLib: Incorrect setting for parameter: libtype" !error "InstallLib: Incorrect setting for parameter: libtype"
@ -176,191 +176,209 @@ Example:
StrCpy $R4 "${destfile}" StrCpy $R4 "${destfile}"
StrCpy $R5 "${tempbasedir}" StrCpy $R5 "${tempbasedir}"
;------------------------ ;------------------------
;Shared library count ;Shared library count
!ifndef INSTALLLIB_SHARED_NOTSHARED !ifndef INSTALLLIB_SHARED_NOTSHARED
StrCmp ${shared} "" 0 installlib.noshareddllincrease_${INSTALLLIB_UNIQUE} StrCmp ${shared} "" 0 installlib.noshareddllincrease_${INSTALLLIB_UNIQUE}
ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R4 ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R4
IntOp $R0 $R0 + 1 IntOp $R0 $R0 + 1
WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R4 $R0 WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R4 $R0
installlib.noshareddllincrease_${INSTALLLIB_UNIQUE}: installlib.noshareddllincrease_${INSTALLLIB_UNIQUE}:
!endif !endif
;------------------------ ;------------------------
;Check Windows File Protection ;Check Windows File Protection
!ifdef INSTALLLIB_INSTALL_REBOOT_PROTECTED | INSTALLLIB_INSTALL_NOREBOOT_PROTECTED !ifdef INSTALLLIB_INSTALL_REBOOT_PROTECTED | INSTALLLIB_INSTALL_NOREBOOT_PROTECTED
System::Call "sfc::SfcIsFileProtected(i 0, w R4) i.R0" System::Call "sfc::SfcIsFileProtected(i 0, w R4) i.R0"
StrCmp $R0 "error" installlib.notprotected_${INSTALLLIB_UNIQUE} StrCmp $R0 "error" installlib.notprotected_${INSTALLLIB_UNIQUE}
StrCmp $R0 "0" installlib.notprotected_${INSTALLLIB_UNIQUE} StrCmp $R0 "0" installlib.notprotected_${INSTALLLIB_UNIQUE}
Goto installlib.done_${INSTALLLIB_UNIQUE} Goto installlib.done_${INSTALLLIB_UNIQUE}
installlib.notprotected_${INSTALLLIB_UNIQUE}: installlib.notprotected_${INSTALLLIB_UNIQUE}:
!endif !endif
;------------------------ ;------------------------
;Check file ;Check file
IfFileExists $R4 0 installlib.copy_${INSTALLLIB_UNIQUE} IfFileExists $R4 0 installlib.copy_${INSTALLLIB_UNIQUE}
;------------------------ ;------------------------
;Get version information ;Get version information
!execute '"${NSISDIR}\Contrib\Library\LibraryLocal\LibraryLocal.exe" D ${LOCALFILE}' !execute '"${NSISDIR}\Contrib\Library\LibraryLocal\LibraryLocal.exe" D ${LOCALFILE}'
!include "${NSISDIR}\Contrib\Library\LibraryLocal\LibraryLocal.nsh" !include "${NSISDIR}\Contrib\Library\LibraryLocal\LibraryLocal.nsh"
!ifdef LIBRARY_VERSION_FILENOTFOUND !ifdef LIBRARY_VERSION_FILENOTFOUND
!error "InstallLib: The library ${LOCALFILE} could not be found." !error "InstallLib: The library ${LOCALFILE} could not be found."
!endif !endif
!ifndef LIBRARY_VERSION_NONE !ifndef LIBRARY_VERSION_NONE
!define LIBRARY_DEFINE_UPGRADE_LABEL
StrCpy $R0 ${LIBRARY_VERSION_HIGH} StrCpy $R0 ${LIBRARY_VERSION_HIGH}
StrCpy $R1 ${LIBRARY_VERSION_LOW} StrCpy $R1 ${LIBRARY_VERSION_LOW}
GetDLLVersion $R4 $R2 $R3 GetDLLVersion $R4 $R2 $R3
!undef LIBRARY_VERSION_HIGH !undef LIBRARY_VERSION_HIGH
!undef LIBRARY_VERSION_LOW !undef LIBRARY_VERSION_LOW
!ifndef INSTALLLIB_LIBTYPE_TLB & INSTALLLIB_LIBTYPE_REGDLLTLB !ifndef INSTALLLIB_LIBTYPE_TLB & INSTALLLIB_LIBTYPE_REGDLLTLB
IntCmpU $R0 $R2 0 installlib.done_${INSTALLLIB_UNIQUE} installlib.upgrade_${INSTALLLIB_UNIQUE} IntCmpU $R0 $R2 0 installlib.done_${INSTALLLIB_UNIQUE} installlib.upgrade_${INSTALLLIB_UNIQUE}
IntCmpU $R1 $R3 installlib.done_${INSTALLLIB_UNIQUE} installlib.done_${INSTALLLIB_UNIQUE} \ IntCmpU $R1 $R3 installlib.done_${INSTALLLIB_UNIQUE} installlib.done_${INSTALLLIB_UNIQUE} \
installlib.upgrade_${INSTALLLIB_UNIQUE} installlib.upgrade_${INSTALLLIB_UNIQUE}
!else !else
!execute '"${NSISDIR}\Contrib\LIBRARY\LIBRARYLocal\LibraryLocal.exe" T ${LOCALFILE}' !execute '"${NSISDIR}\Contrib\LIBRARY\LIBRARYLocal\LibraryLocal.exe" T ${LOCALFILE}'
!include "${NSISDIR}\Contrib\LIBRARY\LIBRARYLocal\LibraryLocal.nsh" !include "${NSISDIR}\Contrib\LIBRARY\LIBRARYLocal\LibraryLocal.nsh"
!ifdef LIBRARY_VERSION_FILENOTFOUND !ifdef LIBRARY_VERSION_FILENOTFOUND
!error "InstallLib: The library ${LOCALFILE} could not be found." !error "InstallLib: The library ${LOCALFILE} could not be found."
!endif !endif
!ifndef LIBRARY_VERSION_NONE !ifndef LIBRARY_VERSION_NONE
IntCmpU $R0 $R2 0 installlib.done_${INSTALLLIB_UNIQUE} installlib.upgrade_${INSTALLLIB_UNIQUE} IntCmpU $R0 $R2 0 installlib.done_${INSTALLLIB_UNIQUE} installlib.upgrade_${INSTALLLIB_UNIQUE}
IntCmpU $R1 $R3 0 installlib.done_${INSTALLLIB_UNIQUE} \ IntCmpU $R1 $R3 0 installlib.done_${INSTALLLIB_UNIQUE} \
installlib.upgrade_${INSTALLLIB_UNIQUE} installlib.upgrade_${INSTALLLIB_UNIQUE}
!else !else
IntCmpU $R0 $R2 0 installlib.done_${INSTALLLIB_UNIQUE} installlib.upgrade_${INSTALLLIB_UNIQUE} IntCmpU $R0 $R2 0 installlib.done_${INSTALLLIB_UNIQUE} installlib.upgrade_${INSTALLLIB_UNIQUE}
IntCmpU $R1 $R3 installlib.done_${INSTALLLIB_UNIQUE} installlib.done_${INSTALLLIB_UNIQUE} \ IntCmpU $R1 $R3 installlib.done_${INSTALLLIB_UNIQUE} installlib.done_${INSTALLLIB_UNIQUE} \
installlib.upgrade_${INSTALLLIB_UNIQUE} installlib.upgrade_${INSTALLLIB_UNIQUE}
!endif !endif
!endif !endif
!else !else
!undef LIBRARY_VERSION_NONE !undef LIBRARY_VERSION_NONE
!execute '"${NSISDIR}\Contrib\LIBRARY\LIBRARYLocal\LibraryLocal.exe" T ${LOCALFILE}' !ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB
!include "${NSISDIR}\Contrib\LIBRARY\LIBRARYLocal\LibraryLocal.nsh"
!execute '"${NSISDIR}\Contrib\LIBRARY\LIBRARYLocal\LibraryLocal.exe" T ${LOCALFILE}'
!include "${NSISDIR}\Contrib\LIBRARY\LIBRARYLocal\LibraryLocal.nsh"
!endif
!endif !endif
!ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB !ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB
!ifndef LIBRARY_VERSION_NONE !ifndef LIBRARY_VERSION_NONE
!ifndef LIBRARY_DEFINE_UPGRADE_LABEL
!define LIBRARY_DEFINE_UPGRADE_LABEL
!endif
StrCpy $R0 ${LIBRARY_VERSION_HIGH} StrCpy $R0 ${LIBRARY_VERSION_HIGH}
StrCpy $R1 ${LIBRARY_VERSION_LOW} StrCpy $R1 ${LIBRARY_VERSION_LOW}
TypeLib::GetLibVersion $R4 TypeLib::GetLibVersion $R4
Pop $R2 Pop $R2
Pop $R3 Pop $R3
IntCmpU $R0 $R2 0 installlib.register_${INSTALLLIB_UNIQUE} installlib.upgrade_${INSTALLLIB_UNIQUE} IntCmpU $R0 $R2 0 installlib.register_${INSTALLLIB_UNIQUE} installlib.upgrade_${INSTALLLIB_UNIQUE}
IntCmpU $R1 $R3 installlib.register_${INSTALLLIB_UNIQUE} installlib.register_${INSTALLLIB_UNIQUE} \ IntCmpU $R1 $R3 installlib.register_${INSTALLLIB_UNIQUE} installlib.register_${INSTALLLIB_UNIQUE} \
installlib.upgrade_${INSTALLLIB_UNIQUE} installlib.upgrade_${INSTALLLIB_UNIQUE}
!undef LIBRARY_VERSION_HIGH !undef LIBRARY_VERSION_HIGH
!undef LIBRARY_VERSION_LOW !undef LIBRARY_VERSION_LOW
!else !else
!undef LIBRARY_VERSION_NONE !undef LIBRARY_VERSION_NONE
!endif !endif
!endif !endif
;------------------------ ;------------------------
;Upgrade ;Upgrade
installlib.upgrade_${INSTALLLIB_UNIQUE}: !ifdef LIBRARY_DEFINE_UPGRADE_LABEL
!undef LIBRARY_DEFINE_UPGRADE_LABEL
installlib.upgrade_${INSTALLLIB_UNIQUE}:
!endif
;------------------------ ;------------------------
;Copy ;Copy
!ifdef INSTALLLIB_INSTALL_NOREBOOT_PROTECTED | INSTALLLIB_INSTALL_NOREBOOT_NOTPROTECTED !ifdef INSTALLLIB_INSTALL_NOREBOOT_PROTECTED | INSTALLLIB_INSTALL_NOREBOOT_NOTPROTECTED
installlib.copy_${INSTALLLIB_UNIQUE}: installlib.copy_${INSTALLLIB_UNIQUE}:
StrCpy $R0 $R4 StrCpy $R0 $R4
Call :installlib.file_${INSTALLLIB_UNIQUE} Call :installlib.file_${INSTALLLIB_UNIQUE}
!else !else
ClearErrors ClearErrors
StrCpy $R0 $R4 StrCpy $R0 $R4
Call :installlib.file_${INSTALLLIB_UNIQUE} Call :installlib.file_${INSTALLLIB_UNIQUE}
IfErrors 0 installlib.register_${INSTALLLIB_UNIQUE} IfErrors 0 installlib.register_${INSTALLLIB_UNIQUE}
SetOverwrite lastused SetOverwrite lastused
;------------------------ ;------------------------
;Copy on reboot ;Copy on reboot
GetTempFileName $R0 $R5 GetTempFileName $R0 $R5
Call :installlib.file_${INSTALLLIB_UNIQUE} Call :installlib.file_${INSTALLLIB_UNIQUE}
Rename /REBOOTOK $R0 $R4 Rename /REBOOTOK $R0 $R4
;------------------------ ;------------------------
;Register on reboot ;Register on reboot
!ifdef INSTALLLIB_LIBTYPE_REGDLL | INSTALLLIB_LIBTYPE_REGDLLTLB !ifdef INSTALLLIB_LIBTYPE_REGDLL | INSTALLLIB_LIBTYPE_REGDLLTLB
GetTempFileName $R0 $R5 GetTempFileName $R0 $R5
File /oname=$R0 "${NSISDIR}\Contrib\Library\RegTool\RegTool.bin" File /oname=$R0 "${NSISDIR}\Contrib\Library\RegTool\RegTool.bin"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" \ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" \
"$R4" '"$R0" D $R4' "$R4" '"$R0" D $R4'
!endif !endif
!ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB !ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB
GetTempFileName $R0 $R5 GetTempFileName $R0 $R5
File /oname=$R0 "${NSISDIR}\Contrib\Library\RegTool\RegTool.bin" File /oname=$R0 "${NSISDIR}\Contrib\Library\RegTool\RegTool.bin"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" \ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" \
"$R4" '"$R0" T $R4' "$R4" '"$R0" T $R4'
!endif !endif
Goto installlib.done_${INSTALLLIB_UNIQUE} Goto installlib.done_${INSTALLLIB_UNIQUE}
installlib.copy_${INSTALLLIB_UNIQUE}: installlib.copy_${INSTALLLIB_UNIQUE}:
StrCpy $R0 $R4 StrCpy $R0 $R4
Call :installlib.file_${INSTALLLIB_UNIQUE} Call :installlib.file_${INSTALLLIB_UNIQUE}
!endif !endif
;------------------------ ;------------------------
@ -369,22 +387,22 @@ Example:
installlib.register_${INSTALLLIB_UNIQUE}: installlib.register_${INSTALLLIB_UNIQUE}:
!ifdef INSTALLLIB_LIBTYPE_REGDLL | INSTALLLIB_LIBTYPE_REGDLLTLB !ifdef INSTALLLIB_LIBTYPE_REGDLL | INSTALLLIB_LIBTYPE_REGDLLTLB
RegDLL $R4 RegDLL $R4
!endif !endif
!ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB !ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB
TypeLib::Register $R4 TypeLib::Register $R4
!endif !endif
;------------------------ ;------------------------
;Done ;Done
installlib.done_${INSTALLLIB_UNIQUE}: installlib.done_${INSTALLLIB_UNIQUE}:
Pop $R5 Pop $R5
Pop $R4 Pop $R4
Pop $R3 Pop $R3
@ -401,43 +419,43 @@ Example:
;Extract ;Extract
!ifdef INSTALLLIB_INSTALL_REBOOT_PROTECTED | INSTALLLIB_INSTALL_REBOOT_NOTPROTECTED !ifdef INSTALLLIB_INSTALL_REBOOT_PROTECTED | INSTALLLIB_INSTALL_REBOOT_NOTPROTECTED
SetOverwrite try SetOverwrite try
installlib.file_${INSTALLLIB_UNIQUE}: installlib.file_${INSTALLLIB_UNIQUE}:
File /oname=$R0 "${LOCALFILE}" File /oname=$R0 "${LOCALFILE}"
Return Return
installlib.end_${INSTALLLIB_UNIQUE}: installlib.end_${INSTALLLIB_UNIQUE}:
SetOverwrite lastused SetOverwrite lastused
!else !else
SetOverwrite on SetOverwrite on
installlib.file_${INSTALLLIB_UNIQUE}: installlib.file_${INSTALLLIB_UNIQUE}:
File /oname=$R0 "${LOCALFILE}" File /oname=$R0 "${LOCALFILE}"
Return Return
installlib.end_${INSTALLLIB_UNIQUE}: installlib.end_${INSTALLLIB_UNIQUE}:
SetOverwrite lastused SetOverwrite lastused
!endif !endif
;------------------------ ;------------------------
;Undefine ;Undefine
!undef INSTALLLIB_UNIQUE !undef INSTALLLIB_UNIQUE
!undef ${INSTALLLIB_LIBTYPE_SET} !undef ${INSTALLLIB_LIBTYPE_SET}
!undef INSTALLLIB_LIBTYPE_SET !undef INSTALLLIB_LIBTYPE_SET
!undef ${INSTALLLIB_SHARED_SET} !undef ${INSTALLLIB_SHARED_SET}
!undef INSTALLLIB_SHARED_SET !undef INSTALLLIB_SHARED_SET
!undef ${INSTALLLIB_INSTALL_SET} !undef ${INSTALLLIB_INSTALL_SET}
!undef INSTALLLIB_INSTALL_SET !undef INSTALLLIB_INSTALL_SET
!verbose pop !verbose pop
!macroend !macroend
@ -446,7 +464,7 @@ Example:
!verbose push !verbose push
!verbose 3 !verbose 3
Push $R0 Push $R0
Push $R1 Push $R1
@ -454,7 +472,7 @@ Example:
;Define ;Define
!define UNINSTALLLIB_UNIQUE ${__LINE__} !define UNINSTALLLIB_UNIQUE ${__LINE__}
!define UNINSTALLLIB_LIBTYPE_${libtype} !define UNINSTALLLIB_LIBTYPE_${libtype}
!define UNINSTALLLIB_LIBTYPE_SET UNINSTALLLIB_LIBTYPE_${libtype} !define UNINSTALLLIB_LIBTYPE_SET UNINSTALLLIB_LIBTYPE_${libtype}
!define UNINSTALLLIB_SHARED_${shared} !define UNINSTALLLIB_SHARED_${shared}
@ -464,7 +482,7 @@ Example:
;------------------------ ;------------------------
;Validate ;Validate
!ifndef UNINSTALLLIB_LIBTYPE_DLL & UNINSTALLLIB_LIBTYPE_REGDLL & UNINSTALLLIB_LIBTYPE_TLB & \ !ifndef UNINSTALLLIB_LIBTYPE_DLL & UNINSTALLLIB_LIBTYPE_REGDLL & UNINSTALLLIB_LIBTYPE_TLB & \
UNINSTALLLIB_LIBTYPE_REGDLLTLB UNINSTALLLIB_LIBTYPE_REGDLLTLB
!error "UnInstallLib: Incorrect setting for parameter: libtype" !error "UnInstallLib: Incorrect setting for parameter: libtype"
@ -485,89 +503,89 @@ Example:
;This allows the usage of variables as parameter ;This allows the usage of variables as parameter
StrCpy $R1 "${file}" StrCpy $R1 "${file}"
;------------------------ ;------------------------
;Shared library count ;Shared library count
!ifdef UNINSTALLLIB_SHARED_SHARED !ifdef UNINSTALLLIB_SHARED_SHARED
ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1
StrCmp $R0 "" uninstalllib.remove_${UNINSTALLLIB_UNIQUE} StrCmp $R0 "" uninstalllib.remove_${UNINSTALLLIB_UNIQUE}
IntOp $R0 $R0 - 1 IntOp $R0 $R0 - 1
IntCmp $R0 0 uninstalllib.shareddllremove_${UNINSTALLLIB_UNIQUE} \ IntCmp $R0 0 uninstalllib.shareddllremove_${UNINSTALLLIB_UNIQUE} \
uninstalllib.shareddllremove_${UNINSTALLLIB_UNIQUE} uninstalllib.shareddllinuse_${UNINSTALLLIB_UNIQUE} uninstalllib.shareddllremove_${UNINSTALLLIB_UNIQUE} uninstalllib.shareddllinuse_${UNINSTALLLIB_UNIQUE}
uninstalllib.shareddllremove_${UNINSTALLLIB_UNIQUE}: uninstalllib.shareddllremove_${UNINSTALLLIB_UNIQUE}:
DeleteRegValue HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 DeleteRegValue HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1
!ifndef UNINSTALLLIB_SHARED_SHAREDNOREMOVE !ifndef UNINSTALLLIB_SHARED_SHAREDNOREMOVE
Goto uninstalllib.remove_${UNINSTALLLIB_UNIQUE} Goto uninstalllib.remove_${UNINSTALLLIB_UNIQUE}
!endif !endif
uninstalllib.shareddllinuse_${UNINSTALLLIB_UNIQUE}: uninstalllib.shareddllinuse_${UNINSTALLLIB_UNIQUE}:
WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0 WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0
Goto uninstalllib.done_${UNINSTALLLIB_UNIQUE} Goto uninstalllib.done_${UNINSTALLLIB_UNIQUE}
!endif !endif
;------------------------ ;------------------------
;Remove ;Remove
uninstalllib.remove_${UNINSTALLLIB_UNIQUE}: uninstalllib.remove_${UNINSTALLLIB_UNIQUE}:
!ifndef UNINSTALLLIB_UNINSTALL_NOREMOVE !ifndef UNINSTALLLIB_UNINSTALL_NOREMOVE
;------------------------ ;------------------------
;Check Windows File Protection ;Check Windows File Protection
!ifdef UNINSTALLLIB_UNINSTALL_REBOOT_PROTECTED | UNINSTALLLIB_UNINSTALL_NOREBOOT_PROTECTED !ifdef UNINSTALLLIB_UNINSTALL_REBOOT_PROTECTED | UNINSTALLLIB_UNINSTALL_NOREBOOT_PROTECTED
System::Call "sfc::SfcIsFileProtected(i 0, w $R1) i.R0" System::Call "sfc::SfcIsFileProtected(i 0, w $R1) i.R0"
StrCmp $R0 "error" uninstalllib.notprotected_${UNINSTALLLIB_UNIQUE} StrCmp $R0 "error" uninstalllib.notprotected_${UNINSTALLLIB_UNIQUE}
StrCmp $R0 "0" uninstalllib.notprotected_${UNINSTALLLIB_UNIQUE} StrCmp $R0 "0" uninstalllib.notprotected_${UNINSTALLLIB_UNIQUE}
Goto uninstalllib.done_${UNINSTALLLIB_UNIQUE} Goto uninstalllib.done_${UNINSTALLLIB_UNIQUE}
uninstalllib.notprotected_${UNINSTALLLIB_UNIQUE}: uninstalllib.notprotected_${UNINSTALLLIB_UNIQUE}:
!endif !endif
;------------------------ ;------------------------
;Unregister ;Unregister
!ifdef UNINSTALLLIB_LIBTYPE_REGDLL | UNINSTALLLIB_LIBTYPE_REGDLLTLB !ifdef UNINSTALLLIB_LIBTYPE_REGDLL | UNINSTALLLIB_LIBTYPE_REGDLLTLB
UnRegDLL $R1 UnRegDLL $R1
!endif !endif
!ifdef INSTALLLIB_LIBTYPE_TLB | UNINSTALLLIB_LIBTYPE_REGDLLTLB !ifdef INSTALLLIB_LIBTYPE_TLB | UNINSTALLLIB_LIBTYPE_REGDLLTLB
TypeLib::UnRegister $R1 TypeLib::UnRegister $R1
!endif !endif
;------------------------ ;------------------------
;Delete ;Delete
!ifdef UNINSTALLLIB_UNINSTALL_REBOOT_PROTECTED | UNINSTALLLIB_UNINSTALL_REBOOT_NOTPROTECTED !ifdef UNINSTALLLIB_UNINSTALL_REBOOT_PROTECTED | UNINSTALLLIB_UNINSTALL_REBOOT_NOTPROTECTED
Delete /REBOOTOK $R1 Delete /REBOOTOK $R1
!else !else
Delete $R1 Delete $R1
!endif !endif
!endif !endif
;------------------------ ;------------------------
;Done ;Done
uninstalllib.done_${UNINSTALLLIB_UNIQUE}: uninstalllib.done_${UNINSTALLLIB_UNIQUE}:
Pop $R1 Pop $R1
Pop $R0 Pop $R0
@ -575,14 +593,14 @@ Example:
;Undefine ;Undefine
!undef UNINSTALLLIB_UNIQUE !undef UNINSTALLLIB_UNIQUE
!undef ${UNINSTALLLIB_LIBTYPE_SET} !undef ${UNINSTALLLIB_LIBTYPE_SET}
!undef UNINSTALLLIB_LIBTYPE_SET !undef UNINSTALLLIB_LIBTYPE_SET
!undef ${UNINSTALLLIB_SHARED_SET} !undef ${UNINSTALLLIB_SHARED_SET}
!undef UNINSTALLLIB_SHARED_SET !undef UNINSTALLLIB_SHARED_SET
!undef ${UNINSTALLLIB_UNINSTALL_SET} !undef ${UNINSTALLLIB_UNINSTALL_SET}
!undef UNINSTALLLIB_UNINSTALL_SET !undef UNINSTALLLIB_UNINSTALL_SET
!verbose pop !verbose pop
!macroend !macroend