twistymcgee
23rd February 2005 13:31 UTC
Overwrite File In Use
I have a nsis installer that is basically an update. I need to overwrite a file that is currently in use. I have been using a windows executable (inuse.exe) to accomplish it but I'm wondering if there's a way to do it with nsis directly.
kichik
24th February 2005 18:30 UTC
Rename /REBOOTOK is what you need. Extract the new file with another name and use Rename /REBOOTOK to copy it over the old file after reboot. The Library macro does this. You can take a look at its source code in Include\Library.nsh.
twistymcgee
24th February 2005 19:44 UTC
Thanks, I will try this.
dienjd
27th October 2005 21:52 UTC
I'm unable to find documentation on how to determine that a file is in-use with NSIS. Am I missing something, or is there a plug-in out there that does this?
kichik
27th October 2005 21:53 UTC
Use SetOverwrite try and check the error flag after calling File. If the error flag is set, the file was not overwritten. Don't forget to clear the error flag using ClearErrors before calling File.