Tasks #2087

Apply patch to LogicLib

Added by Tomás Abad almost 4 years ago. Updated over 3 years ago.

Status:NewStart date:04/09/2013
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:Unplanned yet

Description

The official page of LogicLib suggests apply this patch.

The ${FileExists} condition included in LogicLib will evaluate to true if what exists is actually a directory. I suggest you add the following macros to your script (right after including LogicLib.nsh):

;FileExists is already part of LogicLib, but returns true for directories as well as files
!macro _FileExists2 _a _b _t _f
    !insertmacro _LOGICLIB_TEMP
    StrCpy $_LOGICLIB_TEMP "0" 
    StrCmp `${_b}` `` +4 0 ;if path is not blank, continue to next check
    IfFileExists `${_b}` `0` +3 ;if path exists, continue to next check (IfFileExists returns true if this is a directory)
    IfFileExists `${_b}\*.*` +2 0 ;if path is not a directory, continue to confirm exists
    StrCpy $_LOGICLIB_TEMP "1" ;file exists
    ;now we have a definitive value - the file exists or it does not
    StrCmp $_LOGICLIB_TEMP "1" `${_t}` `${_f}`
!macroend
!undef FileExists
!define FileExists `"" FileExists2`
!macro _DirExists _a _b _t _f
    !insertmacro _LOGICLIB_TEMP
    StrCpy $_LOGICLIB_TEMP "0"    
    StrCmp `${_b}` `` +3 0 ;if path is not blank, continue to next check
    IfFileExists `${_b}\*.*` 0 +2 ;if directory exists, continue to confirm exists
    StrCpy $_LOGICLIB_TEMP "1" 
    StrCmp $_LOGICLIB_TEMP "1" `${_t}` `${_f}`
!macroend
!define DirExists `"" DirExists`

History

#1 Updated by Tomás Abad over 3 years ago

  • Target version changed from 2.3.0 to 2.3.1

#2 Updated by Tomás Abad over 3 years ago

  • Target version changed from 2.3.1 to 2.3.2

#3 Updated by Tomás Abad over 3 years ago

  • Target version changed from 2.3.2 to Unplanned yet

Also available in: Atom PDF