Run multiple msi in EmbeddedChainer

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Run multiple msi in EmbeddedChainer

loonloon0625
This post has NOT been accepted by the mailing list yet.
For example, I have Msi A, B, and C. Msi Band C will be located in Chainer.cs class.

How to run Msi B and C in the chainer.cs class, I have following this post: http://stackoverflow.com/questions/5272718/wix-embeddedchainer-examples/31970869#31970869

namespace ChainerRun
{
    public class CustomActions
    {
      static void Main(string[] args)
      {
        System.Diagnostics.Debugger.Launch();

        try
        {
            IntPtr ptr = new IntPtr(Convert.ToInt32(args[0], 16));
            //ptr = System.Runtime.InteropServices.Marshal.StringToCoTaskMemAuto(args[0]);
            Transaction transaction = Transaction.FromHandle(ptr, true);
            transaction.Join(TransactionAttributes.JoinExistingEmbeddedUI);

          Installer.InstallProduct(@"c:\A.msi", argline);
          Installer.InstallProduct(@"c:\B.msi", argline); //unable to works

            transaction.Commit();
            transaction.Close();

        }
        catch (Exception e)
        {
            throw e;
        }
    }

    [CustomAction]
    public static ActionResult CustomAction1(Session session)
    {
        System.Diagnostics.Debugger.Launch();
        session.Log("My CustomAction1() begins ...");
    }
}