From a7ae019046999fc1743a391b7e62031f6548f45f Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 7 Oct 2005 13:23:58 +0000 Subject: [PATCH] write temporary nsh to temp dir to avoid permission problems with unprivileged users git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4309 212acab6-be3b-0410-9dea-997c60f758d6 --- Include/Library.nsh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Include/Library.nsh b/Include/Library.nsh index 403ea7a0..d7bd5fbf 100644 --- a/Include/Library.nsh +++ b/Include/Library.nsh @@ -105,6 +105,17 @@ !macroend +### Get library version +!macro __InstallLib_Helper_GetVersion TYPE FILE + + !tempfile LIBRARY_TEMP_NSH + !execute '"${NSISDIR}\Bin\LibraryLocal.exe" "${TYPE}" "${FILE}" "${LIBRARY_TEMP_NSH}"' + !include "${LIBRARY_TEMP_NSH}" + !delfile "${LIBRARY_TEMP_NSH}" + !undef LIBRARY_TEMP_NSH + +!macroend + ### Install library !macro InstallLib libtype shared install localfile destfile tempbasedir @@ -192,8 +203,7 @@ ;------------------------ ;Get version information - !execute '"${NSISDIR}\Bin\LibraryLocal.exe" D "${LOCALFILE}"' - !include "${NSISDIR}\Bin\LibraryLocal.nsh" + !insertmacro __InstallLib_Helper_GetVersion D "${LOCALFILE}" !ifdef LIBRARY_VERSION_FILENOTFOUND !error "InstallLib: The library ${LOCALFILE} could not be found." @@ -220,8 +230,7 @@ !else - !execute '"${NSISDIR}\Bin\LibraryLocal.exe" T "${LOCALFILE}"' - !include "${NSISDIR}\Bin\LibraryLocal.nsh" + !insertmacro __InstallLib_Helper_GetVersion T "${LOCALFILE}" !ifdef LIBRARY_VERSION_FILENOTFOUND !error "InstallLib: The library ${LOCALFILE} could not be found." @@ -249,8 +258,7 @@ !ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB - !execute '"${NSISDIR}\Bin\LibraryLocal.exe" T "${LOCALFILE}"' - !include "${NSISDIR}\Bin\LibraryLocal.nsh" + !insertmacro __InstallLib_Helper_GetVersion T "${LOCALFILE}" !endif