antidotcb
Posts: 34
Joined: Mon May 17, 2010 8:10 am

Rollback CA doesn't receive CustomActionData

Hi, there

I try to pass parameters to rollback function via CustomActionData, but function receives nothing.
Here is example application, to show you the problem.
Attachments
Bug.zip
Sample solution, with 4 custom actions, written in javascript (2 normal, 2 rollbacks)
(2.78 KiB) Downloaded 470 times
antidotcb
Posts: 34
Joined: Mon May 17, 2010 8:10 am

Re: Rollback CA doesn't receive CustomActionData

Hi again

I made my own investigation on this problem, and here goes what i have found.
Let's look onto generated by AI resulted .msi file with Orca (build previously attached .aip project with AI 8.9.41901).

There are a table InstallExecuteSequence. We are intrested in following Custom Actions:
* AI_DATA_SETTER_1 (setups CustomActionData for ShowMessageOnRollbackInstall)
* AI_DATA_SETTER_2 (setups CustomActionData for ShowMessageOnRollbackUninstall)
AI_DATA_SETTER_1.png
AI_DATA_SETTER_1.png (31.83 KiB) Viewed 5659 times
These custom actions are sequenced to run before our Rollback Custom Actions.

They setup value for CustomActionData property, as you may know.
If these custom actions (AI_DATA_SETTER_1 & AI_DATA_SETTER_2) aren't executed, the CustomActionData for Rollback would be empty.

Let's look into log file for clear installation:

Code: Select all

MSI (s) (CC:F8) [19:47:16:737]: Skipping action: AI_DATA_SETTER_2 (condition is false)
It's ok, because condition for ShowMessageOnRollbackUninstall is designed as ( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) ). It's first installation, so Installed isn't defined and condition evaluates to false.

But let's look for execution of AI_DATA_SETTER_1, as it has valid to run condition ( NOT Installed ), and should be executed during clear installation.

Code: Select all

MSI (s) (CC:F8) [19:47:16:791]: Doing action: AI_DATA_SETTER_1
Action 19:47:16: AI_DATA_SETTER_1. 
Action start 19:47:16: AI_DATA_SETTER_1.
MSI (s) (CC:F8) [19:47:16:792]: Skipping action due to msidbCustomActionTypeFirstSequence option.
Action ended 19:47:16: AI_DATA_SETTER_1. Return value 0.
Wow! What's that? Skipping action due to msidbCustomActionTypeFirstSequence option.? Action skipped?
Of course it's skipped. Why? There you can find the answer:
msidbCustomActionTypeFirstSequence
Hexadecimal: 0x00000100
Decimal: 256
Execute no more than once if present in both sequence tables. Always skips action in execute sequence if UI sequence has run. No effect in UI sequence.
The action is not required to be present or run in the UI sequence to be skipped in the execute sequence. Not affected by install service registration.
Let's look inside .msi with Orca again. Now we will observe "CustomActions" table.
CustomActionTypes.png
CustomActionTypes.png (32.78 KiB) Viewed 5659 times
Do you see ActionType for AI_DATA_SETTER_1? It's equals 307.
And for AI_DATA_SETTER_3 (setups CustomActionData for ShowMessageOnUninstall) it is 51.

What is 307? I think it is 256 + 51 = 307. Why it get there? It get there mistankenly. It's all about msidbCustomActionTypeRollback (Hexadecimal: 0x00000100, Decimal: 256). It has same value as msidbCustomActionTypeFirstSequence.
Because AI_DATA_SETTER_1 setups CustomActionData for ShowMessageOnRollbackInstall, and ShowMessageOnRollbackInstall is rollback (it has this type msidbCustomActionTypeRollback), Advanced installer errornously put this msidbCustomActionTypeRollback into type of AI_DATA_SETTER_1.
But msidbCustomActionTypeRollback works only when msidbCustomActionTypeInScript is defined (Action marked as deffered), otherwise it works as msidbCustomActionTypeFirstSequence, that prevents custom action from running inside InstallExecuteSequence.

Ok, let's do the main part. Edit .msi file with Orca, and change ActionType for AI_DATA_SETTER_1 into value of 51. (Same for AI_DATA_SETTER_2).
After this actions done everything works perfectly.

P.S. Thanks for fast response. X_X
Last edited by antidotcb on Mon Mar 26, 2012 12:06 pm, edited 1 time in total.
CiprianComsa
Posts: 110
Joined: Thu Aug 19, 2010 10:11 am
Contact: Website

Re: Rollback CA doesn't receive CustomActionData

Hi,
This behavior is caused by a bug in Advanced Installer when using 8.9 version.
Thank you for bringing it to our attention. A bugfix will be included in the next version.
Until then you can make a workaround to avoid this problem :
Open your aip project file with a txt editor and find the next line:

Code: Select all

<ROW Action="AI_DATA_SETTER_1" Type="307" Source="ShowMessageOnRollbackInstall" Target="OnRollbackInstall"/>

Change from Type="307" to Type="51". In case you will make other changes in the custom actions page make sure the manual fix stays in place
Also, a fix has already been implemented by our development team and will be available very soon. If you would like a RC version of the fix please write us an e-mail at support at advancedinstaller dot com.

Regards,
Ciprian
__________________________________________________________________________________________________________________________________________________
Ciprian Comsa
Advanced Installer Team
http://www.advancedinstaller.com/
Ciprian Comsa - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Rollback CA doesn't receive CustomActionData

This bug has been fixed in version 9.0 which is now available.

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”