English 中文(简体)
Conditional uninstall of previous version in Wix
原标题:

I m doing an installer for an software used for debugging embedded ARM cores (OpenOCD) and this installer automatically removes the previous versions - that s simple. However, sometimes that would be desirable to have more than just one version installed (each version has it s own folder, so there s no conflict here) due to various (in-)compatibility issues etc.

I m trying to create an installer which would have an option in the Feature tree (or anywhere else) to uninstall (or not) the previous version.

Basically there is this install sequence:

<InstallExecuteSequence>
    <Custom Action="NewerVersionDetected" After="FindRelatedProducts">DOWNGRADE</Custom>
    <RemoveExistingProducts After="InstallFinalize"/>
</InstallExecuteSequence>

I know that RemoveExistingProducts can be made conditional by putting a condition between RemoveExistingProducts tags but... what should the condition be? There s a lot of info about making features conditional or about conditions like OS version and some registry entries, but I haven t found any useful info about "user-defined conditions"...

Let s say that in the feature tree there is this element:

<Feature Id="UninstallOlderVersionFeature" Title="Uninstal previous versions" Level="1" Description="..."/>

How to make uninstallation previous version conditional on this feature (or any other method the user could select during the installation - a question box or a separate window or whatever it takes)?

Any help appreciated (by me and the users of the installer), as I m not very good in Wix and XML (I m an embedded person (; )

If any more details on the whole Wix file are required - tell me and I ll post relevant bits.

最佳回答

Try this:

<RemoveExistingProducts After="InstallFinalize">
<![CDATA[&UninstallOlderVersionFeature=3]]>
</RemoveExistingProducts>

It is the state wether the feature is selected. "3" says that the Feature is selected for installation.

问题回答

暂无回答




相关问题
3rd party Wix libraries

I am just getting started with Wix. I see there there a several libraries included with the default Wix install. I also see that users can create their own libraries(wixlibs). Are there any 3rd ...

Psake, Powershell & Wix

I have the below function as a part of my psake build. When the build is executing Candle.exe throws this error: candle.exe : warning CNDL1098: ext .BuildPackagesWixWebinWixIIsExtension.dll ...

wix custom dialog for config edit

hi i m trying make a setup msi for my application with wix v3 I have a problem about this task; I need a user input that will be stored in my application s config file (for example i need a dialog for ...

Closing an application using WiX

In creating my WiX installer I have run into an issue when trying to close an application before installing the upgrade. Below is an example of how I am attempting to do this. <util:...

Conditional uninstall of previous version in Wix

I m doing an installer for an software used for debugging embedded ARM cores (OpenOCD) and this installer automatically removes the previous versions - that s simple. However, sometimes that would be ...

热门标签