diff --git a/MyWebsite.msi b/MyWebsite.msi index d0aa7bd..b032bef 100644 Binary files a/MyWebsite.msi and b/MyWebsite.msi differ diff --git a/MyWebsite.wxs b/MyWebsite.wxs index 624112c..a219622 100644 --- a/MyWebsite.wxs +++ b/MyWebsite.wxs @@ -1,297 +1,254 @@ - + - + - - + + - - + + + + - + - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - - - + + + - - - + + - - - + + + - - - + + + - - - + - - - + - - - + + + - - - + + + - - - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - + + + + + + + + + + + + + + + + + - - - - - - + + - - - - + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - @@ -300,66 +257,49 @@ + + - - - - - - - - - - - + + - - - - + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/QuikPak/Certificate.cs b/QuikPak/Cert.cs similarity index 82% rename from QuikPak/Certificate.cs rename to QuikPak/Cert.cs index 59fbae0..94009ee 100644 --- a/QuikPak/Certificate.cs +++ b/QuikPak/Cert.cs @@ -6,12 +6,12 @@ using System.Threading.Tasks; namespace QuikPak { - public class Certificate : IEquatable + public class Cert : IEquatable { public string CertificatePath { get; set; } public string PfxPassword { get; set; } - public bool Equals(Certificate other) + public bool Equals(Cert other) { return string.Equals(this.CertificatePath, other.CertificatePath); } diff --git a/QuikPak/Config.cs b/QuikPak/Config.cs index cf2a680..54f1fb6 100644 --- a/QuikPak/Config.cs +++ b/QuikPak/Config.cs @@ -15,7 +15,7 @@ namespace QuikPak public int IdleTimeout { get; set; } = 0; public string ManagedPipelineMode { get; set; } = "Integrated"; public string ManagedRuntimeVersion { get; set; } = "v4.0"; - public ICollection Certificates { get; set; } = new HashSet(); + public ICollection Certificates { get; set; } = new HashSet(); } public class Endpoint diff --git a/QuikPak/Program.cs b/QuikPak/Program.cs index 1802d03..bb6a007 100644 --- a/QuikPak/Program.cs +++ b/QuikPak/Program.cs @@ -38,22 +38,22 @@ namespace QuikPak } addresses.Add(new WebSite.WebAddress() { + //Port = Endpoint.Port, + //Address = Endpoint.DnsName, Attributes = attr }); } - var project = new Project(config.Name) + var items = new List(); + foreach(var cert in config.Certificates) + { + var name = System.IO.Path.GetFileNameWithoutExtension(cert.CertificatePath); + items.Add(new Binary(new Id(name), cert.CertificatePath)); + items.Add(new Certificate(name, StoreLocation.localMachine, StoreName.personal, cert.CertificatePath, authorityRequest: false)); + } + + var project = new Project(config.Name, items.ToArray()) { - //Certificates = config.Certificates.Select(a => new WixSharp.Certificate( - // System.IO.Path.GetFileNameWithoutExtension(a.CertificatePath), - // StoreLocation.localMachine, - // StoreName.personal, - // a.CertificatePath - // , false - // ) - //{ - // PFXPassword = a.PfxPassword, - //}).ToArray(), Dirs = new[] { new Dir(new Id("IISMain"), config.Name + "_" +config.Version.ToString() +"_Web", @@ -62,12 +62,16 @@ namespace QuikPak new File(options.Config, new IISVirtualDir { - Name = config.Name + "_Web_VDIR", - WebSite = new WebSite(config.Name) + Name = config.Name + "WebSite", + AppName = "ImAnAppName", + WebSite = new WebSite(new Id(config.Name + "WebSite"), config.Name + "WebSite") { InstallWebSite = true, - Description = config.Name, - Addresses = addresses.ToArray() + Addresses = addresses.ToArray(), + Attributes = new Dictionary() + { + // ["awesome"] = "yo" + } }, WebAppPool = new WebAppPool(config.Name) { Attributes = new Dictionary() { @@ -75,9 +79,9 @@ namespace QuikPak ["RecycleMinutes"] = config.RecycleMinutes.ToString(), ["IdleTimeout"] = config.IdleTimeout.ToString(), ["ManagedPipelineMode"] = config.ManagedPipelineMode, - ["ManagedRuntimeVersion"] = config.ManagedRuntimeVersion + ["ManagedRuntimeVersion"] = config.ManagedRuntimeVersion, } - } + }, }) ) }, @@ -88,6 +92,7 @@ namespace QuikPak PreserveTempFiles = true, UpgradeCode = new Guid(config.UpgradeCode), }; + project.Properties.Add(new Property("REINSTALLMODE", "dmus")); project.MajorUpgrade = new MajorUpgrade() { AllowDowngrades = true, Schedule = UpgradeSchedule.afterInstallInitialize }; project.MajorUpgradeStrategy = new MajorUpgradeStrategy() @@ -101,6 +106,15 @@ namespace QuikPak }, RemoveExistingProductAfter = Step.InstallInitialize }; + project.WixSourceGenerated += doc => + doc.FindAll("WebSite") + .ForEach(x => x.AddElement(new System.Xml.Linq.XElement("WebApplication"), attributes: new Dictionary() + { + ["Id"] = "webapppoolgen", + ["Name"] = "weapppoolgen" + config.Name, + ["WebAppPool"] = $"{config.Name}WebSite_AppPool" + })); + Compiler.BuildMsi(project); } } diff --git a/QuikPak/QuikPak.csproj b/QuikPak/QuikPak.csproj index 9ee9ab4..f6b4516 100644 --- a/QuikPak/QuikPak.csproj +++ b/QuikPak/QuikPak.csproj @@ -72,7 +72,7 @@ - +