检测vcredist 2013 x86的存在 - 在wix burn bootstrapper软件包中使用UpgradeCode
:如何检测ms vcredist 2013 x86是否存在?
我正在检查该特定软件包的Upgrade Id
/UpgradeCode
,但软件包总是重新安装,即使它已经安装。检测vcredist 2013 x86的存在 - 在wix burn bootstrapper软件包中使用UpgradeCode
...
<Bundle>
...
<Chain>
<!-- redist packages -->
<PackageGroupRef Id="redist"/>
...
</Chain>
</Bundle>
<Fragment>
<PackageGroup Id="redist">
<PackageGroupRef Id="redist_vc120" />
...
</PackageGroup>
</Fragment>
<Fragment>
<!-- vcredist 2013 x86 -->
<?define vcredist2013minversion="12.0.21005"?>
<Upgrade Id="B59F5BF1-67C8-3802-8E59-2CE551A39FC5">
<UpgradeVersion Minimum="$(var.vcredist2013minversion)" Property="VCREDIST2013INSTALLED" OnlyDetect="yes" IncludeMinimum="yes" />
</Upgrade>
<PackageGroup Id="redist_vc120">
<ExePackage Id="vc120" Cache="yes" PerMachine="yes" Permanent="yes" Vital="yes" Compressed="yes"
Name="redist\VC120_Runtime\vcredist_x86.exe"
InstallCommand="/quiet /norestart"
InstallCondition="Not VCREDIST2013INSTALLED"
/>
</PackageGroup>
</Fragment>
...
InstallCondition
有什么不对吗?
或者我需要添加一个DetectCondition
?
记载:
Detected related package: {13A4EE12-23EA-3371-91EE-EFB36DDFFF3E}, scope: PerMachine, version: 12.0.21005.0, language: 0 operation: MajorUpgrade
Detected package: vc120, state: Absent, cached: None
Condition 'Not VCREDIST2013INSTALLED' evaluates to true.
Planned package: vc120, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: None, cache: Yes, uncache: No, dependency: None
Applying execute package: vc120, action: Install, path: <path and command line>...
Applied execute package: vc120, result: 0x0, restart: None
而且还消除了InstallCondition
并用以下DetectCondition
替换它不工作:
<PackageGroup Id="redist_vc120">
<ExePackage Id="vc120" Cache="yes" PerMachine="yes" Permanent="yes" Vital="yes" Compressed="yes"
Name="redist\VC120_Runtime\vcredist_x86.exe"
InstallCommand="/quiet /norestart"
DetectCondition="VCREDIST2013INSTALLED"
/>
</PackageGroup>
-
编辑:
只是为了进一步解释:我试图与UpgradeCode
的方法,因为我不想检查对于特定的安装包,但对于minimum version
。
以下逻辑工作正常的引导程序包(烧伤) :
<Fragment>
<!-- vcredist 2013 x86 -->
<util:ProductSearch Id="VCREDIST_120_x86"
UpgradeCode="B59F5BF1-67C8-3802-8E59-2CE551A39FC5"
Result="version"
Variable="VCREDIST_120_x86" />
<PackageGroup Id="redist_vc120">
<ExePackage Id="vc120" Cache="yes" PerMachine="yes" Permanent="yes" Vital="yes" Compressed="yes"
SourceFile="redist\VC120_Runtime\vcredist_x86.exe"
InstallCommand="/quiet /norestart"
DetectCondition="(VCREDIST_120_x86 >= v12.0.21005)" />
</PackageGroup>
</Fragment>
总结:
- 它使用
util:ProductSearch
与UpgradeCode
参数。 - 用于检测,它在
DetectCondition
中进行版本比较。
在烧产品检测基础上的UpgradeCode明显比工作在MSI(在这里我们可以用属性“OnlyDetect”使用升级表一起,然后再配置“LaunchCondition”)不同。
仅供参考:
我发现下面的UpgradeCodes(他们最低版本一起)来匹配...
vcredist 2005 x86 - 86C9D5AA-F00C-4921-B3F2-C60AF92E2844, 8.0.61001
vcredist 2008 x86 - DE2C306F-A067-38EF-B86C-03DE4B0312F9, 9.0.30729
vcredist 2010 x86 - 1F4F1D2A-D9DA-32CF-9909-48485DA06DD5, 10.0.40219
vcredist 2012 x86 - 4121ED58-4BD9-3E7B-A8B5-9F8BAAE045B7, 11.0.61030
vcredist 2013 x86 - B59F5BF1-67C8-3802-8E59-2CE551A39FC5, 12.0.21005
vcredist 2015 x86 - 65E5BD06-6392-3027-8C26-853107D3CF1A, 14.0.23506
vcredist 2017 x86 - C78B8E51-0C65-377E-85D1-282F689FE505, 14.10.25008
我用注册表检索算法,以检查是否安装,尝试做如下:
<util:RegistrySearch
Root="HKLM"
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\<Place Guid>"
Value="DisplayVersion"
Variable="MSVC_2013_x64"
Win64="yes"/>
和条件为:
DetectCondition="MSVC_2013_x64 AND (MSVC_2013_x64 >= v12.0.21005)"
这个答案检查的了'ProductCode'重新包装。因此它将无法检测到再版软件包的任何更高版本的Service Pack版本。原始问题询问如何使用'UpgradeCode'。 – Opmet
为什么你需要升级代码? –
你从哪里得到这些升级代码?我想获得x64的升级代码,不知道在哪里寻找。由于 –
以上代码不匹配我发现了什么 'vcredist二千零一十七分之二千零一十五86 - C146EF48-4D31-3C3D-A2C5-1E91AF8A0A9B' 'vcredist二千零一十七分之二千零一十五64 - F899BAD3-98ED-308E-A905-56B5338963FF' vcredist是一个包,有一个主要的安装和扩展安装MSI,想知道如果上面的ID实际上是子安装? 使用相同代码中2015年识别的代码也适用于2017年 https://gist.github.com/nathancorvussolis/6852ba282647aeb0c5c00e742e28eb48 –