public RepositoryAppPackage(Guid id, AppPackage package)
        {
            if (package == null) throw new ArgumentNullException(nameof(package));
            if (id == Guid.Empty) throw new ArgumentException("Empty guid is not allowed", nameof(id));

            Id = id;
            Package = package;
        }
        public void Install(AppPool appPool, AppPackage package)
        {
            UnpackPackageContents(appPool, package.ContentStream);

            var installConfigStream = m_InstallFiles[$"/Install/Info{FileExtension.AppInstallConfig}"];
            var installConfig = (SimpleInstallConfig)new XmlSerializer(typeof (SimpleInstallConfig)).Deserialize(installConfigStream);

            var exitCode = RunPackageInstaller(appPool, installConfig.RunFile);
            if (exitCode != installConfig.ExpectedExitCode)
                throw new Exception("unexpected exit code");
        }
        public void Initialize(AppPoolConfig config, IFileSystem fileSystem)
        {
            Config = config;
            FileSystem = fileSystem;

            m_Packages.Clear();

            var packagesDir = fileSystem.DirectoryInfo.FromDirectoryName(Config.PackagesDirectory);
            foreach (var file in packagesDir.GetFiles($"*{FileExtension.AppPackage}", SearchOption.TopDirectoryOnly))
            {
                using (var fileStream = file.Open(FileMode.Open, FileAccess.Read, FileShare.Read))
                {
                    var package = new AppPackage();
                    package.Load(fileStream);

                    AddPackage(package);
                }
            }
        }
 public void RemovePackage(AppPackage package)
 {
     
 }
 public void AddPackage(AppPackage package)
 {
     m_Packages.Add(package.Id, package);
 }
 public void Uninstall(AppPool appPool, AppPackage package)
 {
     
 }