Warning, /graphics/krita/packaging/windows/installer/include/IsFileInUse.nsh is written in an unsupported language. File is not indexed.
0001 ;
0002 ; SPDX-License-Identifier: GPL-3.0-or-later
0003 ;
0004 ; Checks whether a file is in use by trying to open it in Append mode
0005
0006 !macro _IsFileInUse _a _b _t _f
0007 !insertmacro _LOGICLIB_TEMP
0008 StrCpy $_LOGICLIB_TEMP "0"
0009 IfFileExists `${_b}` `0` +4 ; If file not exist then not in use
0010 FileOpen $_LOGICLIB_TEMP ${_b} a ; If file open failed then file is in use
0011 IfErrors +2
0012 FileClose $_LOGICLIB_TEMP
0013 StrCmp $_LOGICLIB_TEMP `` `${_t}` `${_f}` ; Var is empty when file in use
0014 !macroend
0015 !define IsFileInUse `"" IsFileInUse`