使用WiX在Windows的用户商店中安装pfx证书 [英] Install a pfx certificate in a users store in Windows using WiX

查看:407
本文介绍了使用WiX在Windows的用户商店中安装pfx证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请,有人可以为我提供所提及情况的WiX片段或解决方案。我需要在WiX的msi包括pfx文件,用户将通过互联网浏览器下载我的msi到他的机器和点击安装,我还需要证书,他的机器上安装。

Please, can someone provide me with a WiX snippet or solution for the mentioned scenario. I need to include the pfx file in the WiX msi and the user will download my msi to his machine via the internet explorer and Click install and I need also the certificate to be installed on his machine.

推荐答案

您需要证书元素。它是wix的IIS扩展的一部分,但也可以用于非IIS相关的安装。

You need the Certificate element. It is part of the IIS extension for wix, but can be used for non-IIS related installations also.

您需要


  1. 声明iis命名空间的前缀,for
    在根Wix元素中这样的示例:

  1. declare a prefix for the iis namespace, for example like this in the root Wix element:

<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'
   xmlns:iis='http://schemas.microsoft.com/wix/IIsExtension'>


  • 将PFX文件作为二进制
    流嵌入安装包。在
    产品元素下添加
    a 二进制元素,如这:

    <Binary Id="MyCertificateBinaryStream" 
       SourceFile="c:/path/to/mycertificate.pfx" />
    


  • 使用< iis:Certificate& / code>元素,对于
    这样的示例。请查看
    文档,您需要填写一些
    更多属性。请注意,如果您使用 BinaryKey 属性,则不需要 CertficatePath

  • Declare a component with a <iis:Certificate> element, for example like this. Look at the documentation, you need to fill in some more attributes. Note that you don't need CertficatePath if you use the BinaryKey attribute.

    <Component Id="MyCertificateComponent" Guid="MY-GUID-HERE">
       <iis:Certificate Id="MyCertificate"
          BinaryKey="MyCertificateBinaryStream"
          ... some more attributes ...                  
       />
    </Component>
    


  • 通过添加
    激活IIS扩展选项 -ext WixIISExtension
    选项在调用wix命令行工具时。如果你使用visual studio,这只是在你的wix项目中添加一个引用到 WixIISExtension

    这篇关于使用WiX在Windows的用户商店中安装pfx证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆