Archive: Creating two uninstallers in same installer


Creating two uninstallers in same installer
Hello everyone, i'm new here and need some help already...

Here is the case:
I need to crate an installer, witch include toolbar installer..
My issue is: in both uninstallers, the Welcome title is the same and I wish in each unnistallers show different Titles(main uninstaller show "Program name uninstaller" and toolbar uninstaller show "Toolbar Uninstaller")

What i'm trying to do is create a custom page, and the installer detects if the uninstaller is for program or for toolbar, and show the correct text. But the uninstaller don't show this custom page..

Can someone help me in this case? I'm doing right or exist other way to do this???

Thanks


Can't you set the window title with something like this?

System::Call 'user32::SetWindowText(i $hwnd, t "title")'

I'm not specific on my question. The title i'm refering is the "Welcome to Program Uninstall Wizard".. In fact i'm need to change every place when "Program" appears and put "Toolbar"..

But thanks for help anyway.. This system call will be useful.


You can use a variable in Name or Caption and set that variable in .onInit before any page shows up.


Thanks kichik! This way works perfectly!


Hello, it's me again.

I have a new issue, someone can help me?

My script have the follow:
-a function "install_toolbar", where installs the toolbar fileset if the box is checked, and in the end use command writeUninstaller.
-a section "MainProgram", where call a function install_toolbar, install the fileset of software, and use command writeUninstaller.
-a section "Uninstall", where remove software files and shortcuts.

My issue is: Both uninstallers call the same section Uninstall. So, when i execute the software uninstaller, it´s fine. He will remove only software fileset. But when i execute toolbar uninstaller, all files are removed, including software fileset. Is it possible create diferents sections to each uninstaller?

Or have other way to create these uninstallers??


You can have multiple uninstall sections instead of one "Uninstall" section. Just put un. in front of section names. You can then add a MUI_UNPAGE_COMPONENTS.

Stu


Nice, Thanks for reply.

What i'm thinking to do is:
-Create a section un.install_toolbar to remove toolbar fileset.
-Create a section un.MainProgram to remove software fileset(actually it is done on section Uninstall).
-Remove section Uninstall(un.MainProgram will do the work).

So if I create this structure, when i use WriteUninstaller on each Section(install_toolbar and MainProgram), NSIS will create diferents and independents uninstallers? Is it?

And about MUI_UNPAGE_COMPONENTS, how it works? it1s only add this command on script? need any argument?

Sorry ask without test the solution, but i'm at home now, and i havent access of scripts.


You can't write multiple uninstallers. You will have one uninstaller with 2 uninstall sections.

Stu


Now i'm a bit confused.

What I need is 2 independent uninstallers. When i run "Program uninstaller" he will remove the Program fileset only, and when i run "Toolbar uninstaller" he will remove toolbar fileset only.

Is it possible to do? If yes, can you help me a bit?


Ok, I have made some tests and now i understand what you say.

So the only way to not run all un. section is using MUI_UNPAGE_COMPONENTS?

What i thinking to do is something like this:
On un.onInit(maybe other place) he checks if uninstaller is toolbar uninstaller or Program unsinstaller and "select" one of the sections to run.

Is it possible? Or without MUI_UNPAGE_COMPONENTS the uninstaller will run all un. sections?