Bug #55169 Installer does not preserve user's settings in custom mode
Submitted: 12 Jul 2010 0:04 Modified: 17 Aug 2010 10:54
Reporter: Elena Stepanova Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:5.5.5-m3 OS:Windows
Assigned to: Vladislav Vaintroub CPU Architecture:Any
Tags: regression

[12 Jul 2010 0:04] Elena Stepanova
Description:
In previous versions Setup Wizard in custom mode allowed a user to set data folder path different from the server path. Now it is all the same -- if I change the data folder, server path in the wizard changes to the same value, and vice versa.

Further during the installation and configuration the provided data path is ignored, and the server is configured and started with the default data folder (e.g. C:\ProgramData\MySQL\MySQL Server 5.5\Data), while the server components are installed in the given location.

Moreover, the summary screen, which used to be shown in custom mode before the installation starts, is now non-informative -- it only says that the user can go back to change the settings, but does not show the current values, so it is very easy to miss the oddities listed above.

It brings the following problems:

1. If a user wants to install the new server in parallel with an existing 5.5 server running with default settings, they will get a clash as both servers will attempt to use the same data. E.g. if they have 5.5.3 server with datadir=C:\ProgramData\MySQL\MySQL Server 5.5\Data (default), and try to install 5.5.5 server into a different server location, with different port and its own data folder, they would have to edit server configuration manually and restart the server -- if the data is not corrupted before.

2. If a user has a server with a non-default data folder and wants to upgrade to 5.5.5, they cannot do so directly -- they will have to manually move data files or update configuration files after the upgrade.

3. No data folder location except for the default is available via setup wizard (cannot have data on a different disk, etc.)

How to repeat:
- start Setup Wizard;
- choose 'Custom' setup type;
- select 'Server data files', press Browse and change the path to something different from default and from what-used-to-be-default;
  (notice that the path to other components has also changed)
- run installation and configuration;
- connect to server;
- see that the datadir value is different from what you set in the wizard. 

Suggested fix:
- allow to set data folder and server folder separately, the way it was before;
- use the provided values while configuring the server;
- restore the summary in the "ready to install" screen in custom mode.
[12 Jul 2010 15:20] Vladislav Vaintroub
I think there is a misunderstanding that needs to be cleared.

> 1. If a user wants to install the new server in parallel with an existing 5.5 server running with default settings, they will get a clash as both servers will attempt to use...

A user should not be able to install 5.5 parallel to existing 5.5 . What happens (or what should happen) when you install 5.5.X on top existing 5.5.Y ( where X > Y) is an in-place upgrade of server executables. It *should* not be a new installation, instead an upgrade. And there should *not* be any ConfigWizards offered on upgrade.

>2. If a user has a server with a non-default data folder and wants to upgrade to 5.5.5,they cannot do so directly ...

Well, this is the single thing they should be able to do, single it is an upgrade, no new installation.

So the only problem ,as I see it, is the inability to use non-default datadir.
[13 Jul 2010 11:47] Vladislav Vaintroub
The actual bug  here is that we install data files twice : once in ProgramFiles 
(those are never changed) and user modifiyable in ProgramData (instealled in extra.wxs.in),  for ConfigWizard.

The feature selection tree shows the ProgramFiles data files, and ProgramData data files are hidden. This should be other way around.
[13 Jul 2010 11:48] Vladislav Vaintroub
possible fix

Attachment: 55169.diff (application/octet-stream, text), 2.71 KiB.

[13 Jul 2010 11:58] Vladislav Vaintroub
The file attached also includes some code to remember the install location (INSTALLDIR), for maintainence installation.

 (this is the code beginning with
+    <!-- Save/restore install location -->
)

This does not have much to do with the bug , but I noticed that maintainence installation (change) would always reset INSTALLDIR to the default one, even if custom location was used during install. The Wix code for this fragment itself is taken from http://wix.mindcapers.com/wiki/Upgrade 

Perhaps, some similar registry foo needs to be done to remember custom DATADIR, however it sems less critical (we would never delete anything in old DATADIR, even if its location is changed).
[14 Jul 2010 21:30] Omer Barnir
triage: setting to SR55RC (most people using 5.5 at this point will upgrade and want to keep their existing 5.5) Border line P1/P2
[14 Jul 2010 21:35] Vladislav Vaintroub
@Omer, people want to keep their existing data, but they are using beta software and as with beta software, everything is possible. 
If you install Windows beta or Visual Studio beta, you would need to remove/reinstall it  completely when it goes RTM. I do not see how why our beta policy should be different.
[24 Jul 2010 15:27] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/114290

3149 Vladislav Vaintroub	2010-07-24
      Bug#55169: Installer does not preserve user's settings in custom mode
      
      Fix some issues with WiX packaging, particularly 
      major upgrade and change scenarios.
      
      * remember binary location and data location
      (for major upgrade)
      
      * use custom UI, which is WiX Mondo extended 
      for major upgrade dialog (no feature selection
      screen shown on major upgrade, only upgrade
      confirmation). This is necessary to prevent
      changing installation path during upgrade
      (services are not reregistered, so they would 
      have invalid binary path is it is changed)
      
      * Hide datafiles that are installed into 
      ProgramFiles, show ones that are installed
      in ProgramData
      
      * Make MSI buildable with nmake
      
      * Fix autotools "make dist"
     @ Makefile.am
        Fix autotools "make dist"
     @ configure.in
        Fix autotools "make dist"
     @ packaging/Makefile.am
        Fix autotools "make dist"
     @ packaging/WiX/CMakeLists.txt
        Use custom UI, for major upgrades
     @ packaging/WiX/CPackWixConfig.cmake
        Show user editable datafiles in feature selection dialog, 
        not datafiles installed into ProgramFiles directory
     @ packaging/WiX/create_msi.cmake.in
        Use custom UI, fix nmake build for installer
     @ packaging/WiX/custom_ui.wxs
        Use custom UI
     @ packaging/WiX/extra.wxs.in
        Show user editable datafiles in feature selection dialog, 
        not datafiles installed into ProgramFiles directory
     @ packaging/WiX/mysql_server.wxs.in
        Remember install locations of binaries and 
        user editable datafiles.
[24 Jul 2010 16:50] Vladislav Vaintroub
pushed to trunk-bugfixing, next-mr-bugfixing
[4 Aug 2010 7:53] Bugs System
Pushed into mysql-trunk 5.5.6-m3 (revid:alik@sun.com-20100731131027-1n61gseejyxsqk5d) (version source revid:marko.makela@oracle.com-20100621094008-o9fa153s3f09merw) (merge vers: 5.1.49) (pib:18)
[4 Aug 2010 8:11] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:marko.makela@oracle.com-20100621094008-o9fa153s3f09merw) (merge vers: 5.1.49) (pib:18)
[4 Aug 2010 8:26] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804081533-c1d3rbipo9e8rt1s) (version source revid:marko.makela@oracle.com-20100621094008-o9fa153s3f09merw) (merge vers: 5.1.49) (pib:18)
[4 Aug 2010 9:05] Bugs System
Pushed into mysql-next-mr (revid:alik@ibmvm-20100804081630-ntapn8bf9pko9vj3) (version source revid:marko.makela@oracle.com-20100621094008-o9fa153s3f09merw) (pib:20)
[17 Aug 2010 10:54] MC Brown
A note has been added to the 5.5.6 and 5.6.0 changelogs: 

The Windows MSI installer would fail to preserve custom settings, such as the configured data directory, during installation.