uninstal version

Hello,we are using wyUpdate to install our application. But each install is also shown in "Add or remove programs", so in my case i now have under "Add or remove programs", five versions:- ApplicationName v3.0.4.0- ApplicationName v3.0.4.18- ApplicationName v3.0.5.27- ApplicationName v3.0.5.28- ApplicationName v3.0.5.29

my question is how to fix wyBuild, to always force remove previous version, before install the new one.Extra info: Using Visual studio 2017Using .msi file to install version

in project file ".wxs" i have <Product Id="*" UpgradeCode="$(var.UpgradeCode)" Version="$(var.Version)" Language="1033" Name="$(var.ProductDisplayName) (v$(var.Version))" Manufacturer="Unknown"> <Package InstallerVersion="380" Compressed="yes"/> <Media Id="1" Cabinet="IileServer.cab" EmbedCab="yes" />

<Upgrade Id="$(var.UpgradeCode)"> <UpgradeVersion OnlyDetect="yes" Minimum="$(var.Version)" Property="NEWERVERSIONDETECTED" IncludeMinimum="no" /> <UpgradeVersion OnlyDetect="no" Maximum="$(var.Version)" Property="OLDERVERSIONBEINGUPGRADED" IncludeMaximum="no" /> </Upgrade>

<InstallExecuteSequence> <RemoveExistingProducts After="InstallInitialize" /> <Custom Action="NewerVersion" After="FindRelatedProducts">NEWERVERSIONDETECTED</Custom> </InstallExecuteSequence>

<CustomAction Id="NewerVersion" Error="A later version of [ProductName] is already installed." />

Best regards

, edited

I think i found solution in .wxs file

<Product Id="*" UpgradeCode="$(var.UpgradeCode)" Version="$(var.Version)" Language="1033" Name="$(var.ProductDisplayName) (v$(var.Version))" Manufacturer="Unknown"> <Package InstallerVersion="380" Compressed="yes"/> <Media Id="1" Cabinet="IileServer.cab" EmbedCab="yes" />

<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" /> <Upgrade Id="$(var.UpgradeCode)"> <UpgradeVersion Minimum="1.0.0.0" Maximum="99.0.0.0" Property="PREVIOUSVERSIONSINSTALLED" IncludeMinimum="yes" IncludeMaximum="no" /> </Upgrade>

<InstallExecuteSequence> <Custom Action="NewerVersion" After="FindRelatedProducts">NEWERVERSIONDETECTED</Custom> <RemoveExistingProducts Before="InstallInitialize" /> </InstallExecuteSequence>

<CustomAction Id="NewerVersion" Error="A later version of [ProductName] is already installed." />

My previous post did not fix my problem.It has removed all versions - ApplicationName v3.0.5.Xbut versions like - ApplicationName v3.0.4.X has stayed

martin86 wrote:> My previous post did not fix my problem.> It has removed all versions - ApplicationName v3.0.5.X> but versions like - ApplicationName v3.0.4.X has stayed

You are installing a new msi, not upgrading: that's the point in my opinion.You need to implement the right strategy in your installer to identify a product and uninstall it. This in InstallShield can be done by checking for the upgrade key of the product.

Another option would be to call msiexec /x {product_key} directly from wyupdate by executing a script file before the update process.

Where product_key is the GUID of the product to uninstall.