1<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"
2         xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
3
4<!--
5   Copyright (c) 2012, 2021, Oracle and/or its affiliates.
6
7   This program is free software; you can redistribute it and/or modify
8   it under the terms of the GNU General Public License, version 2.0,
9   as published by the Free Software Foundation.
10
11   This program is also distributed with certain software (including
12   but not limited to OpenSSL) that is licensed under separate terms,
13   as designated in a particular file or component or in included license
14   documentation.  The authors of MySQL hereby grant you an additional
15   permission to link the program and your derivative works with the
16   separately licensed software that they have included with MySQL.
17
18   This program is distributed in the hope that it will be useful,
19   but WITHOUT ANY WARRANTY; without even the implied warranty of
20   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21   GNU General Public License, version 2.0, for more details.
22
23   You should have received a copy of the GNU General Public License
24   along with this program; if not, write to the Free Software
25   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26-->
27    <!-- Include shortcuts -->
28    <DirectoryRef Id='INSTALLDIR'>
29    <Directory Id="DesktopFolder"/>
30    <Directory Id="ProgramMenuFolder">
31      <Directory Id="MysqlProgramMenuFolder" Name="MySQL">
32        <Directory Id="MysqlProductMenuFolder" Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@">
33          <Component Id="MysqlProductMenuFolder" Guid="*" @WixWin64@>
34            <!-- Include a shortcut to the mysql command line client -->
35            <Shortcut Id="MysqlCommandLineShellShortcut"
36                      Name="MySQL @MAJOR_VERSION@.@MINOR_VERSION@ Command Line Client"
37                      Description="The MySQL Command Line Shell"
38                      Icon="Icon.MysqlCmdShell"
39                      Target="[D.bin]mysql.exe"
40                      Arguments='"--defaults-file=[INSTALLDIR]my.ini" "-uroot" "-p"'
41                      WorkingDirectory="D.bin"/>
42            <?if "@MAJOR_VERSION@.@MINOR_VERSION@" != "5.5" ?>
43            <!-- Include another shortcut to the mysql command line client with a different name -->
44              <Shortcut Id="MysqlCommandLineShellShortcutUnicode"
45                      Name="MySQL @MAJOR_VERSION@.@MINOR_VERSION@ Command Line Client - Unicode"
46                      Description="The MySQL Command Line Shell in UTF8 Mode"
47                      Icon="Icon.MysqlCmdShell"
48                      Target="[D.bin]mysql.exe"
49                      Arguments='"--defaults-file=[INSTALLDIR]my.ini" "-uroot" "-p" "--default-character-set=utf8"'
50                      WorkingDirectory="D.bin"/>
51            <!-- Write Console settings for applications with this name to the registry -->
52              <RegistryKey Root="HKCU"
53                           Key="Console\MySQL @MAJOR_VERSION@.@MINOR_VERSION@ Command Line Client - Unicode"
54                           Action="createAndRemoveOnUninstall">
55                <RegistryValue Type="string" Name="FaceName" Value="Lucida Console"/>
56                <RegistryValue Type="integer" Name="FontWeight" Value="400"/>
57              </RegistryKey>
58            <?endif ?>
59            <!-- Make sure this gets deleted on uninstall -->
60            <RemoveFolder Id="MysqlProductMenuFolder" Directory="MysqlProductMenuFolder" On="uninstall"/>
61            <RemoveFolder Id="MysqlProgramMenuFolder" Directory="MysqlProgramMenuFolder" On="uninstall"/>
62            <RegistryValue Root="HKCU" Key="Software\MySQL AB\MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
63          </Component>
64        </Directory>
65      </Directory>
66    </Directory>
67    </DirectoryRef>
68    <Feature Id="ProgramMenu" Level="1" Display="hidden" ConfigurableDirectory="INSTALLDIR">
69    <ComponentRef Id="MysqlProductMenuFolder"/>
70    </Feature>
71
72    <!-- Registry -->
73    <!-- We still use "MySQL AB" because we don't want to break software that expects it -->
74    <DirectoryRef Id='TARGETDIR'>
75    <Component Id="RegKeys" Guid="*">
76      <RegistryKey
77        Id='MySQLKey'
78        Root='HKLM'
79        Key='SOFTWARE\MySQL AB\[ProductName]'
80        Action='createAndRemoveOnUninstall'>
81        <RegistryValue
82          Type='string'
83          Name='Location'
84          Value='[INSTALLDIR]'/>
85        <RegistryValue
86          Type="string"
87          Name="Version"
88          Value="[ProductVersion]"/>
89        <RegistryValue
90          Type="string"
91          Name="DataLocation"
92          Value="[DATADIR]"/>
93      </RegistryKey>
94    </Component>
95    </DirectoryRef>
96    <Feature
97    Id='RegKeys'
98    Display='hidden'
99    Level='1'>
100    <ComponentRef Id='RegKeys'/>
101    </Feature>
102
103    <!-- Datafiles that installation will copy to CommonAppData (initial database)
104    They are declared Permanent and NeverOverwrite since it is user data -->
105    <DirectoryRef Id='TARGETDIR'>
106    <Directory Id="CommonAppDataFolder">
107      <Directory Id="datadir.mysql" Name="MySQL">
108        <Directory Id="datadir.mysql.mysqlserver"
109          Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@">
110          <Directory Id="DATADIR" Name=".">
111            <Component Id="component.datadir" Guid="d3491319-5dbc-4477-95f3-4f809ef1dd2d">
112              <CreateFolder>
113                <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
114              </CreateFolder>
115            </Component>
116            <Directory Id="datadir.mysql.mysqlserver.data" Name="data">
117              <Component Id="component.datadir.data"
118                Guid="1d9a385d-6edf-4fb7-8652-35973c399d0c"
119                Permanent="yes" NeverOverwrite="yes">
120                <CreateFolder>
121                  <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
122                </CreateFolder>
123                @DATADIR_FILES@
124              </Component>
125              <Directory Id="datadir.mysql.mysqlserver.data.mysql" Name="mysql">
126                <Component Id="component.datadir.mysql"
127                  Guid="19ec0f1f-1a7f-424e-a788-b09346c0a709"
128                  Permanent="yes" NeverOverwrite="yes">
129                  <CreateFolder>
130                    <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
131                  </CreateFolder>
132                  @DATADIR_MYSQL_FILES@
133                </Component>
134              </Directory>
135              <Directory Id="datadir.mysql.mysqlserver.data.performance_schema"
136                 Name="performance_schema">
137                <Component Id="component.datadir.performance_schema"
138                  Guid="af2a6776-2655-431f-a748-9e9f4645acc3"
139                  Permanent="yes" NeverOverwrite="yes">
140                  <CreateFolder>
141                    <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
142                  </CreateFolder>
143                  @DATADIR_PERFORMANCE_SCHEMA_FILES@
144                </Component>
145              </Directory>
146              <Directory Id="datadir.mysql.mysqlserver.data.test" Name="test">
147                <Component Id="component.datadir.test" Guid="52fa9f0a-fcd1-420a-b2ac-95a8f70ad20a">
148                  <CreateFolder/>
149                </Component>
150              </Directory>
151            </Directory>
152          </Directory>
153        </Directory>
154      </Directory>
155    </Directory>
156    </DirectoryRef>
157
158    <Feature Id='UserEditableDataFiles'
159       Title='Server data files'
160       Description='Server data files'
161       ConfigurableDirectory='DATADIR'
162       Level='1'>
163    <ComponentRef Id="component.datadir"/>
164    <ComponentRef Id="component.datadir.data"/>
165    <ComponentRef Id="component.datadir.mysql"/>
166    <ComponentRef Id="component.datadir.performance_schema"/>
167    <ComponentRef Id="component.datadir.test"/>
168    </Feature>
169
170</Include>
171
172
173
174