diff --git a/Docs/src/history.but b/Docs/src/history.but index fa859961..eddffbe5 100644 --- a/Docs/src/history.but +++ b/Docs/src/history.but @@ -14,6 +14,8 @@ Released on ??? ??th, 20?? \b Added MUI_TEXTCOLOR setting +\b Added LIBRARY_INSTALL_EQUAL_VERSION \R{library_install}{InstallLib} option + \b Added NTMARTA to preload list to fix rare Windows 7 security issue (\W{http://sf.net/p/nsis/bugs/1204}{bug #1204}) \b MakeNSIS prints -CMDHELP to stdout (\W{http://sf.net/p/nsis/bugs/1203}{bug #1203}) diff --git a/Docs/src/library.but b/Docs/src/library.but index 8c186c4b..3c772bbb 100644 --- a/Docs/src/library.but +++ b/Docs/src/library.but @@ -131,6 +131,10 @@ The Windows temp directory could be located on any volume, so you cannot use thi \b Not recommended for DLLs installed to $SYSDIR. +\S2{} LIBRARY_INSTALL_EQUAL_VERSION + +\b Define this before inserting InstallLib macro to overwrite the file even if the version is the same as the existing file. + \S1{library_install_notes} Notes \b If you need to support Windows 9x/ME, you can only use short filenames (8.3). diff --git a/Include/Library.nsh b/Include/Library.nsh index 1d886563..06f72dda 100644 --- a/Include/Library.nsh +++ b/Include/Library.nsh @@ -146,6 +146,13 @@ !macroend +!macro __InstallLib_Helper_CmpPackedVer64 oldhi oldlo newhi newlo jeq jle jgt + + IntCmpU ${oldhi} ${newhi} 0 ${jle} ${jgt} + IntCmpU ${oldlo} ${newlo} ${jeq} ${jle} ${jgt} + +!macroend + ### Get library version !macro __InstallLib_Helper_GetVersion TYPE FILE @@ -314,9 +321,13 @@ !ifndef INSTALLLIB_LIBTYPE_TLB & INSTALLLIB_LIBTYPE_REGDLLTLB - IntCmpU $R0 $R2 0 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}" - IntCmpU $R1 $R3 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.register_${INSTALLLIB_UNIQUE}" \ - "installlib.upgrade_${INSTALLLIB_UNIQUE}" + !ifdef LIBRARY_INSTALL_EQUAL_VERSION + !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 "installlib.upgrade_${INSTALLLIB_UNIQUE}" \ + "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}" + !else + !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 "installlib.register_${INSTALLLIB_UNIQUE}" \ + "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}" + !endif !else @@ -328,15 +339,18 @@ !ifndef LIBRARY_VERSION_NONE - IntCmpU $R0 $R2 0 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}" - IntCmpU $R1 $R3 0 "installlib.register_${INSTALLLIB_UNIQUE}" \ - "installlib.upgrade_${INSTALLLIB_UNIQUE}" + !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 0 \ + "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}" !else - IntCmpU $R0 $R2 0 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}" - IntCmpU $R1 $R3 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.register_${INSTALLLIB_UNIQUE}" \ - "installlib.upgrade_${INSTALLLIB_UNIQUE}" + !ifdef LIBRARY_INSTALL_EQUAL_VERSION + !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 "installlib.upgrade_${INSTALLLIB_UNIQUE}" \ + "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}" + !else + !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 "installlib.register_${INSTALLLIB_UNIQUE}" \ + "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}" + !endif !endif @@ -377,9 +391,13 @@ Pop $R3 Pop $R2 - IntCmpU $R0 $R2 0 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}" - IntCmpU $R1 $R3 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.register_${INSTALLLIB_UNIQUE}" \ - "installlib.upgrade_${INSTALLLIB_UNIQUE}" + !ifdef LIBRARY_INSTALL_EQUAL_VERSION + !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 "installlib.upgrade_${INSTALLLIB_UNIQUE}" \ + "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}" + !else + !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 "installlib.register_${INSTALLLIB_UNIQUE}" \ + "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}" + !endif !undef LIBRARY_VERSION_HIGH !undef LIBRARY_VERSION_LOW @@ -392,7 +410,7 @@ !endif - !endif + !endif ;~LIBRARY_IGNORE_VERSION ;------------------------ ;Upgrade