Esempio n. 1
0
    public async void Handle(RunInstallEvent message)
    {
        installWasAttempted = true;
        itemsToInstall      = message.SelectedItems;
        if (chocolateyInstaller.IsInstalled())
        {
            var chocolateyUpgradeRequired = await chocolateyInstaller.ChocolateyUpgradeRequired();

            if (chocolateyUpgradeRequired)
            {
                ActivateModel <UpdateChocolateyViewModel>();
                return;
            }
            ActivateInstallingViewModel();
            return;
        }
        ActivateModel <InstallChocolateyViewModel>();
    }
Esempio n. 2
0
    public async void ReCheck()
    {
        try
        {
            CanAcceptInput = false;
            await RefreshDetectedVersion();

            var chocolateyUpgradeRequired = await chocolateyInstaller.ChocolateyUpgradeRequired();

            if (chocolateyInstaller.IsInstalled() && !chocolateyUpgradeRequired)
            {
                eventAggregator.Publish <UserInstalledChocolatey>();
            }
        }
        finally
        {
            CanAcceptInput = true;
        }
    }