简体   繁体   中英

Check another installed application before msi runs

I have created simple msi, now I want to check another application is installed on the client machine or not before my msi runs.

because the application what I have created has a dependency of another application. If my application has to work on the client machine then that machine should have another application installed.

Lets say a.exe has a dependency on b.exe.

I have created msi for a.exe, when I run msi for a.exe in client machine then this msi has to detect whether b.exe is isntalled in client machine or not. if not then terminate the msi isntallation

If the another application was installed using MSI,

you can use Upgrade mechanism.

WiX:

<Upgrade Id="<UpgradeCode of the another App>">  
   <UpgradeVersion Property="PREVIOUSINSTALLEDAPP" />
</Upgrade> 

<Condition Message="Please Install another application">
  <![CDATA[PREVIOUSINSTALLEDAPP]]>
</Condition>

And ensure that FindRelatedProducts sequenced before LaunchConditions.

If you used the Visual Studio Installer then your options are somewhat limited. If the install of B creates a registry key then the Search Target Machine in your setup can search for that key and use it as a launch condition. If you have the MSI for B then you can open it with Orca from the Windows SDK kit and look at the Component table and find the Component Guid for (say) the executable that is installed. Again, that can be used in Search Target Machine for a Windows Installer search and a launch condition.

In general these checks work better in the actual app than in the install. You're forcing an install order that may be pointless because your install doesn't depend on B, only your application . So it's more friendly to allow any install order and put the check in your app saying it needs B to work if it's not installed. If the user uninstalls B does that mean your app will just crash because the only checking is at install time?

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