Intermittently, when calling custom actions written in .Net (C#), an error is 
reported to the Windows Installer even though the code returned "Success". We 
are using Wix 3.0.5419.0.

Example:
Action start 14:02:56: IISReset.
SFXCA: Extracting custom action to temporary directory: 
C:\Windows\Installer\MSI6439.tmp-\
SFXCA: Binding to CLR version v2.0.50727
Calling custom action 
IISCustomAction!InstallerCustomActions.CustomActions.IISReset
CustomAction (IISReset):
Attempting stop...
Internet services successfully stopped
Attempting start...
Internet services successfully restarted
Action ended 14:03:06: IISReset. Return value 3.
Action ended 14:03:06: INSTALL. Return value 3.

The custom action code is fairly simple:
        [CustomAction]
        public static ActionResult IISReset(Session session)
        {
            ProcessStartInfo iisResetCmd = new ProcessStartInfo("iisreset.exe");
            iisResetCmd.RedirectStandardOutput = true;
            iisResetCmd.UseShellExecute = false;
            iisResetCmd.CreateNoWindow = true;
            Process p = new Process();
            p.StartInfo = iisResetCmd;
            p.Start();
            string res = p.StandardOutput.ReadToEnd();
            session.Log("CustomAction (IISReset): " + res);
            return ActionResult.Success;
        }

This happens occasionally (1 in ~50 installs) with several of the custom 
actions (all are in the same dll, but IISReset is the simplest example). Code 
compiled with "Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1", and 
then MakeSfxCA.exe ("Deployment Tools Foundation custom action packager version 
3.0.0.0"). Installing onto Windows Server 2008 (64-bit). Attempting to install 
a second time on the same server succeeds. Installation done from command line 
without using the GUI (nobody has complained of strange failures using the GUI 
so far).

Is this a known issue? Any idea on how to prevent this from happening?

Thanks
--- John

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to