Also that's not how CustomActionData works. Using it as:

session.CustomActionData["SERVICEUSER"] ="MyUser"

is wrong AFAIK in the context of those managed custom actions.
CustomActionData is not used that way. To send CustomActionData to a custom
action called Fred, you set the property Fred to the data. When Fred runs,
it asks for the CustomActionData property and gets the value. You set it
with a type 51 CA and rthen read it from the custom action.

http://stackoverflow.com/questions/11233267/how-to-pass-customactiondata-to-a-customaction-using-wix


Phil Wilson


On Thu, Oct 31, 2013 at 11:17 AM, Hoover, Jacob
<jacob.hoo...@greenheck.com>wrote:

> If your CA is immediate, I believe you want to do:
>
> session["SERVICEUSER"] ="MyUser";
>
> I believe the CustomActionData is only for deferred custom actions, and is
> only one way communication.
>
> -----Original Message-----
> From: Swaroop Kare [mailto:swaroop.k...@ifdspercana.com]
> Sent: Thursday, October 31, 2013 5:15 AM
> To: General discussion about the WiX toolset.
> Subject: Re: [WiX-users] SetProperty Behaviour
>
> I am wondering if some one can assist me how to fix the issue.
>
>
>
> Problem: I have set a session variable in a CA function written in C# and
> then trying to copy that value back into a property that is declared in WIX.
>
>
>
> Solution implemented:
>
>
>
> I have CA with logic that will set the value as below and is in the
> execute sequence and is scheduled before "CostInitialize"
>
>
>
> session.CustomActionData["SERVICEUSER"] ="MyUser";
>
>
>
>  I am now trying to retrieve the value back to WIX
>
> <SetProperty Id="USER_SERVICE_ACCOUNT" Value="[SERVICEUSER]"
> After="CostFinalize" Sequence="execute">
>
>      <![CDATA[PATCH]]>
>
> </SetProperty>
>
>
>
> My property declaration in WIX is as follows
>
> <Property Id="USER_SERVICE_ACCOUNT" Secure="yes">YYYY</Property>
>
>
>
>
>
> In the verbose log
>
> Action ended 12:40:35: CostFinalize. Return value 1.
>
> MSI (s) (40:28) [12:40:35:951]: Doing action: SetUSER_SERVICE_ACCOUNT
>
> Action 12:40:35: SetUSER_SERVICE_ACCOUNT.
>
> Action start 12:40:35: SetUSER_SERVICE_ACCOUNT.
>
> MSI (s) (40:28) [12:40:35:967]: PROPERTY CHANGE: Deleting
> USER_SERVICE_ACCOUNT property. Its current value is 'YYYY'.
>
> Action ended 12:40:35: SetUSER_SERVICE_ACCOUNT. Return value 1.
>
>
>
> The result I was expecting was something like this and not the deletion of
> property.
>
> PROPERTY CHANGE: Modifying USER_SERVICE_ACCOUNT property. Its current
> value is 'YYYY'. Its new value: 'MyUser'.
>
>
>
>
>
> Thanks
>
> ________________________________
>
> From: Swaroop Kare
> Sent: 29 October 2013 10:48
> To: 'General discussion about the WiX toolset.'
> Subject: RE: [WiX-users] SetProperty Behaviour
>
>
>
> Hi Blair/Jacob,
>
>
>
>    I think that SetProperty creates the necessary custom action and that
> it is not deferred. This is currently scheduled after "CostFinalize" in
> execute Sequence.
>
>
>
>  The CA to set {session.CustomActionData["SERVICEUSER"] ="MyUser"; } is
> also in the execute sequence and is scheduled before "CostInitialize".
>
>
>
> Through logging, I have checked the value of CA variable SERVICEUSER in CA
> and the values are set as expected. As CA to set customactiondata and
> setproperty custom action runs in the same execute sequence, I taught both
> CA share the same session variables. Is that correct?
>
>
>
>
>
> Action ended 11:31:44: CostInitialize. Return value 1.
>
> MSI (s) (CC:A0) [11:31:44:293]: Doing action: SetUSER_SERVICE_ACCOUNT
>
> Action 11:31:44: SetUSER_SERVICE_ACCOUNT.
>
> Action start 11:31:44: SetUSER_SERVICE_ACCOUNT.
>
> MSI (s) (CC:A0) [11:31:44:309]: PROPERTY CHANGE: Deleting
> USER_SERVICE_ACCOUNT property. Its current value is 'OtherUser'.
>
> Action ended 11:31:44: SetUSER_SERVICE_ACCOUNT. Return value 1.
>
>
>
> Thanks
>
>
>
> -----Original Message-----
> From: Blair Murri [mailto:os...@live.com]
> Sent: 29 October 2013 07:20
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] SetProperty Behaviour
>
>
>
> Is your CA run in the same sequence as SetUSER_SERVICE_ACCOUNT?
>
>
>
>
>
> What does your log say about the value of SERVICEUSER? Is it set in a line
> in your log that starts “MSI (s)”?
>
>
>
>
>
>
>
>
>
>
>
>
>
> Blair
>
>
>
>
>
>
>
>
>
>
>
> From: Hoover, Jacob
>
> Sent: Friday, October 25, 2013 11:19 AM
>
> To: General discussion for Windows Installer XML toolset.
>
>
>
>
>
>
>
>
>
>
>
> Is your CA scheduled as deferred?
>
>
>
> -----Original Message-----
>
> From: Swaroop Kare [mailto:swaroop.k...@ifdspercana.com]
>
> Sent: Friday, October 25, 2013 12:27 PM
>
> To: General discussion about the WiX toolset.
>
> Subject: Re: [WiX-users] SetProperty Behaviour
>
>
>
> Hi Jacob,
>
>
>
>
>
>
>
> Please interpret XXXX  as [SERVICEUSER] which is coming from CA and being
> set as below in CA
>
>
>
>
>
>
>
> session.CustomActionData["SERVICEUSER"] ="MyUser";
>
>
>
>
>
>
>
> Thanks
>
>
>
>
>
>
>
> -----Original Message-----
>
> From: Hoover, Jacob [mailto:jacob.hoo...@greenheck.com]
>
> Sent: 25 October 2013 15:51
>
> To: General discussion about the WiX toolset.
>
> Subject: Re: [WiX-users] SetProperty Behaviour
>
>
>
>
>
>
>
> Is XXX in this case referring to another property?  The reason it deletes
> is because it has no value.
>
>
>
>
>
>
>
> -----Original Message-----
>
>
>
> From: Swaroop Kare [mailto:swaroop.k...@ifdspercana.com]
>
>
>
> Sent: Friday, October 25, 2013 9:41 AM
>
>
>
> To: General discussion about the WiX toolset.
>
>
>
> Subject: [WiX-users] SetProperty Behaviour
>
>
>
>
>
>
>
> Hi,
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>    I am using wix element SetProperty to preserve a value of the property
> during repair/ patch installation as shown in the below snippet
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> <SetProperty Id="USER_SERVICE_ACCOUNT" Value="XXXX" After="CostFinalize"
>
>
>
> Sequence="execute">
>
>
>
>
>
>
>
>                      <![CDATA[PATCH]]>
>
>
>
>
>
>
>
> </SetProperty>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> My property declaration is as follows
>
>
>
>
>
>
>
> <Property Id="USER_SERVICE_ACCOUNT" Secure="yes">YYYY</Property>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> In the verbose log
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Action ended 12:40:35: CostFinalize. Return value 1.
>
>
>
>
>
>
>
> MSI (s) (40:28) [12:40:35:951]: Doing action: SetUSER_SERVICE_ACCOUNT
>
>
>
>
>
>
>
> Action 12:40:35: SetUSER_SERVICE_ACCOUNT.
>
>
>
>
>
>
>
> Action start 12:40:35: SetUSER_SERVICE_ACCOUNT.
>
>
>
>
>
>
>
> MSI (s) (40:28) [12:40:35:967]: PROPERTY CHANGE: Deleting
> USER_SERVICE_ACCOUNT property. Its current value is 'YYYY'.
>
>
>
>
>
>
>
> Action ended 12:40:35: SetUSER_SERVICE_ACCOUNT. Return value 1.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> The result I was expecting was something like this
>
>
>
>
>
>
>
> PROPERTY CHANGE: Modifying USER_SERVICE_ACCOUNT property. Its current
> value is 'YYYY'. Its new value: 'XXXX'.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I see a link with the similar issue
>
>
>
> http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Patching-e
>
>
>
> rror-td7586521.html and I have taken care of points that have explained
> here. Is there anything I am still missing?
>
>
>
>
>
> Thanks
>
>
>
>
>
>
>
>
>
>
> This email and any files transmitted with it are confidential and intended
> solely for the use of the individual or entity to which it is addressed and
> may contain information which is privileged, confidential or prohibited
> from disclosure or unauthorised use. You are hereby notified that any use,
> any form of reproduction, dissemination, copying, disclosure, modification,
> distribution and/or publication of this e-mail message or its attachments
> other than by it's intended recipient is strictly prohibited by the sender.
> If you have received this email in error, please notify the system manager
> by email at ad...@ifdspercana.com Please note that any views or opinions
> presented in this email are solely those of the author and do not
> necessarily represent those of the company. Finally, this email has been
> scanned for the presence of viruses. The recipient should also check this
> email and any attachments for the presence of viruses. The company accepts
> no liability for any damage caused by any virus transmitted by this email
> ______________________________________________________________________________________
>
> IFDS Percana Group Limited, no. 307152, is registered in Ireland at 16
> Joyce Way, Park West Business Park, Dublin 12, Ireland.
> Directors: Eugene Larmon, Patrick Concannon, William Slattery, Paul O'Neil
> (UK), Simon Hudson-Lund (UK) and Stephen Parkinson (UK) IFDS Percana
> International Managed Services Limited, no. 368022, is regulated by the
> Central Bank of Ireland. Registered in Ireland at 16 Joyce Way, Park West
> Business Park, Dublin 12, Ireland.
> IFDS Percana International Managed Services Limited is a wholly owned
> subsidiary of IFDS Percana Group Limited and provides support services to
> the life and pensions industry.
> Directors: Eugene Larmon, Patrick Concannon, Stephen Parkinson (UK) and
> Paul O'Neil (UK).
> www.ifdspercana.com
>
> ______________________________________________________________________
> This email has been scanned by the Symantec Email Security.cloud service.
> For more information please visit 
> http://www.symanteccloud.com______________________________________________________________________
>
> ------------------------------------------------------------------------------
> Android is increasing in popularity, but the open development platform
> that developers love is also attractive to malware creators. Download this
> white paper to learn more about secure code signing practices that can help
> keep Android apps secure.
> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
> ------------------------------------------------------------------------------
> Android is increasing in popularity, but the open development platform that
> developers love is also attractive to malware creators. Download this white
> paper to learn more about secure code signing practices that can help keep
> Android apps secure.
> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to