I want to lock a file to prevent it from deletion during installation process, but I need to read this file at the same time. How can I do it using NSIS?
FileOpen $0 "$instdir\myfile.txt" r
should block the deletion and allow you to read from it...