Skip to content

Commit

Permalink
Add a setup (using WIX)
Browse files Browse the repository at this point in the history
  • Loading branch information
vletoux committed May 19, 2018
1 parent 013df50 commit b117a07
Show file tree
Hide file tree
Showing 10 changed files with 329 additions and 25 deletions.
51 changes: 31 additions & 20 deletions OpenPGPCsp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,60 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenPGPSmartCardManager", "
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestOpenPGPCsp", "TestOpenPGPCsp\TestOpenPGPCsp.vcxproj", "{0E84B76E-7A66-4331-8AA6-B09A35B54374}"
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SetupOpenPGPCsp", "SetupOpenPGPCsp\SetupOpenPGPCsp.wixproj", "{1BE9B1D2-61DA-46FA-8369-48DF1EC22728}"
ProjectSection(ProjectDependencies) = postProject
{836C8245-0D9D-4CA7-B501-1FB955D09D30} = {836C8245-0D9D-4CA7-B501-1FB955D09D30}
{30881663-1A22-4B84-B4C6-FDFC19712A0A} = {30881663-1A22-4B84-B4C6-FDFC19712A0A}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Debug|Win32.ActiveCfg = Debug|Win32
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Debug|Win32.Build.0 = Debug|Win32
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Debug|Win32.Deploy.0 = Debug|Win32
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Debug|x64.ActiveCfg = Debug|x64
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Debug|x64.Build.0 = Debug|x64
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Debug|x64.Deploy.0 = Debug|x64
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Release|Win32.ActiveCfg = Release|Win32
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Release|Win32.Build.0 = Release|Win32
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Release|Win32.Deploy.0 = Release|Win32
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Debug|x86.ActiveCfg = Debug|Win32
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Debug|x86.Build.0 = Debug|Win32
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Debug|x86.Deploy.0 = Debug|Win32
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Release|x64.ActiveCfg = Release|x64
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Release|x64.Build.0 = Release|x64
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Debug|Win32.ActiveCfg = Debug|Win32
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Debug|Win32.Build.0 = Debug|Win32
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Debug|Win32.Deploy.0 = Debug|Win32
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Release|x86.ActiveCfg = Release|Win32
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Release|x86.Build.0 = Release|Win32
{30881663-1A22-4B84-B4C6-FDFC19712A0A}.Release|x86.Deploy.0 = Release|Win32
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Debug|x64.ActiveCfg = Debug|x64
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Debug|x64.Build.0 = Debug|x64
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Debug|x64.Deploy.0 = Debug|x64
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Release|Win32.ActiveCfg = Release|Win32
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Release|Win32.Build.0 = Release|Win32
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Release|Win32.Deploy.0 = Release|Win32
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Debug|x86.ActiveCfg = Debug|Win32
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Debug|x86.Build.0 = Debug|Win32
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Debug|x86.Deploy.0 = Debug|Win32
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Release|x64.ActiveCfg = Release|x64
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Release|x64.Build.0 = Release|x64
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Release|x64.Deploy.0 = Release|x64
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Debug|Win32.ActiveCfg = Debug|Win32
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Debug|Win32.Build.0 = Debug|Win32
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Debug|Win32.Deploy.0 = Debug|Win32
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Release|x86.ActiveCfg = Release|Win32
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Release|x86.Build.0 = Release|Win32
{836C8245-0D9D-4CA7-B501-1FB955D09D30}.Release|x86.Deploy.0 = Release|Win32
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Debug|x64.ActiveCfg = Debug|x64
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Debug|x64.Build.0 = Debug|x64
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Debug|x64.Deploy.0 = Debug|x64
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Release|Win32.ActiveCfg = Release|Win32
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Release|Win32.Build.0 = Release|Win32
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Release|Win32.Deploy.0 = Release|Win32
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Debug|x86.ActiveCfg = Debug|Win32
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Debug|x86.Build.0 = Debug|Win32
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Debug|x86.Deploy.0 = Debug|Win32
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Release|x64.ActiveCfg = Release|x64
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Release|x64.Build.0 = Release|x64
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Release|x64.Deploy.0 = Release|x64
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Release|x86.ActiveCfg = Release|Win32
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Release|x86.Build.0 = Release|Win32
{0E84B76E-7A66-4331-8AA6-B09A35B54374}.Release|x86.Deploy.0 = Release|Win32
{1BE9B1D2-61DA-46FA-8369-48DF1EC22728}.Debug|x64.ActiveCfg = Debug|x64
{1BE9B1D2-61DA-46FA-8369-48DF1EC22728}.Debug|x86.ActiveCfg = Debug|x86
{1BE9B1D2-61DA-46FA-8369-48DF1EC22728}.Release|x64.ActiveCfg = Release|x64
{1BE9B1D2-61DA-46FA-8369-48DF1EC22728}.Release|x64.Build.0 = Release|x64
{1BE9B1D2-61DA-46FA-8369-48DF1EC22728}.Release|x86.ActiveCfg = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
8 changes: 4 additions & 4 deletions OpenPGPCsp/OpenPGPCsp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ IF "$(ConfigurationName)" NEQ "Release" "C:\Program Files (x86)\Windows Kits\8.0
@echo sign binaries
@echo ================

IF "$(ConfigurationName)" == "Release" "C:\Program Files (x86)\Windows Kits\8.0\bin\x86\signtool.exe" sign /d "OpenPGP CSP" /ac $(SolutionDir)\CodeSigning\addtrustexternalcaroot_kmod.crt /f $(SolutionDir)\CodeSigning\certificate.pfx /p vletoux /t http://timestamp.comodoca.com "$(TargetPath)"
IF "$(ConfigurationName)" == "Release" "C:\Program Files (x86)\Windows Kits\8.0\bin\x86\signtool.exe" sign /d "OpenPGP CSP" /ac $(SolutionDir)\CodeSigning\addtrustexternalcaroot_kmod.crt /f $(SolutionDir)\CodeSigning\certificate.pfx /p vletoux /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 /as "$(TargetPath)"
IF "$(ConfigurationName)" NEQ "Release" "C:\Program Files (x86)\Windows Kits\8.0\bin\x86\signtool.exe" sign /d "OpenPGP CSP" /ac $(SolutionDir)\CodeSigning\addtrustexternalcaroot_kmod.crt /f $(SolutionDir)\CodeSigning\certificate.pfx /p vletoux "$(TargetPath)"
IF "$(ConfigurationName)" NEQ "Release" "C:\Program Files (x86)\Windows Kits\8.0\bin\x86\signtool.exe" sign /d "OpenPGP CSP" /ac $(SolutionDir)\CodeSigning\addtrustexternalcaroot_kmod.crt /f $(SolutionDir)\CodeSigning\certificate.pfx /p vletoux /fd sha256 /as "$(TargetPath)"
IF "$(ConfigurationName)" == "Release" "C:\Program Files (x86)\Windows Kits\8.0\bin\x86\signtool.exe" sign /d "OpenPGP CSP" /ac $(SolutionDir)\CodeSigning\comodorsacertificationauthority_kmod.crt /f $(SolutionDir)\CodeSigning\certificate.pfx /p vletoux /t http://timestamp.comodoca.com "$(TargetPath)"
IF "$(ConfigurationName)" == "Release" "C:\Program Files (x86)\Windows Kits\8.0\bin\x86\signtool.exe" sign /d "OpenPGP CSP" /ac $(SolutionDir)\CodeSigning\comodorsacertificationauthority_kmod.crt /f $(SolutionDir)\CodeSigning\certificate.pfx /p vletoux /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 /as "$(TargetPath)"
IF "$(ConfigurationName)" NEQ "Release" "C:\Program Files (x86)\Windows Kits\8.0\bin\x86\signtool.exe" sign /d "OpenPGP CSP" /ac $(SolutionDir)\CodeSigning\comodorsacertificationauthority_kmod.crt /f $(SolutionDir)\CodeSigning\certificate.pfx /p vletoux "$(TargetPath)"
IF "$(ConfigurationName)" NEQ "Release" "C:\Program Files (x86)\Windows Kits\8.0\bin\x86\signtool.exe" sign /d "OpenPGP CSP" /ac $(SolutionDir)\CodeSigning\comodorsacertificationauthority_kmod.crt /f $(SolutionDir)\CodeSigning\certificate.pfx /p vletoux /fd sha256 /as "$(TargetPath)"

@echo Done signing
:exit
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ The version used for the development is Visual Studio 2012
A code signing certificate with the kernel mode option or using the prebuilt binaries.
Indeed, at the opposite of a minidriver, a CSP MUST be signed.

### Installing
The current release is signed by a SHA2 certificate (kernel mode signing).
That means that the [Microsoft Security Advisory 3033929](https://docs.microsoft.com/en-us/security-updates/securityadvisories/2015/3033929) MUST be installed.

### Installing manually

Copy the binaries to a known location. C:\windows\system32 is well known one.
Edit the .reg file at the root of the project and add the ATR of the card to test.
Expand Down
8 changes: 8 additions & 0 deletions SetupOpenPGPCsp/Include.wxi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Include>
<?define ProductCode="9598DEAA-896F-4EC0-8062-75B67E21F885" ?>
<?define UpgradeCode="85E16C6D-5AD1-41E9-933F-995BF31B9223" ?>
<!-- Product name as you want it to appear in Add/Remove Programs-->
<?define ProductName = "NFC Connector client" ?>
<?define SourceDir = "$(var.SolutionDir)$(var.Platform)\$(var.Configuration)"?>
</Include>
137 changes: 137 additions & 0 deletions SetupOpenPGPCsp/Product.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include $(sys.SOURCEFILEDIR)include.wxi ?>
<Product Id="$(var.ProductCode)" Codepage="1252" Language="0"
Manufacturer="My Smart Logon"
Name="OpenPGP CSP"
Version="!(bind.FileVersion.OpenPGPCSP32dll)"
UpgradeCode="$(var.UpgradeCode)"
>
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" Platform="$(var.Platform)" Description="$(var.ProductName)" />

<MajorUpgrade
DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit."/>

<Condition Message="An administrator must approve or install [ProductName].">
Privileged
</Condition>

<Condition Message="These application requires Windows XP SP3 or Windows 2003 SP2 or Windows Vista or Windows Server 2008 or later">
<![CDATA[Installed OR ((VersionNT >= 501) AND (ServicePackLevel >= 3)) OR ((VersionNT >= 502) AND (ServicePackLevel >= 2)) OR (VersionNT >= 600)]]>
</Condition>

<?if $(var.Platform) = x64 ?>
<Condition Message="This setup has been design for 64-bit versions of Windows. Please run the setup on 64-bit Windows or get the 32 bits setup.">
VersionNT64
</Condition>
<?else?>
<Condition Message="This setup has been design for 32-bit versions of Windows. Please run the setup on 32-bit Windows or get the 64 bits setup.">
Not VersionNT64
</Condition>
<?endif?>

<!-- do not edit the rtf file with word! The installer will be unable to read the license -->
<WixVariable Id="WixUILicenseRtf" Value="license.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="bannrbmp.bmp"/>
<WixVariable Id="WixUIDialogBmp" Value="dlgbmp.bmp"/>

<!-- property for add/remove programs -->
<Property Id="ARPHELPLINK" Value="http://www.mysmartlogon.com" />
<Property Id="ARPCONTACT" Value="My Smart Logon" />
<Icon Id="mysmartlogon.ico" SourceFile="mysmartlogon.ico" />
<Property Id="ARPPRODUCTICON" Value="mysmartlogon.ico" />

<Directory Id="TARGETDIR" Name="SourceDir">
<?if $(var.Platform) = x64 ?>
<Directory Id="ProgramFiles64Folder">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="OpenPGPCSP"/>
</Directory>
<?else ?>
<Directory Id="ProgramFilesFolder">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="OpenPGPCSP"/>
</Directory>
<?endif?>
</Directory>

<?if $(var.Platform) = x64 ?>
<Component Id="OpenPGPCSP64" Directory="APPLICATIONROOTDIRECTORY" Guid="4B6C0466-AFF7-4043-A605-C103060AE683" >
<File Id="OpenPGPCSP64dll" Name="OpenPGPCSP64.dll" Source="$(var.SourceDir)\OpenPGPCSP64.dll" KeyPath="yes" DiskId="1" />
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Cryptography\Defaults\Provider\OpenPGP CSP">
<RegistryValue Type="string" Name="Image Path" Value="[#OpenPGPCSP64dll]"/>
<RegistryValue Type="integer" Name="Type" Value="1"/>
<RegistryValue Type="integer" Name="SigInFile" Value="0"/>
</RegistryKey>
</Component>
<?endif?>
<Component Id="OpenPGPCSP32" Directory="APPLICATIONROOTDIRECTORY" Guid="8DCB958E-E86F-43F5-A17F-A12C00A707C7">
<File Id="OpenPGPCSP32dll" Name="OpenPGPCSP32.dll" Source="$(var.SourceDir)\OpenPGPCSP32.dll" KeyPath="yes" DiskId="1" />
<?if $(var.Platform) = x64 ?>
<RegistryKey Root="HKLM" Key="SOFTWARE\Wow6432Node\Microsoft\Cryptography\Defaults\Provider\OpenPGP CSP">
<RegistryValue Type="string" Name="Image Path" Value="[#OpenPGPCSP32dll]"/>
<RegistryValue Type="integer" Name="Type" Value="1"/>
<RegistryValue Type="integer" Name="SigInFile" Value="0"/>
</RegistryKey>
<?else?>
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Cryptography\Defaults\Provider\OpenPGP CSP">
<RegistryValue Type="string" Name="Image Path" Value="[#OpenPGPCSP32dll]"/>
<RegistryValue Type="integer" Name="Type" Value="1"/>
<RegistryValue Type="integer" Name="SigInFile" Value="0"/>
</RegistryKey>
<?endif?>
</Component>

<Component Id="OpenPGPSmartCardManager" Directory="APPLICATIONROOTDIRECTORY" Guid="8F9AF825-70CC-41D9-B7E4-7634F3BF06E3">
<File Id="OpenPGPSmartCardManagerexe" Name="OpenPGPSmartCardManager.exe" Source="$(var.SourceDir)\OpenPGPSmartCardManager.exe" KeyPath="yes" DiskId="1" />
</Component>

<Component Id="OpenPGPRegistration" Directory="APPLICATIONROOTDIRECTORY" Guid="EF46D050-D1A0-4BE1-AFCB-6D75041F5E13">
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Cryptography\Calais\SmartCards\OpenPGP Card v2 (via OpenPGP CSP)">
<RegistryValue Type="binary" Name="ATR" Value="3BDA18FF81B1FE751F030031C573C001400090000C" KeyPath="yes"/>
<RegistryValue Type="binary" Name="ATRMask" Value="FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"/>
<RegistryValue Type="string" Name="Crypto Provider" Value="OpenPGP CSP"/>
</RegistryKey>
<?if $(var.Platform) = x64 ?>
<RegistryKey Root="HKLM" Key="SOFTWARE\Wow6432Node\Microsoft\Cryptography\Calais\SmartCards\OpenPGP Card v2 (via OpenPGP CSP)">
<RegistryValue Type="binary" Name="ATR" Value="3BDA18FF81B1FE751F030031C573C001400090000C"/>
<RegistryValue Type="binary" Name="ATRMask" Value="FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"/>
<RegistryValue Type="string" Name="Crypto Provider" Value="OpenPGP CSP"/>
</RegistryKey>
<?endif?>
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Cryptography\Calais\SmartCards\OpenPGP Card v3 (via OpenPGP CSP)">
<RegistryValue Type="binary" Name="ATR" Value="3bda18ff81b1fe751f030031f573c001600090001c"/>
<RegistryValue Type="binary" Name="ATRMask" Value="FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"/>
<RegistryValue Type="string" Name="Crypto Provider" Value="OpenPGP CSP"/>
</RegistryKey>
<?if $(var.Platform) = x64 ?>
<RegistryKey Root="HKLM" Key="SOFTWARE\Wow6432Node\Microsoft\Cryptography\Calais\SmartCards\OpenPGP Card v3 (via OpenPGP CSP)">
<RegistryValue Type="binary" Name="ATR" Value="3bda18ff81b1fe751f030031f573c001600090001c"/>
<RegistryValue Type="binary" Name="ATRMask" Value="FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"/>
<RegistryValue Type="string" Name="Crypto Provider" Value="OpenPGP CSP"/>
</RegistryKey>
<?endif?>
</Component>

<Feature Id="DefaultFeature" Level="1" Description="This feature contains all the drivers and the programs"
Title="NFC minidriver" Absent="disallow" TypicalDefault="install" Display="expand">
<Feature Id="OpenPGPCSP" Level="1" Title="minidriver files"
Description="This feature is the core of the product"
TypicalDefault="install">
<ComponentRef Id="OpenPGPCSP32" />
<?if $(var.Platform) = x64 ?>
<ComponentRef Id="OpenPGPCSP64" />
<?endif?>
</Feature>
<Feature Id="OpenPGPSmartCardManager" Level="1" Title="OpenPGPSmartCardManager" TypicalDefault="install">
<ComponentRef Id="OpenPGPSmartCardManager"/>
</Feature>
<Feature Id="OpenPGPRegistration" Level="1" Title="OpenPGPRegistration" TypicalDefault="install">
<ComponentRef Id="OpenPGPRegistration"/>
</Feature>
</Feature>

<UI>
<UIRef Id="WixUI_Minimal" />
</UI>
<Media Id="1" Cabinet="OpenPGPCSP.cab" EmbedCab="yes" />
</Product>
</Wix>
Loading

0 comments on commit b117a07

Please sign in to comment.