Home > WiX > Install a pfx certificate in a users store in Windows using WiX ?

Install a pfx certificate in a users store in Windows using WiX ?

Complete sample (Adapt to your WiX)

<?xml version="1.0" encoding="utf-8"?>
<Wix
 xmlns="http://schemas.microsoft.com/wix/2006/wi"
 xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
 xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension"
 >

<Product
 Id="*"
 Language="1033"
 Manufacturer="ACME"
 Name="WixInstallCertificate"
 UpgradeCode="*"
 Version="1.0.0.0">

<Package
 Compressed="yes"
 InstallerVersion="200" />


<UIRef Id="WixUI_ErrorProgressText" />
<Condition Message="This application requires .NET Framework 3.5. Please install .NET Framework then run this installer again.">
Installed OR NETFRAMEWORK35
</Condition>

<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramMenuFolder" Name="PMenu" ></Directory>
<Directory Id="APPLICATIONPROGRAMSFOLDER" Name="AMenu" >
<Directory Id="AppDir" Name='InstantClient' /></Directory>
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="PROGRAMMENUDIR1" Name='InstantClient' >

 <Component Id="Component_CACERT" Guid="*">
 <iis:Certificate Id="CACert"
 Name="D:\My Documents\Visual Studio 2008\Projects\WixInstallCertificate\TemporaryKey.pfx"
 Request="no"
 CertificatePath="D:\My Documents\Visual Studio 2008\Projects\WixInstallCertificate\TemporaryKey.pfx"
 StoreName="root"
 StoreLocation="localMachine"
 />
 </Component>


 <Component Id="Component_CACERT1" Guid="*">
 <iis:Certificate Id="CACert1"
 Name="D:\My Documents\Visual Studio 2008\Projects\WixInstallCertificate\X7.Client.Web_1_TemporaryKey.pfx"
 Request="no"
 CertificatePath="D:\My Documents\Visual Studio 2008\Projects\WixInstallCertificate\X7.Client.Web_1_TemporaryKey.pfx"                        StoreName="trustedPublisher"
 StoreLocation="localMachine"
 />
 </Component>
</Directory>
</Directory>
</Directory>

<Property Id="WIXUI_INSTALLDIR" Value="PROGRAMMENUDIR1" />

<Feature Id="ProductFeature" Level="1" Title="Your Title"  Description='Your Descripttion'  ConfigurableDirectory='TARGETDIR'>
<ComponentRef Id="Component_CACERT" />
<ComponentRef Id="Component_CACERT1" />
</Feature>

<Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
 <Property Id="NETFRAMEWORK35" Secure="yes">
 <RegistrySearch Id="NetFramework35"
 Root="HKLM"
 Key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5"
 Name="Install"
 Type="raw" />
 </Property>
 <WixVariable Id="WixUIDialogBmp" Value="C:\main_bkgd.bmp" />
 <WixVariable Id="WixUIBannerBmp" Value="C:\header.bmp" />
 <WixVariable Id="WixUILicenseRtf" Value="C:\EULA.rtf" />
 <InstallExecuteSequence>
 <ScheduleReboot After="InstallFinalize"/>
 </InstallExecuteSequence>
</Product>
</Wix>
Advertisements
Categories: WiX
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: