Example #1
0
 private static ActionResult ProcessInstall(Session Ctx, WiXInstallType InstallType)
 {
     IWiXSetup Install = null;
     try
     {
         Ctx.AttachToSetupLog();
         switch (InstallType)
         {
             case WiXInstallType.InstallServer:
                 Install = ServerSetup.Create(Ctx.CustomActionData, SetupActions.Install);
                 break;
             case WiXInstallType.RemoveServer:
                 Install = ServerSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall);
                 break;
             case WiXInstallType.MaintenanceServer:
                 Install = ServerSetup.Create(Ctx.CustomActionData, SetupActions.Setup);
                 break;
             case WiXInstallType.InstallEnterpriseServer:
                 Install = EServerSetup.Create(Ctx.CustomActionData, SetupActions.Install);
                 break;
             case WiXInstallType.RemoveEnterpriseServer:
                 Install = EServerSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall);
                 break;
             case WiXInstallType.MaintenanceEnterpriseServer:
                 Install = EServerSetup.Create(Ctx.CustomActionData, SetupActions.Setup);
                 break;
             case WiXInstallType.InstallPortal:
                 Install = PortalSetup.Create(Ctx.CustomActionData, SetupActions.Install);
                 break;
             case WiXInstallType.RemovePortal:
                 Install = PortalSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall);
                 break;
             case WiXInstallType.MaintenancePortal:
                 Install = PortalSetup.Create(Ctx.CustomActionData, SetupActions.Setup);
                 break;
             case WiXInstallType.InstallScheduler:
                 Install = SchedulerSetup.Create(Ctx.CustomActionData, SetupActions.Install);
                 break;
             case WiXInstallType.RemoveScheduler:
                 Install = SchedulerSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall);
                 break;
             default:
                 throw new NotImplementedException();
         }
         Install.Run();
     }
     catch (WiXSetupException we)
     {
         Ctx.Log("Expected exception: " + we.ToString());
         return ActionResult.Failure;
     }
     catch (Exception ex)
     {
         Ctx.Log(ex.ToString());
         return ActionResult.Failure;
     }
     return ActionResult.Success;
 }
Example #2
0
        private static ActionResult ProcessInstall(Session Ctx, WiXInstallType InstallType)
        {
            IWiXSetup Install = null;

            try
            {
                Ctx.AttachToSetupLog();
                switch (InstallType)
                {
                case WiXInstallType.InstallServer:
                    Install = ServerSetup.Create(Ctx.CustomActionData, SetupActions.Install);
                    break;

                case WiXInstallType.RemoveServer:
                    Install = ServerSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall);
                    break;

                case WiXInstallType.MaintenanceServer:
                    Install = ServerSetup.Create(Ctx.CustomActionData, SetupActions.Setup);
                    break;

                case WiXInstallType.InstallEnterpriseServer:
                    Install = EServerSetup.Create(Ctx.CustomActionData, SetupActions.Install);
                    break;

                case WiXInstallType.RemoveEnterpriseServer:
                    Install = EServerSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall);
                    break;

                case WiXInstallType.MaintenanceEnterpriseServer:
                    Install = EServerSetup.Create(Ctx.CustomActionData, SetupActions.Setup);
                    break;

                case WiXInstallType.InstallPortal:
                    Install = PortalSetup.Create(Ctx.CustomActionData, SetupActions.Install);
                    break;

                case WiXInstallType.RemovePortal:
                    Install = PortalSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall);
                    break;

                case WiXInstallType.MaintenancePortal:
                    Install = PortalSetup.Create(Ctx.CustomActionData, SetupActions.Setup);
                    break;

                default:
                    throw new NotImplementedException();
                }
                Install.Run();
            }
            catch (WiXSetupException we)
            {
                Ctx.Log("Expected exception: " + we.ToString());
                return(ActionResult.Failure);
            }
            catch (Exception ex)
            {
                Ctx.Log(ex.ToString());
                return(ActionResult.Failure);
            }
            return(ActionResult.Success);
        }