コード例 #1
0
ファイル: InstallTask.cs プロジェクト: JFronny/UpTool2
        public override void Run()
        {
            bool trying = true;

            while (trying)
            {
#if !DEBUG
                try
                {
#endif
                AppInstall.Install(App, true);
                _postInstall?.Invoke();
                trying = false;
#if !DEBUG
            }
            catch (Exception e1)
            {
                trying = MessageBox.Show(e1.ToString(), "Install failed", MessageBoxButtons.RetryCancel) ==
                         DialogResult.Retry;
            }
#endif
            }
        }
コード例 #2
0
 private static void Install(string identifier, bool force)
 {
     RepoManagement.GetReposFromDisk();
     App[] apps = AppExtras.FindApps(identifier);
     if (apps.Length == 0)
     {
         if (File.Exists(identifier))
         {
             Console.WriteLine("Name:");
             string name = Console.ReadLine();
             AppInstall.InstallZip(identifier, new App(name, "Locally installed package, removal only",
                                                       GlobalVariables.MinimumVer, "", true, "",
                                                       Guid.NewGuid(), Color.Red, "", false, ""), force);
             Console.WriteLine($"Successfully installed \"{name}\"");
         }
         else
         {
             Console.WriteLine("Package not found.");
             Console.WriteLine(identifier);
         }
     }
     else
     {
         App tmp = apps.First();
         if ((tmp.Status & Status.Installed) == Status.Installed)
         {
             Console.WriteLine("Package is already installed");
         }
         else
         {
             Console.WriteLine($"Installing {tmp.Name}");
             AppInstall.Install(tmp, true);
         }
     }
     Console.WriteLine("Done!");
 }
コード例 #3
0
ファイル: UploadTask.cs プロジェクト: JFronny/UpTool2
        public void Run()
        {
#if !DEBUG
            try
            {
#endif
            Guid id = Guid.NewGuid();
            while (GlobalVariables.Apps.ContainsKey(id) || Directory.Exists(PathTool.GetAppPath(id)))
            {
                id = Guid.NewGuid();
            }
            App appI = new App(_name, "Locally installed package, removal only",
                               GlobalVariables.MinimumVer, "", true, "", id, Color.Red, Resources.C_64.ToBitmap(), false, "");
            AppInstall.InstallZip(ZipFile, appI, true);
            _postInstall?.Invoke();
#if !DEBUG
        }

        catch (Exception e1)
        {
            MessageBox.Show(e1.ToString(), "Install failed");
        }
#endif
        }
コード例 #4
0
        public async Task <int> SaveAppInstallAsync(AppInstall appInstall)
        {
            await _context.AppInstalls.AddAsync(appInstall);

            return(await _context.SaveChangesAsync());
        }