Bug #112388 MySQL for Visual Studio Plugin can't be removed if Visual Studio is not availabl
Submitted: 19 Sep 2023 13:23 Modified: 28 Oct 2023 13:02
Reporter: Thomas Schweikle Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Visual Studio Integration Severity:S2 (Serious)
Version:8.0.34 OS:Windows
Assigned to: MySQL Verification Team CPU Architecture:Any
Tags: MySQL for Visual Studio 1.2.10

[19 Sep 2023 13:23] Thomas Schweikle
Description:
MySQL for Visual Studio 1.2.10 (2.0.5) can not be uninstalled if Visual Studio 2017 or 2019 is not present any more.

How to repeat:
Install Visual Studio 2017 or 2019; then install "MySQL for Visual Studio" Version 1.2.10 or higher. Next remove Visual Studio 2017 or 2019.

"MySQL for Visual Studio" now can not be uninstalled any more. It just tells that Visual Studio 2017 or 2019 is required. The installer in tune can not be uninstalled too: it wants to uninstall "MySQl for Visual Studio" first, but fails because "MySQL for Visual Studio" requires Visual Studio 2017 or 2019 to be installed.

This bug was there for "MySQL for Visual Studio" since 1.2.4 at least. There is a suggested workaround documented in "https://dev.mysql.com/blog-archive/mysql-for-visual-studio-uninstall-workaround/". But this does not help. The awaited registry keys are there, but uninstalling fails nevertheless.
[21 Sep 2023 13:08] MySQL Verification Team
Hello Thomas,

Thank you for the bug report.
May be you can try uninstall MySQL for Visual Studio using MySQL Installer first then uninstall Visual Studio 2017/2019? I tried above method and I was able to uninstall both without any issues. Thanks.

Regards,
Ashwini Patil
[21 Sep 2023 18:55] Thomas Schweikle
Since I have replaced Visual Studio 2019 by 2022 I would have to reinstall Visual Studio 2019. I have tried that. It does not help. The installer calls internally Visual Studio 2019 to deregister certain parts and then fails because the registry hives it tries to find and remove are not found.
Trying to reinstall MySQL for Visual Studio does not help either: the installer just tells me it where already installed. It is a deadlock. I would have to remove all and everything from MySQL for Visual Studio to Install it again. Maybe the installer should not depend on deregistering anything calling Visual Studio 2019 register routines if Visual Studio 2019 is not found any more? Just removing what is there (or not) to allow to remove the installer itself.
[22 Sep 2023 11:29] Thomas Schweikle
> May be you can try uninstall MySQL
> for Visual Studio using MySQL
> Installer first then uninstall
> Visual Studio 2017/2019? I tried
> above method and I was able to
> uninstall both without any issues.

Visual Studio 2019 was removed after upgrading to Visual Studio 2022. Visual Studio is not installed any more.

-> Trying to remove "MySQL for Visual Studio" leads to "Visual Studio 2017 or 2019" is not installed, leaving "MySQL for Visual Studio" installed.
-> Trying to remove "MySQL Installer for Windows" tries to remove "MySQL for Visual Studio". This leads to fatal error: "Visual Studio 2017 or 2019 is not installed". Leaving both, "MySQL for Visual Studio" and "MySQL Installer for Windows" installed.

Installing "Visual Studio 2019" again (it can exist side by side with Visual Studio 2022), then trying again:
-> Trying to remove "MySQL for Visual Studio" leads to "Can not unregister 'MySQL for Visual Studio'", leaving "MySQL for Visual Studio" installed.
-> Trying to remove "MySQL Installer for Windows" tries to remove "MySQL for Visual Studio". This leads to fatal error: "Can not unregister 'MySQL for Visual Studio'". Leaving both, "MySQL for Visual Studio" and "MySQL Installer for Windows" installed.

Trying to reinstall/repair "MySQL for Visual Studio" gives:
-> Can not repair a product not installed"

or if called by "MySQL Installer for Windows":
-> "'MySQL for Visual Studio' does not appear to be installed"

Trying to remove "MySQL for Visual Studio" again:
-> Trying to remove "MySQL for Visual Studio" leads to "Can not unregister 'MySQL for Visual Studio'", leaving "MySQL for Visual Studio" installed.
-> Trying to remove "MySQL Installer for Windows" tries to remove "MySQL for Visual Studio". This leads to fatal error: "Can not unregister 'MySQL for Visual Studio'". Leaving both, "MySQL for Visual Studio" and "MySQL Installer for Windows" installed.

So:
- The installer reports "MySQL for Visual Studio" as installed.
- The installer is not capable of removing "MySQL for Visual Studio", because it can not be deregistered, because it seems not to be installed.
- The installer is not capable to repair "MySQL for Visual Studio", because it can not find the installation.

Removing "Visual Studio 2019" while "MySQL for Visual Studio" is installed leads to a situation where it is installed, but not registered in a way the installer could deregister it if "Visual Studio 2019" is reinstalled.

Since there is no way to remove "MySQL for Visual Studio" there is no way to remove "MySQL Installer for Windows".
So how do I manually remove both: "MySQL for Visual Studio" and "MySQL Installer for Windows"?

Which Files where installed into the System, into "Visual Studio 2019" and where?
Which registry keys where created, in which hive?
Which files were changed while installing "MySQL for Visual Studio"?
[26 Sep 2023 15:22] Javier TreviƱo
The best way to solve this problem is to use the Windows troubleshooter:

https://support.microsoft.com/en-us/topic/fix-problems-that-block-programs-from-being-inst...

Depending on the Windows version the procedure might be slightly different, or if you are using a very old Windows version you might need to download the "Fix It!" program (which evolved into the troubleshooter I mentioned).

Please let us know if this fixes the problem for you.
[29 Oct 2023 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".