Uninstall previous version

Add-in Express™ Support Service
That's what is more important than anything else

Uninstall previous version
Version installed with VDProj installer doesn't get uninstalled by Wix installer 
Brad Clements




Posts: 72
Joined: 2008-05-01
Version 3.4.3 of my addin was installed with a VDProj installer. I used VDProj to Wix Converter to create a Wix installer for version 3.4.4. In the new project's Product.wxs I changed the Version attribute of the Product element to 3.4.4, and I also changed the Minimum/Maximum attributes of the Upgrade/UpgradeVersion elements to 3.4.4. When I run the new installer, it succeeds but it doesn't uninstall the previous version. Control Panel's Programs list shows both 3.4.3 and 3.4.4. What do I need to change to have the Wix installer uninstall the old version?

I have verified that the UpgradeCode is the same in both the VDProj installer and the new Wix installer. The Product element in Product.wxs looks like this:

    <Product Id='*' Name='My addin' Language='1033' Version='3.4.4' Manufacturer='My company' UpgradeCode='{078CE48B-D319-4431-8F65-0FB9C1E79528}' Codepage='1252'>


The Upgrade element in Product.wxs looks like this:

        <Upgrade Id='{078CE48B-D319-4431-8F65-0FB9C1E79528}'>
            <UpgradeVersion Minimum='3.4.4' Property='NEWPRODUCTFOUND' OnlyDetect='yes' IncludeMinimum='no' Language='1033' />
            <UpgradeVersion Maximum='3.4.4' Property='OLDPRODUCTFOUND' OnlyDetect='no' IncludeMinimum='yes' IncludeMaximum='no' Language='1033' />
        </Upgrade>


And the InstallExecuteSequence element of Product.wxs includes the following element:

            <RemoveExistingProducts Before='InstallInitialize' />
Posted 06 Jun, 2014 12:23:08 Top
Andrei Smolin


Add-in Express team


Posts: 14106
Joined: 2006-05-11
Hello Brad,

Does the original installer targets to program files? Is it per-user or per-machine?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 09 Jun, 2014 04:11:18 Top
Andrei Smolin


Add-in Express team


Posts: 14106
Joined: 2006-05-11
Could you also answer the same questions about the new project? Do you run it elevated?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 09 Jun, 2014 04:15:27 Top
Brad Clements




Posts: 72
Joined: 2008-05-01
Both the old and the new installer display a UAC elevation prompt whether in per-user or per-machine mode. Both the old and the new installer let the user choose a per-user or per-machine installation. The old installer defaults to per-user while the new installer defaults to per-machine; apparently VDProj converter did not carry over that default. I'm not sure why that is happening because the new Product.wxs contains the following lines which appear to set the default to per-user:

<Property Id='FolderForm_AllUsers' Value='ME' />
            <Property Id='FolderForm_AllUsersVisible' Value='1' />
            <RadioButtonGroup Property='FolderForm_AllUsers'>
                <RadioButton Height='17' Text='{VSI_MS_Sans_Serif13.0_0_0}&amp;Everyone' Value='ALL' Width='342' X='0' Y='0' />
                <RadioButton Height='17' Text='{VSI_MS_Sans_Serif13.0_0_0}Just &amp;me' Value='ME' Width='342' X='0' Y='18' />
            </RadioButtonGroup>


I now see that the problem I originally reported happens only if the old install was done in per-user mode and the new install is done in per-machine mode.

If the old install was done in per-user mode and the new install is done in per-user mode, I get an error from the new installer saying that it has insufficient privileges to complete the installation.

If the old install was done in per-machine mode then I get the insufficient privileges error from the new installer whether I do the new install in per-user or per-machine mode.
Posted 09 Jun, 2014 10:44:32 Top
Andrei Smolin


Add-in Express team


Posts: 14106
Joined: 2006-05-11
Brad,

This is my understanding that for two installers having different scopes, the second installer cannot uninstall the first one automatically.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 09 Jun, 2014 10:55:32 Top
Brad Clements




Posts: 72
Joined: 2008-05-01
It makes sense that the second installer can't uninstall the first one automatically when they have different scopes. But shouldn't the second installer detect the first installer and display a message telling the user to manually uninstall the older version before installing the new version? And in the case where the first installer was run in per-machine mode and the second installer is also run in per-machine mode, why would the second installer display the insufficient privileges message? It seems like VDProj converter has left me with an installer that is not handling these cases very well.
Posted 09 Jun, 2014 11:02:07 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Brad,

But shouldn't the second installer detect the first installer and display a message telling the user to manually uninstall the older version before installing the new version?

I think that it can be done via a custom action.

And in the case where the first installer was run in per-machine mode and the second installer is also run in per-machine mode, why would the second installer display the insufficient privileges message?

What is set in the 'InstallScope' attribute of 'Package' in the wixproj setup?
Posted 09 Jun, 2014 11:20:37 Top
Brad Clements




Posts: 72
Joined: 2008-05-01
The InstallScope attribute of Package is "perMachine".
Posted 09 Jun, 2014 11:25:29 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Brad,

Please send me .vdproj and product.wxs files on the support email. I will try to reproduce the issue.
Posted 09 Jun, 2014 12:47:35 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Brad,

To fix the issue please remove the 'InstallScope' attribute from the 'Package' element at all.
Posted 10 Jun, 2014 07:37:12 Top