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

[custom action and feature] - Condition unmet in maintenance

Tue Mar 03, 2009 11:05 am

Hello,

I am trying to propose default value for 'SQLConnectionDlg' dialog. I have set in "Custom Actions" > "InstallUISequence" > "Begin" some property sources witch intend to set the Property 'MY_DEFAULT_PROP' to "foobar" under the condition "(Not Installed)". This is working.

I understand this as "If this is the first install, just replace MY_DEFAULT_PROP with foobar value".

As I need the 'SQLConnectionDlg' dialog for a feature of my package, I intend to be able to remove that package (no problem with the dialog to remove the database) and to be able to add this feature again without uninstalling the whole package. I then modify only the condition of my custom action to meet this condition:

Code: Select all

((&my_feature = 3) AND NOT (!my_feature = 2)) OR (Not Installed)
I used the wizard to achieve this. But unfortunately, it does not work as I intend...

Could you help me, please?

Best regards,
-- Nicolas D.

Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact:  Website

Re: [custom action and feature] - Condition unmet in maintenance

Tue Mar 03, 2009 5:19 pm

Hi Nicolas,

I'm not sure I understand the connection between the feature and the custom action. Can you please give me more details about this? What must happen to the feature in order to run the custom action?

The condition you are currently using is true during the first install or when the feature with the identifier "my_feature" is reinstalled.

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 action and feature] - Condition unmet in maintenance

Tue Mar 03, 2009 5:36 pm

Hi Cosmin,
I'm not sure I understand the connection between the feature and the custom action. Can you please give me more details about this? What must happen to the feature in order to run the custom action?
You are right, I'll try to be more precise:
if my_feature is not installed on the local computer AND will be installed locally,
OR
if this is the first install (my_feature could be not installed at first time),
then run the CA.
The condition you are currently using is true during the first install or when the feature with the identifier "my_feature" is reinstalled.
Both. It is always true at first install, and it must be true if during a maintenance mode, I choose to install "my_feature".

Is it a little more clear now?

Best regards,
-- Nicolas D.

Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact:  Website

Re: [custom action and feature] - Condition unmet in maintenance

Tue Mar 03, 2009 5:50 pm

Hi Nicolas,

You can try using this condition:

Code: Select all

(Not Installed) OR (& my_feature = 3)
This condition is true during the first installation or when the "my_feature" feature will be installed. Please note that the feature actions are set during the "CostFinalize" standard action. Therefore, the custom action should run after it. Also, during maintenance the custom action should run after the "CustomizeDlg" dialog is used (for example you can use a DoAction control event).

The safest approach is to schedule the custom action after "InstallExecuteSequence" -> "CostFinalize".

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 action and feature] - Condition unmet in maintenance

Thu Mar 05, 2009 11:22 am

Hi Cosmin,

Sorry for the delay. I'll implement this asap and take you informed.

Regards,
-- Nicolas D.

Return to “Common Problems”