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!

shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Custom action is not running during the Modify

Hi,

I have custom action, which needs to run during the installation, upgrade, or modify.

I have used the following condition
- (((&TSP = 3) AND NOT (!TSP = 3)) OR (&TSP = 5))

This works fine for the installation and upgrade, but during the modify it does not get called.

Reproduction Steps:
1) Extract the zip file(Will mail you because it is more than 1 MB)
2) Open the setup
file(client\client\Setup\DesktopControl\UCSoftphone\Setup.aip)
3) build it
4) When you get the "Features dialog", select all features.
5) Complete the installation
6) Now, run the setup again
7) Select "Modify" option
9) When you get the "Features dialog", deselect "addin"
10) In this case AddTSP32Bit does not run

Any help is appreciated.

Regards,
Rohan
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Custom action is not running during the Modify

Hello Rohan,

In the sent project we saw you already checked in our GUI the options to run on Install, Upgrade on Maintenance. But from the additional condition I see you also want the custom action to run only if the feature TSP gets (re)installed.

The part of the conditions where it says "NOT (!TSP = 3)" means that the condition is true if the feature is not reinstalled, while as "&STP = 5" is true if the feature is reinstalled. Maybe there is the problem?

Have you tried just this condition?:

Code: Select all

(&TSP = 3) OR (&TSP = 5)
All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Re: Custom action is not running during the Modify

Thanks for the response.

As part of the conditions I have added the following(from predefined conditions)
"Feature will be installed Local. The feature is not reinstalled" OR "Feature is being reinstalled"
which turns out to be
( ((&TSP = 3) AND NOT (!TSP = 3)) OR (&TSP = 5) )

Can you please let me know if this is incorrect?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Custom action is not running during the Modify

Hello Rohan,
"Feature will be installed Local. The feature is not reinstalled" OR "Feature is being reinstalled"
which turns out to be
( ((&TSP = 3) AND NOT (!TSP = 3)) OR (&TSP = 5) )

Can you please let me know if this is incorrect?
This condition is correct. I apologize for my previous assertion, I wrongly evaluated your condition.

However, the custom action doesn't get launched when you launch your setup second time -> Modify -> keep your TSP feature selected for install on "CustomizeDlg" dialog -> Install, because the Windows Installer doesn't interpret this action as a feature reinstallation. In this case Windows Installer will set an "unknown" action state for the TSP feature. This is the standard Windows Installer behavior when installing a feature, running the setup second time -> Modify -> keep your feature selected for install on "CustomizeDlg" dialog -> Install.

As a workaround, in order to achieve what you want you can try to use a condition like this:

Code: Select all

(((&TSP = 3) AND NOT (!TSP = 3)) OR (&TSP = 5) OR ((&TSP = -1) AND (!TSP = 3)))
However, if you want to run the related custom action every time during the installation, upgrade, and modify, then it is recommended to remove the above condition from the "Condition" field of your custom action and only check the "Install" and "Maintenance" option under "Execution Stage Condition" section.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Re: Custom action is not running during the Modify

Thanks it worked.

As you have suggested I am running this for every installation(without any condition)
shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Re: Custom action is not running during the Modify

I need one more additional(similar help).

My setup advertises 3 features, one of them being Outlook Addin. Currently my setup makes sure to terminate the outlook(custom action which runs just before the PrepareDlg which is under Wizard Dialogs Stage), which is working fine.

Now, I would like to change installer to do the following

Fresh installation: If the "Outlook Addin" feature is selected by the user, then I want to run this custom action just before Installfinalize

Modify:
case 1): If the "Outlook Addin" feature is selected by the user, then I want to run this custom action just before Installfinalize
case 2), If the "Outlook Addin" was earlier installed by the user, and now user deselects the same. Then I want to run this cusom action just before Installfinalize

Upgrade: If "Outlook Addin" is installed earlier(and same is being upgraded), then I want to run this custom action just before Installfinalize

Uninstall: If "Outlook Addin" is installed earlier(and same is being uninstalled), then I want to run this custom action just before Installfinalize

Can you please help with this?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Custom action is not running during the Modify

Hello Rohan,

In order to find out your custom action execution conditions you can try to use the &Feature and !Feature expressions. The &Feature indicates the action state of a feature (for example if a feature will be installed or not) and the !Feature indicates the installed state of a feature (for example if a feature is already installed when the installation runs). In order to check the value of a feature action or state at a certain stage during installation you can check the Session.FeatureCurrentState and Session.FeatureRequestState properties of the Session object.

Also, considering the complexity of your custom action condition maybe you can try to find out a complementary condition which will be FALSE when you DO NOT want to run the custom action just before InstallFinalize.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Re: Custom action is not running during the Modify

Thanks Daniel,

It worked with the following condition
((&OutlookAddIn = 3) OR (&OutlookAddIn = 5) OR ((!OutlookAddIn = 3) AND (&OutlookAddIn <> 3)) )

Regards,
Rohan
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Custom action is not running during the Modify

You're welcome Rohan.

Thank you for sharing the solution with us. Certainly this will be useful for future users facing with similar scenarios.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”