示例#1
0
        public override ExitCode Execute()
        {
            if (!ZeroInstallInstance.IsDeployed)
            {
                Log.Error(Resources.SelfRemoveNotDeployed);
                return(ExitCode.NoChanges);
            }

            if (MachineWide && WindowsUtils.IsWindows && !WindowsUtils.IsAdministrator)
            {
                throw new NotAdminException(Resources.MustBeAdminForMachineWide);
            }

            if (!ZeroInstallInstance.IsLibraryMode && !Handler.Ask(Resources.AskRemoveZeroInstall, defaultAnswer: true))
            {
                return(ExitCode.UserCanceled);
            }

            if (IntegrationCommand.ExistingDesktopIntegration())
            {
                new RemoveAllApps(Handler).Execute();
            }
            if (MachineWide && IntegrationCommand.ExistingDesktopIntegration(machineWide: true))
            {
                new RemoveAllApps(Handler)
                {
                    MachineWide = true
                }
            }
 public async Task Send <TCommand>(IntegrationCommand command) where TCommand : IntegrationCommand
 {
     await _bus.Send <TCommand>(command);
 }
 public async Task Send(IntegrationCommand command)
 {
     await _bus.Send(command);
 }