Ejemplo n.º 1
0
        public void InstallPackage(string fastPackageReference)
        {
            var requirements = ParseReference(fastPackageReference);

            try
            {
                Install(requirements);
                SelfUpdateCheck();
            }
            catch (UnsuitableInstallBaseException ex)
            {
                string installLocation = ZeroInstallInstance.FindOther(ex.NeedsMachineWide);
                if (installLocation == null)
                {
                    if (Handler.Ask(Resources.AskDeployZeroInstall + Environment.NewLine + ex.Message,
                                    defaultAnswer: true, alternateMessage: ex.Message))
                    {
                        installLocation = DeployInstance(ex.NeedsMachineWide);
                    }
                    else
                    {
                        return;
                    }
                }

                // Since we cannot another copy of Zero Install from a different location into the same AppDomain, simply pretend we are running from a different source
                Locations.OverrideInstallBase(installLocation);
                Install(requirements);
            }
        }
Ejemplo n.º 2
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            WindowsUtils.RegisterApplicationRestart(_machineWide ? "--restart --machine" : "--restart");

            UpdateAppListAsync();
            _tileManagement.LoadCachedCatalog();
            LoadCatalogAsync();

            bool firstRun = OnFirstRun();

            if (_tileManagement.AppList.Entries.Count == 0)
            {
                if (firstRun)
                {
                    using var dialog = new IntroDialog();
                    dialog.ShowDialog(this);
                }

                // Show catalog automatically if AppList is empty
                tabControlApps.SelectTab(tabPageCatalog);
            }

            if (ZeroInstallInstance.IsRunningFromCache)
            {
                if (ZeroInstallInstance.FindOther() == null)
                {
                    deployTimer.Enabled = true;
                }
            }
            else
            {
                selfUpdateWorker.RunWorkerAsync();
            }
        }