From 2ca8151f8af19ee20d714a24a2afd9d1abc6da80 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 17 Mar 2006 12:15:51 +0000 Subject: [PATCH] added a minimal implementation of __InstallLib_Helper_GetVersion for non-win32 platforms, using GetDLLVersionLocal git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4597 212acab6-be3b-0410-9dea-997c60f758d6 --- Include/Library.nsh | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/Include/Library.nsh b/Include/Library.nsh index 6d41e0f6..5f80eab4 100644 --- a/Include/Library.nsh +++ b/Include/Library.nsh @@ -109,11 +109,37 @@ ### 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 + !ifdef NSIS_WIN32_MAKENSIS + + !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 + + !else + + !if ${TYPE} == 'T' + + !error "InstallLib can only handle type libraries on Windows" + + !endif + + !ifndef INSTALLLIB_GETVERSION_VARS_DEFINED + + !define INSTALLLIB_GETVERSION_VARS_DEFINED + + Var /GLOBAL $INSTALLLIB_VER_LOW + Var /GLOBAL $INSTALLLIB_VER_HIGH + + !endif + + !define LIBRARY_VERSION_LOW $INSTALLLIB_VER_LOW + !define LIBRARY_VERSION_HIGH $INSTALLLIB_VER_HIGH + + GetDLLVersionLocal "${FILE}" $INSTALLLIB_VER_HIGH $INSTALLLIB_VER_LOW + + !endif !macroend