private void UnpackPackageContents(AppPool appPool, Stream contentStream)
        {
            var packageContents = ZipFile.Read(contentStream);
            var tempDir = appPool.GetTemporaryPackageDirectory();

            foreach (var entry in packageContents.EntriesSorted)
            {
                var entryPath = Path.Combine(tempDir.FullName, entry.FileName);

                if (entry.IsDirectory)
                {
                    var entryDir = appPool.FileSystem.DirectoryInfo.FromDirectoryName(entryPath);
                    entryDir.Create();
                }
                else
                {
                    var entryFile = appPool.FileSystem.FileInfo.FromFileName(entryPath);
                    var entryStream = entryFile.Open(FileMode.Create, FileAccess.Write, FileShare.None);
                    entry.Extract(entryStream);
                    entryStream.Flush();
                    entryStream.Seek(0, SeekOrigin.Begin);

                    m_InstallFiles.Add(entry.FileName, entryStream);
                }
            }
        }
        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 Uninstall(AppPool appPool, IAppInstaller uninstaller)
 {
     
 }
 public void Install(AppPool appPool, IAppInstaller installer)
 {
     
 }
 public void Uninstall(AppPool appPool, AppPackage package)
 {
     
 }
 private Int32 RunPackageInstaller(AppPool appPool, String runFile)
 {
     return 0;
 }