简体   繁体   中英

How can I detect a Python installation in WiX and determine the version?

I've already found this page , but it is keyed to a particular version of Python both by the compile-time variable $(var.python_version) and the compile-time variable $(var.python_guid) .

I need to determine if any Python installs exist, and potentially what their versions are (in case I have a minimum version requirement, which I'm also not sure how to detect for).

Is there a straight-forward, or any, way to do this?

you need to use RegistrySearch

here is an example code to find matlab installation

<util:RegistrySearch Id="MatlabPath" Variable="MatlabPathExists" Root="HKLM" Key="SOFTWARE\MathWorks\MATLAB\4.17" Result="exists" Win64="yes" />

for .Net you can give minimum requirement

<ExePackage Id="Netfx45Xxx" Cache="no" Name="Files\dotnetfx45_full_x86_x64.exe" Compressed="no" PerMachine="yes" Permanent="yes" Vital="no" InstallCommand="/q" SourceFile="..\SetupProject\dotnetfx45_full_x86_x64.exe" DetectCondition="(Netfx4FullVersion=&quot;4.5.50709&quot;) AND (NOT VersionNT64 OR (Netfx4x64FullVersion=&quot;4.5.50709&quot;))" InstallCondition="(VersionNT &gt;= v6.0 OR VersionNT64 &gt;= v6.0) AND (NOT (Netfx4FullVersion=&quot;4.5.50709&quot; OR Netfx4x64FullVersion=&quot;4.5.50709&quot;))" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM