:如何檢測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
。
你從哪裏得到這些升級代碼?我想獲得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 –