Archive: custom key functionality


custom key functionality
How can you make some function run when a keyboard button is pressed in nsis setup.

For example: I don't want setup(made of NSIS) to quit when esc button is pressed, Instead i want to run some function.

Please help me ASAP.

Thank you in advance.


any idea?


You need to recompile NSIS from sources - find keys behaviour routine and change it to your needs.


there must be some other way ... is there?


Well maybe you could create a plugin that can handle this, but... that's about it, I'm afraid.


any idea of where to edit in the source code?


There is an easier way to prevent the abortion of the installer when the ESC key (or the "X" button) is pressed:
!define MUI_ABORTWARNING

(This of course will only work when your installer is using Modern UI. Otherwise write your own .onUserAbort function)