private static void ProcessLegacySkin(string skinFolder, string skinType) { string skinName = Path.GetFileName(skinFolder); if (skinName != "_default") { SkinPackageInfo skin = new SkinPackageInfo(); skin.SkinName = skinName; skin.SkinType = skinType; PackageInfo package = CreateSkinPackage(skin); SkinPackageWriter skinWriter = new SkinPackageWriter(skin, package); skinWriter.GetFiles(false); package.Manifest = skinWriter.WriteManifest(true); CommonLibrary.Services.Installer.Packages.PackageController.SavePackage(package); skin.PackageID = package.PackageID; skin.SkinPackageID = SkinController.AddSkinPackage(skin); foreach (InstallFile skinFile in skinWriter.Files.Values) { if (skinFile.Type == InstallFileType.Ascx) { if (skinType == "Skin") { SkinController.AddSkin(skin.SkinPackageID, Path.Combine("[G]" + SkinController.RootSkin, Path.Combine(skin.SkinName, skinFile.FullName))); } else { SkinController.AddSkin(skin.SkinPackageID, Path.Combine("[G]" + SkinController.RootContainer, Path.Combine(skin.SkinName, skinFile.FullName))); } } } } }
private static void CreateSkinManifest(XmlWriter writer, string skinFolder, string skinType, string tempInstallFolder, string subFolder) { string skinName = Path.GetFileNameWithoutExtension(skinFolder); SkinPackageInfo skin = new SkinPackageInfo(); skin.SkinName = skinName; skin.SkinType = skinType; PackageInfo package = CreateSkinPackage(skin); SkinPackageWriter skinWriter = new SkinPackageWriter(skin, package, tempInstallFolder, subFolder); skinWriter.GetFiles(false); skinWriter.SetBasePath(); skinWriter.WriteManifest(writer, true); }