[custom dialog] - use the same dialog for install/uninstall - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Nico-D
Posts: 63
Joined: Mon Aug 18, 2008 2:34 pm

[custom dialog] - use the same dialog for install/uninstall

Hello,

I already succeeded many time in defining Published Events for conditional enabled buttons, and conditional NewDialog action (depending of one property).

Nevertheless, I am encountering the following problem: during uninstall, one dialog is stalled, i.e. I can only choose "Cancel", because "Back" and "Next" buttons are not functional.

What I want to do is the following:
- a package containing all data and SQL scripts required,
- install: creates a DB, using "SQLConnectionDlg",
- uninstall: drop DB, using "SQLConnectionDlg" too.

Install works perfectly, but uninstall do not let me able to use "Back" and "Next" buttons.

Uninstall architecture (first level is a dash, second level is '- >', third level is '- > >'. etc.):
- PrepareDlg
- MaintenanceWelcomeDlg
- MaintenanceTypeDlg
- > NewDialog_1 (a custom dialog asking if the user wants to drop the DB)
- > > SQLConnectionDLG
- > > VerifyRemoveDlg
- > VerifyRemoveDlg
- ProgressDlg
- ExitDialog

If I am setting the property "DROP_DB_DROP" to "DropDB" in NewDialog_1, the uninstall process is "stalling" on SQLConnectionDlg. If not, everything works fine.

Let's concentrate to SQLConnectionDlg. I have defined many Published events on the "Back" button, for instance:

Code: Select all

NewDialog
WelcomeDlg
AI_INSTALL

NewDialog
NewDialog_1
REMOVE="ALL"
I also tried with (REMOVE="ALL" AND (NOT UPGRADINGPRODUCTCODE)), and with Feature (&FeatureName=2) AND (!FeatureName=3) after the URL you gave me earlier. It works at install time ("Back" button is usable) but not at uninstall time (clicking on "Back" has no effect).

Could you please tell me if I am taking the good directions or not? Do you have any idea of what I did wrong?

Best regards,
-- Nicolas D.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: [custom dialog] - use the same dialog for install/uninstall

Hi Nicolas,
Install works perfectly, but uninstall do not let me able to use "Back" and "Next" buttons.
This behavior may be caused by the control events you are using. Can you please send us your AIP to support at advancedinstaller dot com so we can investigate it?
Could you please tell me if I am taking the good directions or not?
During the installation the user enters the SQL Connection information in the "SQLConnectionDlg" dialog. This information can be saved in the registry by using the Registry page. For example, you can create a registry value for each property used in the "SQLConnectionDlg" dialog. The property can be used in the "Data" field of the Edit Registry Entry dialog:

During uninstall, these registry values can be retrieved through searches. The properties of these searches can be used in the SQL connection which drops the database, instead of using another "SQLConnectionDlg" dialog. This approach is explained in the Make the properties keep their values during Maintenance how-to.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Nico-D
Posts: 63
Joined: Mon Aug 18, 2008 2:34 pm

Re: [custom dialog] - use the same dialog for install/uninstall

Hi Cosmin
This behavior may be caused by the control events you are using. Can you please send us your AIP to support at advancedinstaller dot com so we can investigate it?
I will try to send you a small zip file asap. Nevertheless...
... This information can be saved in the registry by using the Registry page ...
... I really like this solution! :)
The only bad point making me hesitating is the storage of any password in the Registry. But it must be possible to popup a text field asking for a db admin password, and setting a registry? I will investigate.

Thank you very much for your suggestion.
-- Nicolas D.
Nico-D
Posts: 63
Joined: Mon Aug 18, 2008 2:34 pm

Re: [custom dialog] - use the same dialog for install/uninstall

This behavior may be caused by the control events you are using. Can you please send us your AIP to support at advancedinstaller dot com so we can investigate it?
I have just sent it. Thanks in advance.

You have to install the package, and uninstall it while checking "Drop the corresponding Database too". You will then experience the problem I am encountering. To remove the package, the standard uninstall (keeping the DB) is working.

Regards,
-- Nicolas D.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: [custom dialog] - use the same dialog for install/uninstall

Hi Nicolas,

I found the following problems in your project:

1) The "Next" button on the "SQLConnectionDlg" dialog uses control conditions based on the properties of the editboxes on the dialog. Please note that filling an editbox cannot update its property as long as the editbox has focus. Only after another control is selected the property of the editbox will be updated. Therefore, filling the last empty editbox will not enable the "Next" button until another control is selected.

2) Multiple "NewDialog" control events use the condition:

Code: Select all

REMOVE = "ALL"
Please note that the REMOVE property is set when the user clicks on the "Remove" button in the "VerifyRemoveDlg" dialog. Therefore, the "REMOVE" property is not set before this button is clicked. Instead of the REMOVE property you can use this condition:

Code: Select all

AI_MAINT
This property is set when the package runs in Maintenance mode. The buttons which use the REMOVE property incorrectly are:
- the "Next" and "Back" buttons on the "CustomUserDB" dialog
- the "Next" button on the "SQLConnectionDlg" dialog

3) The "Back" button on the "SQLConnectionDlg" dialog uses the condition:

Code: Select all

(&DatabaseModule=2) AND (!DatabaseModule=3)
Although the feature state can be accessed ("!DatabaseModule=3"), the feature action has not been set yet ("&DatabaseModule=2" is set by the "Remove" button on "VerifyRemoveDlg"). Therefore, the condition will always be false. You can replace this condition with:

Code: Select all

AI_MAINT
Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Nico-D
Posts: 63
Joined: Mon Aug 18, 2008 2:34 pm

Re: [custom dialog] - use the same dialog for install/uninstall

Thank you Cosmin, I cannot believe it is so easy. :?
-- Nicolas D.

Return to “Common Problems”