Skip to content
⌘ NSIS Forum Archive

Catching an error

4 posts

kdeslauriers#

Catching an error

Is there a way to catch exceptions in NSIS?

My problem is the following:

I want to write to a file but first I want to ensure that it is not currently open by some other operation.

If it is, I want to place a MessageBox on the screen, inform the user that it cannot be written to and then prompt them to continue or not with the installation.

Thanks.
Afrow UK#
Use FileOpen as Anders suggests with a ClearErrors before hand followed by IfErrors (or ${If} ${Errors} ... ${EndIf} if you use LogicLib).

Stu