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 }
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!"); }