Hello Uwe,

Thanks for the info. This is my action script code:

*public class CustomActions
    {
        [CustomAction]
        public static ActionResult MySimpleAction(Session session)
        {
            try
            {
                File.AppendAllText(@"c:\tmp\time.txt", ";Installation: " +
DateTime.Now.ToString());
            }
            catch (Exception)
            {
                return ActionResult.Failure;
            }
            return ActionResult.Success;
        }
    }*The above custom script is creating a text file under tmp folder. It
works fine when tmp folder exists without error. But when I remove temp
folder to check the error message to display, setup is ending prematurely.

Following are my CustomAction and Install Sequence

* <CustomAction Id="myActionId"
          BinaryKey="myAction"
          DllEntry="MySimpleAction"
          Execute="deferred"
          Return="check" />

      <InstallExecuteSequence>
        <Custom Action="myActionId" After="InstallInitialize"></Custom>
      </InstallExecuteSequence>*


Thanks & Regards,
Bharat Jasti
Team IT
Rainbow Design Services



On Tue, Apr 12, 2011 at 5:08 AM, Uwe Ernst <uwe.er...@gmail.com> wrote:

> Hi Bharat,
>
> your CustomAction probably throws an uncatched exception. Methods
> capable of throwing exceptions should be executed from within a
> try-catch block. There you can show the user your own error message or
> create the missing directory. My experience is, that exceptions are not
> transported from the c# method to the installer runtime, so you always
> have to take care of possible exceptions.
>
>
> Regards Uwe
>
> Am 12.04.2011 00:02, schrieb bharatj:
> > Hello All,
> >
> > I have written my first action script using C#. It has to create a text
> > under temp folder. If temp folder exists action script runs successfully
> and
> > WIX MSI works perfect. If temp folder doesnt exist action script returns
> > failure and Setup ends prematurely. It is not showing the intended
> message
> > like " Unable to create file ".
>
>
>
> ------------------------------------------------------------------------------
> Forrester Wave Report - Recovery time is now measured in hours and minutes
> not days. Key insights are discussed in the 2010 Forrester Wave Report as
> part of an in-depth evaluation of disaster recovery service providers.
> Forrester found the best-in-class provider in terms of services and vision.
> Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to