Bug #13846 Windows installer is unable to overwrite service even though it asks about it
Submitted: 7 Oct 2005 15:12 Modified: 7 Oct 2005 15:33
Reporter: Andrea Matsunaga Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.13rc OS:Windows (Windows 2000)
Assigned to: CPU Architecture:Any

[7 Oct 2005 15:12] Andrea Matsunaga
Description:
When one has installed a previous version of MySQL as a service and did not remove it before installing MySQL 5.0 from setup.exe-based installer and selecting the option to install as a windows service, the installer fails with "Cannot create windows service for MySQL. Error: 0." message when the execute button is pressed in the last step of the configuration procedure.

In my opinion since the installer pops a message box "A windows service with name MySQL already exists. Are you sure you want to use this service name?" and one can answer "yes", the installer should be able to remove the previous service and install the new one, or it should give instructions for the user to remove the previous version first (instead of asking yes/no).

How to repeat:
Install any MySQL service with mysqld --install (no install binary). I used MySQL 4.1.1a-alpha.
Install MySQL 5.0 setup.exe and and at the end of installation process choose to configure it. During this process choose to install as Window Service named "MySQL", continue the configuration until you get the "Execute" button. When you hit this button the configuration process will fail in the "start service" step with "Cannot create windows service for MySQL. Error: 0."

Suggested fix:
Between the write configuration and start service steps, there should be an "overwrite previous service" step. In this step either the registry should be updated with the new information or the existing service information in the registry should be looked up in order for the installer to find the appropriate path to execute "mysqld --remove".

If the installer for any reason fails in removing the previous service, it will be helpful if the installer also instructs the user to go to the previous installed MySQL bin directory, execute "mysqld --remove" and then retry to hit the "Execute" button (one could also manually edit the registry, but this requires machine restart and expertise in windows).
[7 Oct 2005 15:33] Valeriy Kravchuk
Thank you for a problem report and suggestions. You are right, it is a duplicate of http://bugs.mysql.com/bug.php?id=13093. I'll add a comment about you report there.