示例#1
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);
 }