From b3451dc30e689df7a7e8efd3599bf56b01c02fc4 Mon Sep 17 00:00:00 2001 From: kichik Date: Tue, 3 Apr 2007 10:47:27 +0000 Subject: [PATCH] fixed bug #1692761 - Library.nsh warning when not using macro UnInstallLib git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5034 212acab6-be3b-0410-9dea-997c60f758d6 --- Include/Library.nsh | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/Include/Library.nsh b/Include/Library.nsh index adf59b98..398235d0 100644 --- a/Include/Library.nsh +++ b/Include/Library.nsh @@ -32,10 +32,33 @@ !endif !include LogicLib.nsh -!include FileFunc.nsh -!insertmacro GetParent -!insertmacro un.GetParent +### GetParent macro, don't pass $1 or $2 as INTPUT or OUTPUT +!macro __InstallLib_Helper_GetParent INPUT OUTPUT + + # Copied from FileFunc.nsh + + StrCpy ${OUTPUT} ${INPUT} + + Push $1 + Push $2 + + StrCpy $2 ${OUTPUT} 1 -1 + StrCmp $2 '\' 0 +3 + StrCpy ${OUTPUT} ${OUTPUT} -1 + goto -3 + + StrCpy $1 0 + IntOp $1 $1 - 1 + StrCpy $2 ${OUTPUT} 1 $1 + StrCmp $2 '\' +2 + StrCmp $2 '' 0 -3 + StrCpy ${OUTPUT} ${OUTPUT} $1 + + Pop $2 + Pop $1 + +!macroend ### Initialize session id (GUID) !macro __InstallLib_Helper_InitSession @@ -694,11 +717,7 @@ Delete $R0 # Try moving to directory containing the file. - !ifndef __UNINSTALL__ - ${GetParent} $R1 $R0 - !else - ${un.GetParent} $R1 $R0 - !endif + !insertmacro __InstallLib_Helper_GetParent $R1 $R0 GetTempFileName $R0 $R0 Delete $R0 Rename $R1 $R0