Exemple #1
0
 public bool Uninstall(AppInfo app)
 {
     if (app.ResourcePath.Exists)
     {
         app.ResourcePath.Delete(true);
     }
     Desktop.Apps.Delete(app);
     Desktop.Apps.Save();
     OnAppInstalledOrUninstalled?.Invoke(this, null, app);
     return(true);
 }
Exemple #2
0
 public bool Install(AppInfo app, ExtractExistingFileAction action = ExtractExistingFileAction.DoNotOverwrite)
 {
     if (string.IsNullOrWhiteSpace(app.InstalationPath))
     {
         app.SetInstalationPath($@"Data\{app.AppName}\");
     }
     if (!app.ResourcePath.Exists)
     {
         app.ResourcePath.Create();
     }
     using (var zip = Initialize(ZipFile.Read(app.AppPath.FullName)))
         zip.ExtractAll(app.ResourcePath.FullName, action);
     app.GenerateManifest();
     Desktop.Apps.Add(app);
     Desktop.Apps.Save();
     OnAppInstalledOrUninstalled?.Invoke(this, app, null);
     return(true);
 }