Skip to content
⌘ NSIS Forum Archive

Option in unistaller possible?

11 posts

pedroac#

Option in unistaller possible?

Hi everyone

I have one thing I would like to do but I don't know if it is possible:
is it possible to include a checkbox in the unistaller and perform a specific action when that checkbox is enabled?

I need this feature because in my current application, some files added by the application are not erased by the app, and I wanna give the user the option to erase those files.

Is it possible?

Thanks!
Afrow UK#
Create a custom page with InstallOptions, or just add a Components page and an unchecked Section (/o) to delete the files.

-Stu
pedroac#
More questions:

1- How do I add a Section with a name separated by spaces (ex: My Section)?

2- how do I make some uninstaller sections not appear in the unistaller (such as post, which I allways want to be checked - I don't want the user to see the "post" section)

3- Also, how do I add each uninstaller section's description?
pedroac#
In reply to my own question, i found the answer of question 2: just put a "-" before the section name; ex:
"Section -un.post"
Afrow UK#
1. Section "Section Name"

3. From Modern UI Manual:
For the uninstaller, use the MUI_UNFUNCTION_DESCRIPTION_BEGIN and MUI_UNFUNCTION_DESCRIPTION_END macros.
-Stu
pedroac#
OK, thanks a lot

Now there's a problem... My friends are telling me the installer gets confusing with Components, and they want me to "just" add a checkbox in the first page of the unistaller.

If the checkbox is checked, i want to do some actions. If it isn't, the unistaller won't do that action.

Is it possible to do that using installOptions? if so, how do I add the created .ini file in the uninstaller and how do I get the checked/unchecked status from it?

Thanks for the help
pedroac#
I've never made a .ini file, so could you tell me a place where I can find documentation on the creation of custom pages / UninstPage / MUI_INSTALLOPTIONS_* macros ?
Afrow UK#
UninstPage is in the NSIS Manual.
All Modern UI instructions are documented in the Modern UI Manual.
For custom pages, see the InstallOptions manual.

It's all under the NSIS Startmenu shortcut group.

-Stu
Afrow UK#
You need to write them to the INI file with MUI_INSTALLOPTIONS_WRITE before displaying the page.

-Stu