2 Commits

Author SHA1 Message Date
Tommy Parnell
98eb1574ef certs 2016-05-09 21:43:37 -04:00
Tommy Parnell
47bc01e2b9 stopping for now 2016-05-04 20:30:40 -04:00
9 changed files with 398 additions and 24 deletions

BIN
MyWebsite.msi Normal file

Binary file not shown.

307
MyWebsite.wxs Normal file
View File

@@ -0,0 +1,307 @@
<?xml version="1.0" encoding="Windows-1252"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="4f3ca8e0-4878-4ae6-80d3-7f9fed988280" Name="MyWebsite" Language="1033" Codepage="Windows-1252" Version="1.0.0" UpgradeCode="317e4313-2314-46e9-ae7e-6cdfee60c05d" Manufacturer="parne">
<Package InstallerVersion="200" Compressed="yes" SummaryCodepage="Windows-1252" Languages="1033" />
<Media Id="1" Cabinet="MyWebsite.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="IISMain" Name="MyWebsite_1.0.0_Web">
<Component Id="Component.config.json" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f86a47420">
<File Id="config.json" Source="config.json" />
<WebVirtualDir Id="VirtDir" Alias="MyWebsiteWebSite" Directory="IISMain" WebSite="MyWebsiteWebSite" xmlns="http://schemas.microsoft.com/wix/IIsExtension">
<WebApplication Id="ImAnAppNameWebApplication" Name="ImAnAppName" WebAppPool="MyWebsiteWebSite_AppPool" />
</WebVirtualDir>
<WebSite Id="MyWebsiteWebSite" Description="MyWebsiteWebSite" Directory="IISMain" xmlns="http://schemas.microsoft.com/wix/IIsExtension">
<WebAddress Id="MyWebsiteWebSite_Address1" IP="*" Port="80" Secure="no" Header="*" />
<WebApplication Id="webapppoolgen" Name="weapppoolgenMyWebsite" WebAppPool="MyWebsiteWebSite_AppPool" />
</WebSite>
<WebAppPool Id="MyWebsiteWebSite_AppPool" Name="MyWebsite" Identity="localSystem" RecycleMinutes="0" IdleTimeout="0" ManagedPipelineMode="Integrated" ManagedRuntimeVersion="v4.0" xmlns="http://schemas.microsoft.com/wix/IIsExtension" />
</Component>
<Directory Id="IISMain.CommandLineParser.1.9.71" Name="CommandLineParser.1.9.71">
<Component Id="Component.CommandLineParser.1.9.71.nupkg" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f2f01fccd">
<File Id="CommandLineParser.1.9.71.nupkg" Source="packages\CommandLineParser.1.9.71\CommandLineParser.1.9.71.nupkg" />
</Component>
<Component Id="Component.readme.txt" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f81b924d8">
<File Id="readme.txt" Source="packages\CommandLineParser.1.9.71\readme.txt" />
</Component>
<Directory Id="IISMain.CommandLineParser.1.9.71.lib" Name="lib">
<Directory Id="IISMain.CommandLineParser.1.9.71.lib.net35" Name="net35">
<Component Id="Component.CommandLine.dll" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f46bd7523">
<File Id="CommandLine.dll" Source="packages\CommandLineParser.1.9.71\lib\net35\CommandLine.dll" />
</Component>
<Component Id="Component.CommandLine.xml" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f1c0c5907">
<File Id="CommandLine.xml" Source="packages\CommandLineParser.1.9.71\lib\net35\CommandLine.xml" />
</Component>
</Directory>
<Directory Id="IISMain.CommandLineParser.1.9.71.lib.net40" Name="net40">
<Component Id="Component.CommandLine.dll.1" Guid="4f3ca8e0-4878-4ae6-80d3-7f9fb82d7520">
<File Id="CommandLine.dll.1" Source="packages\CommandLineParser.1.9.71\lib\net40\CommandLine.dll" />
</Component>
<Component Id="Component.CommandLine.xml.1" Guid="4f3ca8e0-4878-4ae6-80d3-7f9faf9cafc4">
<File Id="CommandLine.xml.1" Source="packages\CommandLineParser.1.9.71\lib\net40\CommandLine.xml" />
</Component>
</Directory>
<Directory Id="IISMain.CommandLineParser.1.9.71.lib.net45" Name="net45">
<Component Id="Component.CommandLine.dll.2" Guid="4f3ca8e0-4878-4ae6-80d3-7f9fa023d3f1">
<File Id="CommandLine.dll.2" Source="packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll" />
</Component>
<Component Id="Component.CommandLine.xml.2" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f96920d95">
<File Id="CommandLine.xml.2" Source="packages\CommandLineParser.1.9.71\lib\net45\CommandLine.xml" />
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="IISMain.Newtonsoft.Json.8.0.3" Name="Newtonsoft.Json.8.0.3">
<Component Id="Component.Newtonsoft.Json.8.0.3.nupkg" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f888e83b5">
<File Id="Newtonsoft.Json.8.0.3.nupkg" Source="packages\Newtonsoft.Json.8.0.3\Newtonsoft.Json.8.0.3.nupkg" />
</Component>
<Directory Id="IISMain.Newtonsoft.Json.8.0.3.lib" Name="lib">
<Directory Id="IISMain.Newtonsoft.Json.8.0.3.lib.net20" Name="net20">
<Component Id="Component.Newtonsoft.Json.dll" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f6bf2ed5b">
<File Id="Newtonsoft.Json.dll" Source="packages\Newtonsoft.Json.8.0.3\lib\net20\Newtonsoft.Json.dll" />
</Component>
<Component Id="Component.Newtonsoft.Json.xml" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f6a2bc0c7">
<File Id="Newtonsoft.Json.xml" Source="packages\Newtonsoft.Json.8.0.3\lib\net20\Newtonsoft.Json.xml" />
</Component>
</Directory>
<Directory Id="IISMain.Newtonsoft.Json.8.0.3.lib.net35" Name="net35">
<Component Id="Component.Newtonsoft.Json.dll.1" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f6475882e">
<File Id="Newtonsoft.Json.dll.1" Source="packages\Newtonsoft.Json.8.0.3\lib\net35\Newtonsoft.Json.dll" />
</Component>
<Component Id="Component.Newtonsoft.Json.xml.1" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f4bc8a81a">
<File Id="Newtonsoft.Json.xml.1" Source="packages\Newtonsoft.Json.8.0.3\lib\net35\Newtonsoft.Json.xml" />
</Component>
</Directory>
<Directory Id="IISMain.Newtonsoft.Json.8.0.3.lib.net40" Name="net40">
<Component Id="Component.Newtonsoft.Json.dll.2" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f4c6be6ff">
<File Id="Newtonsoft.Json.dll.2" Source="packages\Newtonsoft.Json.8.0.3\lib\net40\Newtonsoft.Json.dll" />
</Component>
<Component Id="Component.Newtonsoft.Json.xml.2" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f33be06eb">
<File Id="Newtonsoft.Json.xml.2" Source="packages\Newtonsoft.Json.8.0.3\lib\net40\Newtonsoft.Json.xml" />
</Component>
</Directory>
<Directory Id="IISMain.Newtonsoft.Json.8.0.3.lib.net45" Name="net45">
<Component Id="Component.Newtonsoft.Json.dll.3" Guid="4f3ca8e0-4878-4ae6-80d3-7f9faac37164">
<File Id="Newtonsoft.Json.dll.3" Source="packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll" />
</Component>
<Component Id="Component.Newtonsoft.Json.xml.3" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f90179150">
<File Id="Newtonsoft.Json.xml.3" Source="packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.xml" />
</Component>
</Directory>
<Directory Id="IISMain.Newtonsoft.Json.8.0.3.lib.portable_net40_sl5_wp80_win8_wpa81" Name="portable-net40+sl5+wp80+win8+wpa81">
<Component Id="Component.Newtonsoft.Json.dll.4" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f92bacf35">
<File Id="Newtonsoft.Json.dll.4" Source="packages\Newtonsoft.Json.8.0.3\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll" />
</Component>
<Component Id="Component.Newtonsoft.Json.xml.4" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f63d14a49">
<File Id="Newtonsoft.Json.xml.4" Source="packages\Newtonsoft.Json.8.0.3\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.xml" />
</Component>
</Directory>
<Directory Id="IISMain.Newtonsoft.Json.8.0.3.lib.portable_net45_wp80_win8_wpa81_dnxcore50" Name="portable-net45+wp80+win8+wpa81+dnxcore50">
<Component Id="Component.Newtonsoft.Json.dll.5" Guid="4f3ca8e0-4878-4ae6-80d3-7f9fef125b9a">
<File Id="Newtonsoft.Json.dll.5" Source="packages\Newtonsoft.Json.8.0.3\lib\portable-net45+wp80+win8+wpa81+dnxcore50\Newtonsoft.Json.dll" />
</Component>
<Component Id="Component.Newtonsoft.Json.xml.5" Guid="4f3ca8e0-4878-4ae6-80d3-7f9fc02ad6ae">
<File Id="Newtonsoft.Json.xml.5" Source="packages\Newtonsoft.Json.8.0.3\lib\portable-net45+wp80+win8+wpa81+dnxcore50\Newtonsoft.Json.xml" />
</Component>
</Directory>
</Directory>
<Directory Id="IISMain.Newtonsoft.Json.8.0.3.tools" Name="tools">
<Component Id="Component.install.ps1" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f9766bf15">
<File Id="install.ps1" Source="packages\Newtonsoft.Json.8.0.3\tools\install.ps1" />
</Component>
</Directory>
</Directory>
<Directory Id="IISMain.WixSharp.1.0.35.3" Name="WixSharp.1.0.35.3">
<Component Id="Component.readme.txt.1" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f13118b93">
<File Id="readme.txt.1" Source="packages\WixSharp.1.0.35.3\readme.txt" />
</Component>
<Component Id="Component.WixSharp.1.0.35.3.nupkg" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f755a89e6">
<File Id="WixSharp.1.0.35.3.nupkg" Source="packages\WixSharp.1.0.35.3\WixSharp.1.0.35.3.nupkg" />
</Component>
<Directory Id="IISMain.WixSharp.1.0.35.3.build" Name="build">
<Component Id="Component.SetEnvVar.dll" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f2c9df8cd">
<File Id="SetEnvVar.dll" Source="packages\WixSharp.1.0.35.3\build\SetEnvVar.dll" />
</Component>
<Component Id="Component.WixSharp.targets" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f52b5ce72">
<File Id="WixSharp.targets" Source="packages\WixSharp.1.0.35.3\build\WixSharp.targets" />
</Component>
</Directory>
<Directory Id="IISMain.WixSharp.1.0.35.3.tools" Name="tools">
<Component Id="Component.Install.ps1.1" Guid="4f3ca8e0-4878-4ae6-80d3-7f9fd38a38b8">
<File Id="Install.ps1.1" Source="packages\WixSharp.1.0.35.3\tools\Install.ps1" />
</Component>
</Directory>
</Directory>
<Directory Id="IISMain.WixSharp.bin.1.0.35.3" Name="WixSharp.bin.1.0.35.3">
<Component Id="Component.WixSharp.bin.1.0.35.3.nupkg" Guid="4f3ca8e0-4878-4ae6-80d3-7f9face407ed">
<File Id="WixSharp.bin.1.0.35.3.nupkg" Source="packages\WixSharp.bin.1.0.35.3\WixSharp.bin.1.0.35.3.nupkg" />
</Component>
<Directory Id="IISMain.WixSharp.bin.1.0.35.3.lib" Name="lib">
<Component Id="Component.BootstrapperCore.dll" Guid="4f3ca8e0-4878-4ae6-80d3-7f9fc4faada7">
<File Id="BootstrapperCore.dll" Source="packages\WixSharp.bin.1.0.35.3\lib\BootstrapperCore.dll" />
</Component>
<Component Id="Component.BootstrapperCore.xml" Guid="4f3ca8e0-4878-4ae6-80d3-7f9ff18eada6">
<File Id="BootstrapperCore.xml" Source="packages\WixSharp.bin.1.0.35.3\lib\BootstrapperCore.xml" />
</Component>
<Component Id="Component.Microsoft.Deployment.WindowsInstaller.dll" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f3003d3ab">
<File Id="Microsoft.Deployment.WindowsInstaller.dll" Source="packages\WixSharp.bin.1.0.35.3\lib\Microsoft.Deployment.WindowsInstaller.dll" />
</Component>
<Component Id="Component.Microsoft.Deployment.WindowsInstaller.xml" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f3002d3b7">
<File Id="Microsoft.Deployment.WindowsInstaller.xml" Source="packages\WixSharp.bin.1.0.35.3\lib\Microsoft.Deployment.WindowsInstaller.xml" />
</Component>
<Component Id="Component.WixSharp.dll" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f822b9b0b">
<File Id="WixSharp.dll" Source="packages\WixSharp.bin.1.0.35.3\lib\WixSharp.dll" />
</Component>
<Component Id="Component.WixSharp.Msi.dll" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f84890cfb">
<File Id="WixSharp.Msi.dll" Source="packages\WixSharp.bin.1.0.35.3\lib\WixSharp.Msi.dll" />
</Component>
<Component Id="Component.WixSharp.Msi.xml" Guid="4f3ca8e0-4878-4ae6-80d3-7f9f0d450cfa">
<File Id="WixSharp.Msi.xml" Source="packages\WixSharp.bin.1.0.35.3\lib\WixSharp.Msi.xml" />
</Component>
<Component Id="Component.WixSharp.UI.dll" Guid="4f3ca8e0-4878-4ae6-80d3-7f9ff66e2753">
<File Id="WixSharp.UI.dll" Source="packages\WixSharp.bin.1.0.35.3\lib\WixSharp.UI.dll" />
</Component>
<Component Id="Component.WixSharp.UI.xml" Guid="4f3ca8e0-4878-4ae6-80d3-7f9fcb30b00f">
<File Id="WixSharp.UI.xml" Source="packages\WixSharp.bin.1.0.35.3\lib\WixSharp.UI.xml" />
</Component>
<Component Id="Component.WixSharp.xml" Guid="4f3ca8e0-4878-4ae6-80d3-7f9ff96f9b0c">
<File Id="WixSharp.xml" Source="packages\WixSharp.bin.1.0.35.3\lib\WixSharp.xml" />
</Component>
</Directory>
</Directory>
<Component Id="Certificate1" Guid="4f3ca8e0-4878-4ae6-80d3-7f9fde40362a" KeyPath="yes">
<Certificate Id="cert" CertificatePath="C:\projects\QuikPak\cert.pfx" Name="cert" Request="no" StoreLocation="localMachine" StoreName="personal" xmlns="http://schemas.microsoft.com/wix/IIsExtension" />
<RemoveFolder Id="IISMain" On="uninstall" />
</Component>
</Directory>
</Directory>
<MajorUpgrade AllowDowngrades="yes" Schedule="afterInstallInitialize" />
<Upgrade Id="317e4313-2314-46e9-ae7e-6cdfee60c05d">
<UpgradeVersion Minimum="0.0.0.1" Maximum="99.0.0.0" IncludeMinimum="yes" IncludeMaximum="no" Property="UPGRADEFOUND" />
</Upgrade>
<Binary Id="cert" SourceFile="cert.pfx" />
<Feature Id="Complete" Title="Complete" Absent="allow" Level="1">
<ComponentRef Id="Component.config.json" />
<ComponentRef Id="Component.CommandLineParser.1.9.71.nupkg" />
<ComponentRef Id="Component.readme.txt" />
<ComponentRef Id="Component.CommandLine.dll" />
<ComponentRef Id="Component.CommandLine.xml" />
<ComponentRef Id="Component.CommandLine.dll.1" />
<ComponentRef Id="Component.CommandLine.xml.1" />
<ComponentRef Id="Component.CommandLine.dll.2" />
<ComponentRef Id="Component.CommandLine.xml.2" />
<ComponentRef Id="Component.Newtonsoft.Json.8.0.3.nupkg" />
<ComponentRef Id="Component.Newtonsoft.Json.dll" />
<ComponentRef Id="Component.Newtonsoft.Json.xml" />
<ComponentRef Id="Component.Newtonsoft.Json.dll.1" />
<ComponentRef Id="Component.Newtonsoft.Json.xml.1" />
<ComponentRef Id="Component.Newtonsoft.Json.dll.2" />
<ComponentRef Id="Component.Newtonsoft.Json.xml.2" />
<ComponentRef Id="Component.Newtonsoft.Json.dll.3" />
<ComponentRef Id="Component.Newtonsoft.Json.xml.3" />
<ComponentRef Id="Component.Newtonsoft.Json.dll.4" />
<ComponentRef Id="Component.Newtonsoft.Json.xml.4" />
<ComponentRef Id="Component.Newtonsoft.Json.dll.5" />
<ComponentRef Id="Component.Newtonsoft.Json.xml.5" />
<ComponentRef Id="Component.install.ps1" />
<ComponentRef Id="Component.readme.txt.1" />
<ComponentRef Id="Component.WixSharp.1.0.35.3.nupkg" />
<ComponentRef Id="Component.SetEnvVar.dll" />
<ComponentRef Id="Component.WixSharp.targets" />
<ComponentRef Id="Component.Install.ps1.1" />
<ComponentRef Id="Component.WixSharp.bin.1.0.35.3.nupkg" />
<ComponentRef Id="Component.BootstrapperCore.dll" />
<ComponentRef Id="Component.BootstrapperCore.xml" />
<ComponentRef Id="Component.Microsoft.Deployment.WindowsInstaller.dll" />
<ComponentRef Id="Component.Microsoft.Deployment.WindowsInstaller.xml" />
<ComponentRef Id="Component.WixSharp.dll" />
<ComponentRef Id="Component.WixSharp.Msi.dll" />
<ComponentRef Id="Component.WixSharp.Msi.xml" />
<ComponentRef Id="Component.WixSharp.UI.dll" />
<ComponentRef Id="Component.WixSharp.UI.xml" />
<ComponentRef Id="Component.WixSharp.xml" />
<ComponentRef Id="Certificate1" />
</Feature>
</Product>
</Wix>

24
QuikPak/Cert.cs Normal file
View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace QuikPak
{
public class Cert : IEquatable<Cert>
{
public string CertificatePath { get; set; }
public string PfxPassword { get; set; }
public bool Equals(Cert other)
{
return string.Equals(this.CertificatePath, other.CertificatePath);
}
public override int GetHashCode()
{
return new { CertificatePath, PfxPassword }.GetHashCode();
}
}
}

View File

@@ -15,6 +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<Cert> Certificates { get; set; } = new HashSet<Cert>();
}
public class Endpoint

View File

@@ -1,12 +0,0 @@
{
"UpgradeCode": "317e4313-2314-46e9-ae7e-6cdfee60c05d",
"Name": "MyWebsite",
"Version": "1.0.0.0",
"Endpoints": [
{
"port": 80,
"DnsName": "*",
"Secure": false
}
]
}

View File

@@ -2,6 +2,7 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using WixSharp;
namespace QuikPak
@@ -23,7 +24,7 @@ namespace QuikPak
}
var config = JsonConvert.DeserializeObject<Config>(System.IO.File.ReadAllText(options.Config));
var addresses = new List<WebSite.WebAddress>();
Verifier.Verify(config);
foreach(var Endpoint in config.Endpoints)
{
var attr = new Attributes()
@@ -37,11 +38,21 @@ 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<WixObject>();
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())
{
Dirs = new[]
{
@@ -51,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 = false,
Description = config.Name,
Addresses = addresses.ToArray()
InstallWebSite = true,
Addresses = addresses.ToArray(),
Attributes = new Dictionary<string, string>()
{
// ["awesome"] = "yo"
}
},
WebAppPool = new WebAppPool(config.Name) {
Attributes = new Dictionary<string, string>() {
@@ -64,9 +79,9 @@ namespace QuikPak
["RecycleMinutes"] = config.RecycleMinutes.ToString(),
["IdleTimeout"] = config.IdleTimeout.ToString(),
["ManagedPipelineMode"] = config.ManagedPipelineMode,
["ManagedRuntimeVersion"] = config.ManagedRuntimeVersion
["ManagedRuntimeVersion"] = config.ManagedRuntimeVersion,
}
}
},
})
)
},
@@ -77,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()
@@ -90,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<string, string>()
{
["Id"] = "webapppoolgen",
["Name"] = "weapppoolgen" + config.Name,
["WebAppPool"] = $"{config.Name}WebSite_AppPool"
}));
Compiler.BuildMsi(project);
}
}

View File

@@ -72,14 +72,15 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Cert.cs" />
<Compile Include="Config.cs" />
<Compile Include="Options.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Verifier.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="Config.json" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

27
QuikPak/Verifier.cs Normal file
View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace QuikPak
{
public static class Verifier
{
public static void Verify(Config config)
{
if(string.IsNullOrWhiteSpace(config.UpgradeCode))
{
throw new Exception("Upgrade code required");
}
foreach(var certificate in config.Certificates)
{
if(string.IsNullOrWhiteSpace(certificate.CertificatePath) || !File.Exists(certificate.CertificatePath))
{
throw new Exception("Certificate path could not be found");
}
}
}
}
}

View File

@@ -5,8 +5,9 @@
"Endpoints": [
{
"port": 80,
"DnsName": "mywebsite.com",
"DnsName": "*",
"Secure": false
}
]
],
"Certificates": [{"CertificatePath": "C:\\projects\\QuikPak\\cert.pfx", "PfxPassword": "Andromeda1"}]
}