I need to perform certain action on my checkbox.
At the start if the installation the chkbox is disabled. There is a button
to call a custom action and verify certain things and assign a value to a
variable.
This variable will decide whether to enable chkbox or not. I have
implemented till this part:

<Control Id="ImportCheckBox"        Type="CheckBox"
CheckBoxValue="1"        X="35" Y="100"        Width="160" Height="20"
       Disabled="yes"        Text="!(loc.Virtual_ChkBox)"
Property="ENABLEVIRTUAL">  <Condition
Action="enable"><![CDATA[INTEGRATED = "1"]]></Condition>  <Condition
Action="disable"><![CDATA[INTEGRATED = "0"]]></Condition></Control>

So as soon as I launch the installer, the chkbox is disabled and unchecked.
If Verify is OK then its became enable but still unchecked. Suppose a user
does not check this box and proceeds with installation then what vale gets
stored in registry (I am storing this value ENABLEVIRTUAL to registry).

If empty gets stored then it will give error while performing repair or
uninstall. How can I store this value?

Again,
In custom action i have used a string null or empty chk (obtained from
previous installer dialog), if not null then verify works else it give
throw exception:

[CustomAction]
        public static ActionResult Check(Session mpSession)
        {
            mpSession.Log("Begin CustomActions.Check");

            String sServerName =
GetSetProperties.GetSessionProperty(mpSession, "INSTALLMACHINE",
false);

            if (!String.IsNullOrEmpty(sServerName))
            {
                try
                {
                   //Something
                    GetSetProperties.SetSessionProperty(mpSession,
"INTEGRATED", packs.Count != 1 ? "0" : "1");
                }
                catch (Exception oException)
                {
                    HandleException(mpSession, oException);
                    return ActionResult.Failure;
                }
            }
            else
            {
                throw new Exception("SDK Service Machine cannot be empty.");
            }

            return ActionResult.Success;
        }

 private static void HandleException(Session mpSession, Exception ex)
        {
            string errorMsg = "Exception during custom action
execution:" + ex.ToString();

            mpSession.Log(errorMsg);

            mpSession.Message(InstallMessage.Error, new Record {
FormatString = errorMsg });
        }

Here in this code Catch, else and HandleException are not working properly
and the installer gets interrupted in between. How can I fix this?

Some working code will be very useful as I am new to WiX.
-- 
Thanks and Regards,
Ravi Raj
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to