NSIS Function - quit installer
Asked Answered
D

1

5

In my NSIS installer i have a custom function where the user has 2 Radio Buttons. Selecting the first one and clicking "Next" installs the software. Selecting the second one (Browse) and clicking "Next" displays an HTML file found on the installation medium.

Everything works but I would like to actually quit the installer when the user selects to browse option and the HTML page is displayed. Any idea how to do this?

In my custom page I have this:

    ${NSD_CreateRadioButton} 70 95 40% 6% "Install the Manuals to your PC"
        Pop $hwnd
        ${NSD_AddStyle} $hwnd ${WS_GROUP}
        ${NSD_SetUserData} $hwnd "true"
        ${NSD_OnClick} $hwnd RadioClick
    ${NSD_CreateRadioButton} 70 175 40% 6% "Browse the $MEDIUM content"
        Pop $hwnd
        ${NSD_SetUserData} $hwnd "false"
        ${NSD_OnClick} $hwnd RadioClick

I have a function that gets the data:

Function RadioClick
    Pop $hwnd
    ${NSD_GetUserData} $hwnd $inst
FunctionEnd

And finally, a function that does the stuff with that data (start installation or browse):

Function post
    ${If} $inst == ""
        MessageBox MB_OK "Please specify an option"
        Abort
    ${ElseIf} $inst == false
        ExecShell "open" "$EXEDIR\TechPubList_ForPC\$START_PUB"
        Abort    
    ${EndIf}
FunctionEnd

I need something to put in this last function after the "Abort" that actually quits the installer.

Any help is welcomed! Thank you!

Dilatation answered 19/2, 2013 at 16:2 Comment(0)
A
11

Doesn't the Quit instruction do what you want? The manual states:

Causes the installer to exit as soon as possible. After Quit is called, the installer will exit (no callback functions will get a chance to run).

Assist answered 19/2, 2013 at 16:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.