No announcement yet.

Automatically execute NSIS custom page without requiring the user to click "Next"

  • Filter
  • Time
  • Show
Clear All
new posts

  • Automatically execute NSIS custom page without requiring the user to click "Next"

    Background: I'm looking for a way to disable the "Finish" button on the last page, immediately after the user presses on the button. However, it seems that NSIS takes the mouse down event and keeps the button pressed while executing the "leave" function, so it's not possible to update the button there.

    So I thought I would duplicate the final page with another custom page that has the Finish button disabled, so that when the user clicks on the original "Finish" button he is taken to the second page which is identical with the first page, except the Finish button is disabled. This part worked fine.

    However, I'm looking for a way to make the page execution jump directly to the "leave" function, after the "show" function. I tried calling the relevant code from the "show" function, I tried to simulate a click on the "Finish" button, but with no luck.

    Any advices? Thanks!

  • #2
    I don't know how to accomplish what you're asking, but I get the feeling that there may be a much simpler and less hacky way to accomplish what you want. Could you describe why you want your Finish button to behave in a broken way?


    • #3
      On the last page of my installer, there is an option to close several running applications. For marketing reasons, this option needs to stay on the last screen and I cannot move it to an earlier page.

      Several tasks can only be performed after the running applications are closed, therefore after pressing the Finish button on the last screen, the installer freezes for a few seconds, while performing these tasks.

      I need a way to prevent the user from thinking that pressing the Finish button had no effect (and from clicking the button repeatedly in a hope that that would help) -- either by disabling the button, or by hiding it, or by adding a loader on the page, a message etc. The problem though is that after pressing a button on a custom page it doesn't seem possible to update the page's UI until the page tasks are finalized.


      • #4
        I suggest you use the banner plugin in the finish page's leave function. This will give a proper popup telling the user the installer is closing open applications. The banner plugin is a standard NSIS plugin, you'll have it if you did a full install.