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