Hi,

Currently using Wix 3.5.

We are looking at rewriting our CA's in C#, so I've started to play with DTF 
and a few examples. However, I can't understand no matter what value I try with 
session["<value>"] it throws an exception.

In the logs I see a list of Property(s) like:

Property(S): INSTALLLOCATION = C:\Program Files (x86)\WixCustomAction\
Property(S): WixUIRMOption = UseRM
Property(S): ALLUSERS = 1
Property(S): ARPNOMODIFY = 1
Property(S): myActionId1 = MyLocation=C:\Program Files 
(x86)\WixCustomAction\;AnotherValue='Action1'
Property(S): ProgramFilesFolder = C:\Program Files (x86)\
Property(S): TARGETDIR = D:\

Thus I figure I could access them like so:
        [CustomAction]
        public static ActionResult MySimpleAction1(Session session)
        {
            Debugger.Launch();
            try
            {
                var s1 = session["TARGETDIR"];

                session.Message(InstallMessage.Warning,
                     new Record(new object[]
                     {
                        string.Format("INSTALLLOCATION{0}", s1)
                     }));
            }
            catch (Exception exception)
            {
                session.Log(exception.ToString());
                return ActionResult.Failure;
            }
            return ActionResult.Success;
        }

I've tried INSTALLLOCATION, a few values for the Windows Installer help file 
(under properties [Window Installer]) page and I've also tried accessing this 
custom property:
        <!-- Configurable install location -->
        <Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />

My Custom Action is declared like so:
        <CustomAction Id="myActionId1"
                                    BinaryKey="myAction"
                                    DllEntry="MySimpleAction1"
                                    Return="check" />

        <CustomAction Id="SetCustomActionDataValue1" Return="check"
                     Property="myActionId1" 
Value="MyLocation=[INSTALLLOCATION];AnotherValue='Action1'" />

        <InstallExecuteSequence>
            <Custom Action="SetCustomActionDataValue1" Before="myActionId1">NOT 
Installed</Custom>
            <Custom Action="myActionId1" Before="InstallFinalize">NOT 
Installed</Custom>
        </InstallExecuteSequence>

Log file products this:
SFXCA: Binding to CLR version v2.0.50727
Calling custom action 
MyCustomAction!MyCustomAction.SimpleCustomAction.MySimpleAction1
System.Collections.Generic.KeyNotFoundException: The given key was not present 
in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Microsoft.Deployment.WindowsInstaller.CustomActionData.get_Item(String 
key)
   at MyCustomAction.SimpleCustomAction.MySimpleAction1(Session session)
CustomAction myActionId1 returned actual error code 1603 (note this may not be 
100% accurate if translation happened inside sandbox)

Thus, I'm not sure what I'm doing wrong. Any help would be great.

Thanks,

Tristen Fielding
Sr. Software Developer / Program Lead
TradeStation Group, Inc.
http://www.TradeStation.com<http://www.tradestation.com/>

8050 SW 10th Street, Suite 2000
Plantation, FL 33324
Tel.  954.652.7320
Fax 954.652.5320



TradeStation Group, Inc. is the parent company of four operating subsidiaries, 
TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), IBFX, Inc. 
(Member NFA), TradeStation Technologies, Inc., a trading software and 
subscription company, and TradeStation Europe Limited, a United Kingdom, 
FSA-authorized introducing brokerage firm. None of these companies provides 
trading or investment advice, recommendations or endorsements of any kind. The 
information transmitted is intended only for the person or entity to which it 
is addressed and may contain confidential and/or privileged material. Any 
review, retransmission, dissemination or other use of, or taking of any action 
in reliance upon, this information by persons or entities other than the 
intended recipient is prohibited. If you received this in error, please contact 
the sender and delete the material from any computer. Forex products and 
services are offered by TradeStation Forex, a division of IBFX, Inc.

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to