added x64 support for library macros

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5077 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2007-04-14 16:58:57 +00:00
parent 68907347f5
commit a25547816b
3 changed files with 148 additions and 18 deletions

View file

@ -32,6 +32,7 @@
!endif
!include LogicLib.nsh
!include x64.nsh
### GetParent macro, don't pass $1 or $2 as INTPUT or OUTPUT
!macro __InstallLib_Helper_GetParent INPUT OUTPUT
@ -207,6 +208,15 @@
!error "InstallLib: Incorrect setting for parameter: install"
!endif
;------------------------
;x64 settings
!ifdef LIBRARY_X64
${DisableX64FSRedirection}
!endif
;------------------------
;Copy the parameters used on run-time to a variable
;This allows the usage of variables as parameter
@ -221,11 +231,23 @@
StrCmp ${shared} "" 0 "installlib.noshareddllincrease_${INSTALLLIB_UNIQUE}"
!ifdef LIBRARY_X64
SetRegView 64
!endif
ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R4
ClearErrors
IntOp $R0 $R0 + 1
WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R4 $R0
!ifdef LIBRARY_X64
SetRegView 32
!endif
"installlib.noshareddllincrease_${INSTALLLIB_UNIQUE}:"
!endif
@ -456,7 +478,15 @@
!ifdef INSTALLLIB_LIBTYPE_REGDLL | INSTALLLIB_LIBTYPE_REGDLLTLB
RegDll $R4
!ifndef LIBRARY_X64
RegDll $R4
!else
ExecWait '"$SYSDIR\regsvr32.exe" /s "$R4"'
!endif
!endif
@ -531,16 +561,15 @@
"installlib.regonreboot_${INSTALLLIB_UNIQUE}:"
!ifdef INSTALLLIB_LIBTYPE_REGDLL
!insertmacro __InstallLib_Helper_AddRegToolEntry 'D' "$R4" "$R5"
!ifdef INSTALLLIB_LIBTYPE_REGDLL | INSTALLLIB_LIBTYPE_REGDLLTLB
!ifndef LIBRARY_X64
!insertmacro __InstallLib_Helper_AddRegToolEntry 'D' "$R4" "$R5"
!else
!insertmacro __InstallLib_Helper_AddRegToolEntry 'DX' "$R4" "$R5"
!endif
!endif
!ifdef INSTALLLIB_LIBTYPE_TLB
!insertmacro __InstallLib_Helper_AddRegToolEntry 'T' "$R4" "$R5"
!endif
!ifdef INSTALLLIB_LIBTYPE_REGDLLTLB
!insertmacro __InstallLib_Helper_AddRegToolEntry 'D' "$R4" "$R5"
!ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB
!insertmacro __InstallLib_Helper_AddRegToolEntry 'T' "$R4" "$R5"
!endif
@ -553,6 +582,12 @@
"installlib.end_${INSTALLLIB_UNIQUE}:"
!ifdef LIBRARY_X64
${EnableX64FSRedirection}
!endif
;------------------------
;Undefine
@ -608,6 +643,15 @@
!error "UnInstallLib: Incorrect setting for parameter: uninstall"
!endif
;------------------------
;x64 settings
!ifdef LIBRARY_X64
${DisableX64FSRedirection}
!endif
;------------------------
;Copy the parameters used on run-time to a variable
;This allows the usage of variables as parameter
@ -621,6 +665,12 @@
!define UNINSTALLLIB_DONE_LABEL
!ifdef LIBRARY_X64
SetRegView 64
!endif
ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1
StrCmp $R0 "" "uninstalllib.shareddlldone_${UNINSTALLLIB_UNIQUE}"
@ -636,9 +686,22 @@
"uninstalllib.shareddllinuse_${UNINSTALLLIB_UNIQUE}:"
WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0
!ifdef LIBRARY_X64
SetRegView 32
!endif
Goto "uninstalllib.done_${UNINSTALLLIB_UNIQUE}"
"uninstalllib.shareddlldone_${UNINSTALLLIB_UNIQUE}:"
"uninstalllib.shareddlldone_${UNINSTALLLIB_UNIQUE}:"
!ifdef LIBRARY_X64
SetRegView 32
!endif
!endif
@ -674,7 +737,15 @@
!ifdef UNINSTALLLIB_LIBTYPE_REGDLL | UNINSTALLLIB_LIBTYPE_REGDLLTLB
UnRegDLL $R1
!ifndef LIBRARY_X64
UnRegDLL $R1
!else
ExecWait '"$SYSDIR\regsvr32.exe" /s /u "$R1"'
!endif
!endif
@ -754,6 +825,12 @@
!endif
!ifdef LIBRARY_X64
${EnableX64FSRedirection}
!endif
Pop $R1
Pop $R0