本文介绍了WiX Bootstrapper - 难以检测软件是否已安装 C++ 可再发行,SQL Server Compact 3.5 SP2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止(感谢 Rob Mensching 的帖子),如果安装了 .NET 4.0,我的代码将检测到它,并且它会直接通过它.我无法正确检测 Microsoft Visual C++ 2010 x86 Redistributable 或 Microsoft SQL Server Compact 3.5 Service Pack 2.

So far (thanks to a post from Rob Mensching), my code will detect .NET 4.0 if it's installed, and it'll pass right over it. I'm not able to correctly detect Microsoft Visual C++ 2010 x86 Redistributable OR Microsoft SQL Server Compact 3.5 Service Pack 2.

我的代码如下.我正在学习,所以我希望尽可能多的建设性批评.

My code is below. I'm learning, so I would appreciate as much constructive criticism as possible.

<!-- Search for .NET 4.0 -->
<util:RegistrySearch Id="NETFRAMEWORK40"
                     Root="HKLM"
                     Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
                     Value="Install"
                     Variable="NETFRAMEWORK40"
                     Result="value"/>
<!-- Search for Microsoft Visual C++ 2010 x86 Redistributable -->
<util:RegistrySearch Id="SearchForCPP2010X86"
                     Root="HKLM"
                     Key="SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86"
                     Value="Install"
                     Variable="CPP2010Redist"
                     Result="exists"/>
<!-- Search for Microsoft SQL Server Compact 3.5 Service Pack 2 -->
<util:RegistrySearch Id="SearchForSQLSvrCE35SP2"
                     Root="HKLM"
                     Key="SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.5\ENU"
                     Value="Install"
                     Variable="SQLSvrCE35SP2"
                     Result="exists"/>

<Chain>
    <!-- Install .NET 4 Full -->
    <PackageGroupRef Id="Net4Full"/>
    <!-- Install Microsoft Visual C++ 2010 x86 Redistributable -->
    <PackageGroupRef Id="MSVisCPP2010x86Redist"/>
    <!-- Install Microsoft SQL Server Compact 3.5 Service Pack 2 -->
    <PackageGroupRef Id="SQLExpressCE"/>
</Chain>


<!-- Install .NET 4.0 -->
<PackageGroup Id="Net4Full">
    <ExePackage Id="Net4Full"
                Name="Microsoft .NET Framework 4.0 Setup"
                Cache="no"
                Compressed="yes"
                PerMachine="yes"
                Permanent="yes"
                Vital="yes"
                SourceFile="BootstrapperLibrary\dotNetFx40_Full_setup.exe"
                DetectCondition="NETFRAMEWORK40"/>
</PackageGroup>

<!-- Install Microsoft Visual C++ 2010 x86 Redistributable -->
<PackageGroup Id="MSVisCPP2010x86Redist">
    <ExePackage Id="MSVisCPP2010x86Redis"
                Name="Microsoft Visual C++ 2010 x86 Redistributable "
                Cache="no"
                Compressed="yes"
                PerMachine="yes"
                Permanent="yes"
                Vital="yes"
                SourceFile="BootstrapperLibrary\vcredist_x86.exe"
                DetectCondition="CPP2010Redist"/>
</PackageGroup>

<!-- Install Microsoft SQL Server Compact 3.5 Service Pack 2 -->
<PackageGroup Id="SQLExpressCE">
   <ExePackage Id="SQLExpressCE"
               Name="Microsoft SQL Server Compact 3.5 Service Pack 2 Setup"
               Cache="no"
               Compressed="yes"
               PerMachine="yes"
               Permanent="yes"
               Vital="yes"
               SourceFile="BootstrapperLibrary\SSCERuntime-ENU.exe"/>
</PackageGroup>

推荐答案

我想出了以下解决方案.这并不理想,但它现在有效.我们只有很短的时间来想出一些东西,所以这就是目前有效"的方法.

I was able to come up with the following solution. It's not ideal, but it works for now. We were given a very short amount of time to come up with something, so this is what "works" for now.

我不得不多次返回文档,最终发现我需要什么以及我做错了什么.同样,这是对我的问题的它的工作原理"解决方案.

I had to go back to the documentation several more times and eventually discovered what I needed and what I was doing wrong. Again, this is an "it works sort of" solution to my problem.

WiX 手册

WiX 教程

我还获得了WiX 3.6:Windows Installer XML 开发人员指南"一书的副本,事实证明这本书很有用.如果它从一开始就可用,它会非常有用.

I was also able to get a copy of the book "WiX 3.6: A Developer's Guide to Windows Installer XML" which proved to be useful. It would have been extremely useful, had it been available from day one.

我对在线 WiX 教程的唯一抱怨是它没有位于美国的副本(我可以找到).我必须提交请求,才能通过我们的网络安全部门批准该网站.我现在可以访问,但我不得不等待一天才能使用它.当您处于非常紧张的开发周期时,总有一天会很重要.

My only complaint with the online WiX tutorial is that it does not have a copy (that I could find) that is based here in the US. I had to submit a request to have the website approved through our network security department. I now have access, but I had to wait a day to utilize it. When you're on a very tight development cycle, one day is a big deal.

最初,我的故事的一部分是搜索 32 位和 64 位版本的 SQL Server CE.我在 64 位版本上遇到了一些麻烦,时间不够用了,所以我使用附件下载了适用的 32 位和 64 位安装文件.

Originally, part of my story was to search for both the 32- and 64-bit versions of SQL Server CE. I had a little trouble with the 64-bit version and ran out of time, so I used the attached file to download both the 32- and 64-bit installation files when applicable.

<!--Search for .NET 4.0-->
<util:RegistrySearch Id="NETFRAMEWORK40"
                     Root="HKLM"
                     Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
                     Value="Install"
                     Variable="NETFRAMEWORK40"
                     Result="value"/>
<!--Search for Microsoft Visual C++ 2010 x86 Redistributable-->
<util:RegistrySearch Root="HKLM"
                     Key="SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86"
                     Variable="CPP2010Redist"
                     Value="Installed"
                     Result="value"/>
<!--Search for Microsoft SQL Server Compact 3.5 Service Pack 2 x86-->
<util:RegistrySearch Id="SqlCeRegistryx86"
                     Root="HKLM"
                     Key="SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.5\ENU"
                     Variable="SQLSvrCE35SP2x86"
                     Win64="no"
                     Result="exists"/>


<Chain>
  <!-- Install .Net 4 Full -->
  <PackageGroupRef Id="Net4Full"/>
  <!-- Install Microsoft Visual C++ 2010 x86 Redistributable -->
  <PackageGroupRef Id="MSVisCPP2010x86Redist"/>
  <!-- Install Microsoft SQL Server Compact 3.5 Service Pack 2 x86 -->
  <PackageGroupRef Id="SQLExpressCEx86"/>
</Chain>


<Fragment Id="Prerequisites">
<!--.NET 4.0-->
<PackageGroup Id="Net4Full">
  <ExePackage Id="Net4Full"
              Cache="no"
              Compressed="yes"
              PerMachine="yes"
              Permanent="yes"
              Vital="yes"
              SourceFile="BootstrapperLibrary\dotNetFx40_Full_setup.exe"
              DetectCondition="NETFRAMEWORK40"/>
</PackageGroup>
<!--Microsoft Visual C++ 2010 x86 Redistributable-->
<PackageGroup Id="MSVisCPP2010x86Redist">
  <ExePackage Id="MSVisCPP2010x86Redist"
              Cache="no"
              Compressed="yes"
              PerMachine="yes"
              Vital="yes"
              SourceFile="BootstrapperLibrary\vcredist_x86.exe"
              DetectCondition="CPP2010Redist"/>
</PackageGroup>
<!--Microsoft SQL Server Compact 3.5 Service Pack 2 x86-->
<PackageGroup Id="SQLExpressCEx86">
  <ExePackage Id="SQLExpressCEx86"
              Cache="no"
              Compressed="yes"
              PerMachine="yes"
              Vital="yes"
              SourceFile="BootstrapperLibrary\SSCERuntime-ENU.exe"
              DetectCondition="SQLSvrCE35SP2x86"/>
</PackageGroup>

这篇关于WiX Bootstrapper - 难以检测软件是否已安装 C++ 可再发行,SQL Server Compact 3.5 SP2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 00:17