tarnic
Posts: 26
Joined: Mon May 18, 2009 10:41 am

Confirm Uninstall

Hi all,
I have 2 questions:

1)
I have searched a lot in the forum (the search function in this forum is not very comfortable!!!), but no results.
I found only how to show a MsgBox, like a Confirm Box, but during uninstall how I can set that the uninstall process continue or terminate by the client selection (button yes or button no)?

I created the custom action like in the screenshot, set the UninstallYesNo Property initially to No.
Now, how can I stop uninstall if the client press No button?


2) About upgrade, in the Media Tab, if I set this:
- MediaTab
- Bootstrapper, Create EXE setup file
- Install MSI as minor upgrade (if applicable)
Help manual say this:
If a smaller version of the current product is already installed then the current product is installed as a minor upgrade for the existing product.
If this option is not used and a smaller version of the current product is installed then the installation of the current product will fail.

But it's only if I use EXE? If I use MSI?
And why isn't this option set to checked to default? Because if it isn't checked the installation fail...
Maybe this option must be checked every time, or not?


Thank you for your help
Attachments
uninstall.png
uninstall.png (50 KiB) Viewed 5886 times
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Confirm Uninstall

Hello,

you can try using the search feature from our introductory page[/ur to get better results.

1) You can check our guide on [url=http://www.advancedinstaller.com/user-g ... e-box.html]How to display a messagebox
. Note that the fourth parameter holds the name of the property, and not the property itself. In essence, your action data for the MessageBox should looks something like:

Code: Select all

Are you sure | Uninstall Box | MB_YESNO, MB_ICONWARNING, MB_SETFOREGROUND | UNINSTALL_YES_NO | [CLIENTPROCESSID]
note the lack of square brackets in the fourth parameter. Also the property must be all upper-case letters for it to be accessed globally.

Also note that the message box's purpose is to retrieve input from the user. The input will be stored in UNINSTALL_YES_NO (in our example). Use this property in a vbscript. The script will be responsible for terminating the install or not, by returning one of the values from this MSDN article (the ones from the third collumn)

2) The option you are referring to is not .msi specific and is only available in an EXE installer. It is implemented by our bootstrapper thus it is disabled by default. The recommended way of dealing with upgrades is to use a major upgrade, which is supported by Windows Installer without requiring additional configurations

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
tarnic
Posts: 26
Joined: Mon May 18, 2009 10:41 am

Re: Confirm Uninstall

I have done all that you suggest me, but there are some problems.

I created the message box like your example, on How to display a messagebox
Example usage:
Hello, this is a test.\nContinue with install? | Title | MB_YESNO , MB_SETFOREGROUND , MB_ICONQUESTION | MYRESULTPROPERTY | [CLIENTPROCESSID]

View the attached screenshot.
AI Project, exactly like your example in the User Guide
AI Project, exactly like your example in the User Guide
1.png (43.64 KiB) Viewed 5873 times
But the result, isn't the same. The message box appear only with OK button, and not Yes or No. Also no icon.
Wrong result. No Yes or No button, No Icon
Wrong result. No Yes or No button, No Icon
2.png (8.04 KiB) Viewed 5873 times
What is my error?

Thank you
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Confirm Uninstall

Hello,

This is indeed an issue with the presentation. I have added an improvement on our TODO list and a fix will be available in the next version of Advanced Installer which is scheduled somewhere in the near future.
In the meantime you can use the '&' character as a separator instead of a ','. Your field would look something like:

Code: Select all

Hello, this is a test.\nContinue with install? | Title | MB_YESNO & MB_SETFOREGROUND & MB_ICONQUESTION | MYRESULTPROPERTY | [CLIENTPROCESSID]
Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
tarnic
Posts: 26
Joined: Mon May 18, 2009 10:41 am

Re: Confirm Uninstall

Ok thank you for your help.

Last question: can I also use C# DLL Library in my projects? or only C++?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Confirm Uninstall

Hello,

Only .NET Installer Classes are supported for C#.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”