~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-security

« back to all changes in this revision

Viewing changes to win/packaging/extra.wxs.in

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2015-06-13 21:09:48 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20150613210948-6b0ina6he3w5s307
Tags: 5.5.44-1ubuntu0.14.04.1
* SECURITY UPDATE: Update to 5.5.44 to fix security issues (LP: #1464895):
  - CVE-2015-3152
* Upstream also includes lots of line ending changes (from CRLF -> LF)
* Removed hotfix patch now included in upstream release (MDEV-8115)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0" encoding="utf-8"?>
2
 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"  xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
3
 
  <Fragment>
4
 
    <!--
5
 
      Check, if upgrade wizard was built 
6
 
      It currently requires MFC, which is not in SDK 
7
 
      neither in express edítions of VS.
8
 
    -->
9
 
    <?ifndef HaveUpgradeWizard ?>
10
 
      <?define HaveUpgradeWizard="1"?>
11
 
    <?endif?>
12
 
 
13
 
    <!-- If Innodb is compiled in, enable "optimize for transactions" checkbox -->
14
 
    <?ifndef HaveInnodb ?>
15
 
      <?define HaveInnodb="0"?>
16
 
    <?endif?>
17
 
 
18
 
    <Property Id="PortTemplate" Value="#####" />
19
 
    <?if $(var.HaveInnodb) = "1" ?>
20
 
      <Property Id="BufferPoolSizeTemplate" Value="#######" />
21
 
    <?endif?>
22
 
    <!--
23
 
      Installation parameters that can be passed via msiexec command line
24
 
      For "booleans" (like skip networking), just providing any value means property set to "yes".
25
 
    -->
26
 
    <!-- instalation directory (default under program files)-->
27
 
    <!--- (defined elsewhere) <Property Id="INSTALLDIR" Secure="yes" /> -->
28
 
 
29
 
    <!-- Database data directory (default under INSTALLDIR\data) -->
30
 
    <!--- (defined elsewhere) <Property Id="DATADIR" Secure="yes"/> -->
31
 
 
32
 
    <!-- Service name of database instanced (default MySQL in GUI, nothing with command line) -->
33
 
    <!--  (defined elsewhere) <Property Id="SERVICENAME" Secure="yes" /> -->
34
 
 
35
 
    <!-- Root password -->
36
 
    <Property Id="PASSWORD" Hidden="yes" Secure="yes" />
37
 
    <Property Id="ESCAPEDPASSWORD" Hidden="yes" Secure="yes" />
38
 
    <!-- Database port -->
39
 
    <Property Id="PORT" Value="3306" Secure="yes"/>
40
 
    <!-- Whether to allow remote access for root user -->
41
 
    <Property Id="ALLOWREMOTEROOTACCESS" Secure="yes" />
42
 
    <!-- Skip networking. This will switch configuration to use named pipe-->
43
 
    <Property Id="SKIPNETWORKING" Secure="yes"/>
44
 
    <!-- Whether to keep default (unauthenticated) user. Default is no-->
45
 
    <Property Id="DEFAULTUSER" Secure="yes"/>
46
 
    <!-- Set server character set to UTF8 -->
47
 
    <Property Id="UTF8" Secure="yes"/>
48
 
    <!-- Whether to data on uninstall (default yes, after asking user consent) -->
49
 
    <Property Id="CLEANUPDATA" Secure="yes" Value="1"/>
50
 
    <!-- Force per machine installation -->
51
 
    <Property Id="ALLUSERS" Secure="yes" Value="1"/>
52
 
    <!-- Disable advertised shortcuts weirdness -->
53
 
    <Property Id="DISABLEADVTSHORTCUTS" Secure="yes" Value="1"/>
54
 
 
55
 
    <!-- Activate feedback plugin-->
56
 
    <Property Id="FEEDBACK" Secure="yes"/>
57
 
 
58
 
    <?if $(var.HaveInnodb) = "1" ?>
59
 
      <!-- Quick configuration : set default storage engine to innodb, use strict sql_mode -->
60
 
      <Property Id="STDCONFIG" Secure="yes" Value="1"/>
61
 
    <?endif?>
62
 
    <!-- Innodb Buffer pool size in MB-->
63
 
    <Property Id="BUFFERPOOLSIZE" Secure="yes"/>
64
 
 
65
 
 
66
 
    <CustomAction Id="LaunchUrl" BinaryKey="WixCA" DllEntry="WixShellExec"  Execute="immediate" Return="check" Impersonate="yes" />
67
 
 
68
 
 
69
 
    <!-- 
70
 
      User interface dialogs 
71
 
     -->
72
 
    <WixVariable Id='WixUIBannerBmp' Value='@CMAKE_CURRENT_SOURCE_DIR@\WixUIBannerBmp.jpg' />
73
 
    <WixVariable Id='WixUIDialogBmp' Value='@CMAKE_CURRENT_SOURCE_DIR@\WixUIDialogBmp.jpg' />
74
 
    <UI>
75
 
 
76
 
      <!-- Dialog on uninstall of the database -->
77
 
      <Dialog Id="ConfirmDataCleanupDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
78
 
 
79
 
        <!--<Control Id="CleanupDataCheckBox" Type="CheckBox" X="20" Y="100" Height="30" Property="CLEANUPDATA" Width="300" CheckBoxValue="1"
80
 
                Text="{\Font1}Remove default database directory &#xD;&#xA;'[DATADIR]'"/>
81
 
                -->
82
 
        <Control Id="RemoveDatadirButton" Type="PushButton" X="40" Y="65" Width="80" Height="18"
83
 
                  Text="Remove data">
84
 
          <Publish Property="CLEANUPDATA" Value="1">1</Publish>
85
 
          <Publish Event="NewDialog" Value="VerifyReadyDlg">WixUI_InstallMode</Publish>
86
 
          <Publish Event="EndDialog" Value="Return">NOT WixUI_InstallMode</Publish>
87
 
 
88
 
        </Control>
89
 
        <Control Id="RemoveDatadirText" Type="Text" X="60" Y="85" Width="280" Height="20">
90
 
          <Text>Remove default database directory [DATADIR]. Ensures proper cleanup on uninstall.</Text>
91
 
        </Control>
92
 
 
93
 
        <Control Id="KeepDatadirButton" Type="PushButton" X="40" Y="118" Width="80" Height="18"
94
 
                 Text="Keep data">
95
 
          <Publish Property="CLEANUPDATA">1</Publish>
96
 
          <Publish Event="NewDialog" Value="VerifyReadyDlg">WixUI_InstallMode</Publish>
97
 
          <Publish Event="EndDialog" Value="Return">NOT WixUI_InstallMode</Publish>
98
 
        </Control>
99
 
        <Control Id="KeepDataDirText" Type="Text" X="60" Y="138" Width="280" Height="70" >
100
 
          <Text>Do not remove [DATADIR]. Choose this option if you intend to use data in the future</Text>
101
 
        </Control>
102
 
 
103
 
 
104
 
        <!-- Navigation buttons-->
105
 
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;Back">
106
 
          <Publish Event="NewDialog" Value="CustomizeDlg">WixUI_InstallMode="Change"</Publish>
107
 
          <Condition Action="disable">NOT WixUI_InstallMode</Condition>
108
 
        </Control>
109
 
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Disabled="yes" Text="&amp;Next">
110
 
          <Publish Event="NewDialog" Value="VerifyReadyDlg">WixUI_InstallMode</Publish>
111
 
          <Publish Event="EndDialog" Value="Return">NOT WixUI_InstallMode</Publish>
112
 
        </Control>
113
 
        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
114
 
          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
115
 
        </Control>
116
 
        <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
117
 
        <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
118
 
          <Text>Remove default [ProductName] database</Text>
119
 
        </Control>
120
 
        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
121
 
        <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
122
 
          <Text>{\WixUI_Font_Title}Default instance properties</Text>
123
 
        </Control>
124
 
        <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
125
 
      </Dialog>
126
 
 
127
 
      <!-- Dialog new or upgrade instance -->
128
 
 
129
 
      <Property Id="CreateOrUpgradeChoice" Value="Create"/>
130
 
      
131
 
      <Dialog Id="NewOrUpgradeInstanceDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
132
 
        <Control Id="Text" Type="Text" X="40" Y="65" Width="270" Height="30">
133
 
          <Text>Setup found existing database instances that can be upgraded to [ProductName].You can create a new instance and/or upgrade existing one.
134
 
          </Text>
135
 
        </Control>
136
 
 
137
 
        <Control Id="CreateOrUpgradeButton" 
138
 
                 Type="RadioButtonGroup" X="40" Y="100" Width="300" Height="70" 
139
 
                 Property="CreateOrUpgradeChoice" Text="Specify what to do">
140
 
          <RadioButtonGroup Property="CreateOrUpgradeChoice">
141
 
            <RadioButton Value="Create" X="0" Y="0" Width="300" Height="25"
142
 
                  Text="{\Font1}Create new database instance."/>
143
 
            <RadioButton Value="Upgrade" X="0" Y="30" Width="300" Height="25"
144
 
                  Text="{\Font1}Do not create a new database. Optionally upgrade existing instances." />
145
 
          </RadioButtonGroup>
146
 
        </Control>
147
 
 
148
 
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;Back">
149
 
          <Publish Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
150
 
        </Control>
151
 
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Text="&amp;Next">
152
 
          <Publish Event="Remove" Value="DBInstance">CreateOrUpgradeChoice = "Upgrade" </Publish>
153
 
          <Publish Event="AddLocal" Value="DBInstance">CreateOrUpgradeChoice = "Create"</Publish>
154
 
          <Publish Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="[NonExistentProperty]">CreateOrUpgradeChoice = "Create"</Publish>
155
 
          <Publish Property="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="[NonExistentProperty]">CreateOrUpgradeChoice = "Create"</Publish>
156
 
          <Publish Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1">CreateOrUpgradeChoice = "Upgrade"</Publish>
157
 
          <Publish Event="NewDialog" Value="CustomizeDlg">1</Publish>
158
 
        </Control>
159
 
        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
160
 
          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
161
 
        </Control>
162
 
        <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
163
 
        <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
164
 
          <Text>Create or upgrade database instance</Text>
165
 
        </Control>
166
 
        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
167
 
        <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
168
 
          <Text>{\WixUI_Font_Title}[ProductName] setup</Text>
169
 
        </Control>
170
 
        <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
171
 
      </Dialog>
172
 
 
173
 
       <!-- Feedback dialog -->
174
 
       <Dialog Id="Feedback" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
175
 
 
176
 
         <Control Id="CheckBoxFeedback" Type="CheckBox" X="8" Y="61" Width="360" Height="12" Property="FEEDBACK" CheckBoxValue="1" TabSkip="no">
177
 
          <Text>{\Font1}Enable the Feedback plugin and submit anonymous usage information</Text>
178
 
        </Control>
179
 
 
180
 
        <Control Id="Text" Type="Text" X="23" Y="82" Width="290" Height="55">
181
 
         <Text>Monty Program has created a Feedback plugin for MariaDB which, if enabled, collects basic anonymous statistical information. This information is used by the developers to improve MariaDB. Enabling this plugin is an easy way to help with MariaDB development. Collected statistics, and more information on the plugin, can be viewed at http://mariadb.org/feedback_plugin         </Text>
182
 
        </Control>
183
 
 
184
 
       <Control Id="MoreInfo" Type="PushButton" X="23" Y="140" Width="56" Height="17" Text="More Info" ToolTip="http://mariadb.org/feedback_plugin" >
185
 
          <Publish Property="WixShellExecTarget" Value="http://mariadb.org/feedback_plugin"  Order="1">1</Publish>
186
 
          <Publish Event="DoAction" Value="LaunchUrl" Order="2">1</Publish>
187
 
        </Control>
188
 
 
189
 
 
190
 
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;Back">
191
 
          <Publish Event="NewDialog" Value="ServicePortDlg">1</Publish>
192
 
        </Control>
193
 
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Text="&amp;Next">
194
 
          <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
195
 
        </Control>
196
 
        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
197
 
          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
198
 
        </Control>
199
 
        <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
200
 
        <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
201
 
          <Text>Submit usage information</Text>
202
 
        </Control>
203
 
        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
204
 
        <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
205
 
          <Text>{\WixUI_Font_Title}[ProductName] setup</Text>
206
 
        </Control>
207
 
        <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
208
 
      </Dialog>
209
 
      
210
 
      <!-- Error popup dialog -->
211
 
      <Dialog Id="WarningDlg" Width="320" Height="85" Title="[ProductName] Setup" NoMinimize="yes">
212
 
       <Control Id="Icon" Type="Icon" X="15" Y="15" Width="24" Height="24"
213
 
       ToolTip="Information icon" FixedSize="yes" IconSize="32" Text="WixUI_Ico_Info" />
214
 
        <Control Id="Ok" Type="PushButton" X="132" Y="57" Width="56" Height="17"
215
 
          Default="yes" Cancel="yes" Text="OK">
216
 
          <Publish Property="WarningText">1</Publish>
217
 
          <Publish Event="EndDialog" Value="Return">1</Publish>
218
 
        </Control>
219
 
        <Control Id="Text" Type="Text" X="48" Y="15" Width="260" Height="30">
220
 
          <Text>[WarningText]</Text>
221
 
        </Control>
222
 
      </Dialog>
223
 
 
224
 
 
225
 
      <Property Id="ModifyRootPassword" Value="1"/>
226
 
      <TextStyle Id="Font1" FaceName="Tahoma" Size="8" Red="0" Green="0" Blue="0" Bold="yes" />
227
 
 
228
 
      <!-- Root password plus default user dialog  -->
229
 
      <Dialog Id="UserSettingsDlg" X="50" Y="50" Width="370" Height="270" Title="User settings">
230
 
        <Control Id="EditRootPassword" Type="Edit" X="104" Y="82" Width="91" Height="15" Property="PASSWORD" Password="yes" TabSkip="no">
231
 
          <Text>{100}</Text>
232
 
          <Condition Action="enable">ModifyRootPassword</Condition>
233
 
          <Condition Action="disable">NOT ModifyRootPassword</Condition>
234
 
        </Control>
235
 
        <Control Id="EditRootPasswordConfirm" Type="Edit" X="104" Y="103" Width="91" Height="15" Property="RootPasswordConfirm"  Password="yes" TabSkip="no">
236
 
          <Text>{100}</Text>
237
 
          <Condition Action="enable">ModifyRootPassword</Condition>
238
 
          <Condition Action="disable">NOT ModifyRootPassword</Condition>
239
 
        </Control>
240
 
 
241
 
        <Control Id="CheckBoxModifyRootPassword" Type="CheckBox" X="8" Y="62" Width="222" Height="18" Property="ModifyRootPassword" CheckBoxValue="1" TabSkip="no">
242
 
          <Text>{\Font1}Modify password for database user 'root'</Text>
243
 
          <Publish Property="PASSWORD" >NOT ModifyRootPassword</Publish>
244
 
          <Publish Property="RootPasswordConfirm">NOT ModifyRootPassword</Publish>
245
 
          <Publish Property="ALLOWREMOTEROOTACCESS">NOT ModifyRootPassword</Publish>
246
 
          <Publish Property="ALLOWREMOTEROOTACCESS" Value="1">ModifyRootPassword</Publish>
247
 
        </Control>
248
 
 
249
 
        <Control Id="Text5" Type="Text" X="23" Y="82" Width="77" Height="14" TabSkip="yes">
250
 
          <Text>New root password:</Text>
251
 
        </Control>
252
 
        <Control Id="Text6" Type="Text" X="201" Y="85" Width="100" Height="17" TabSkip="yes">
253
 
          <Text>Enter new root password</Text>
254
 
        </Control>
255
 
        <Control Id="Text8" Type="Text" X="23" Y="105" Width="75" Height="17" TabSkip="yes">
256
 
          <Text>Confirm:</Text>
257
 
        </Control>
258
 
 
259
 
        <Control Id="Text10" Type="Text" X="201" Y="104" Width="100" Height="17" TabSkip="yes">
260
 
          <Text>Retype the password</Text>
261
 
        </Control>
262
 
        <Control Id="CheckBoxALLOWREMOTEROOTACCESS" Type="CheckBox" X="23" Y="122" Width="196" Height="18" Property="ALLOWREMOTEROOTACCESS"
263
 
                 CheckBoxValue="--allow-remote-root-access" TabSkip="no">
264
 
          <Text>{\Font1}Enable access from remote machines for 'root' user</Text>
265
 
          <Condition Action="enable">ModifyRootPassword</Condition>
266
 
          <Condition Action="disable">NOT ModifyRootPassword</Condition>
267
 
        </Control>
268
 
 
269
 
        <Control Id="CheckBoxCreateDefaultUser" Type="CheckBox" X="8" Y="154" Width="200" Height="18" Property="DEFAULTUSER"
270
 
                 CheckBoxValue="--default-user" TabSkip="no">
271
 
          <Text>{\Font1}Create An Anonymous Account</Text>
272
 
        </Control>
273
 
        <Control Id="Text14" Type="Text" X="21" Y="174" Width="268" Height="16" TabSkip="yes">
274
 
          <Text>This option will create an anonymous account on this server. </Text>
275
 
        </Control>
276
 
        <Control Id="Text13" Type="Text" X="21" Y="190" Width="254" Height="24" TabSkip="yes">
277
 
          <Text>Please note: this setting can lead to insecure systems.</Text>
278
 
        </Control>
279
 
 
280
 
        <Control Id="CheckBoxUTF8" Type="CheckBox" X="8" Y="215" Width="250" Height="18" Property="UTF8" CheckBoxValue="1" TabSkip="no">
281
 
          <Text>{\Font1}Use UTF8 as default server's character set</Text>
282
 
        </Control>
283
 
 
284
 
        <!-- Navigation buttons-->
285
 
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;Back">
286
 
          <Publish Event="NewDialog" Value="CustomizeDlg">1</Publish>
287
 
        </Control>
288
 
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&amp;Next">
289
 
          <Publish Property="WarningText" Value="Passwords do not match."><![CDATA[PASSWORD <> RootPasswordConfirm]]></Publish>
290
 
          <Publish Event="SpawnDialog" Value="WarningDlg"><![CDATA[WarningText <>""]]></Publish>
291
 
          <Publish Property="SERVICENAME" Value="MySQL">NOT SERVICENAME AND NOT WarningText</Publish>
292
 
          <Publish Event="NewDialog" Value="ServicePortDlg"><![CDATA[WarningText=""]]></Publish>
293
 
          <Condition Action="enable"><![CDATA[NOT ModifyRootPassword OR PASSWORD]]> </Condition>
294
 
          <Condition Action="disable"><![CDATA[ModifyRootPassword AND (NOT PASSWORD)]]> </Condition>
295
 
        </Control>
296
 
        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
297
 
          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
298
 
        </Control>
299
 
        <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
300
 
        <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
301
 
          <Text> [ProductName] database configuration</Text>
302
 
        </Control>
303
 
        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
304
 
        <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
305
 
          <Text>{\WixUI_Font_Title}Default instance properties</Text>
306
 
        </Control>
307
 
        <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
308
 
      </Dialog>
309
 
 
310
 
      <Property Id="InstallService" Value="1"/>
311
 
      <Property Id="EnableNetworking" Value="1"/>
312
 
 
313
 
      <!-- Service and port configuration -->
314
 
      <Dialog Id="ServicePortDlg" Width="370" Height="270" Title="Database settings">
315
 
        <Control Id="InstallAsService" Type="CheckBox" X="9" Y="61" Width="222" Height="19" Property="InstallService" CheckBoxValue="1" TabSkip="no">
316
 
          <Text>{\Font1}Install as service</Text>
317
 
        </Control>
318
 
        <Control Id="EditServiceName" Type="Edit" X="104" Y="82" Width="91" Height="15" Property="SERVICENAME" TabSkip="no">
319
 
          <Text>{20}</Text>
320
 
          <Condition Action="enable">InstallService</Condition>
321
 
          <Condition Action="disable">Not InstallService</Condition>
322
 
        </Control>
323
 
        <Control Id="Text5" Type="Text" X="25" Y="82" Width="77" Height="14" TabSkip="yes">
324
 
          <Text>Service Name:</Text>
325
 
        </Control>
326
 
        <Control Id="CheckBoxEnableNetworking" Type="CheckBox" Height="18" Width="102" X="9" Y="117" Property="EnableNetworking" CheckBoxValue="1">
327
 
          <Text>{\Font1}Enable networking</Text>
328
 
          <!--<Publish Property="PORT">NOT EnableNetworking</Publish>-->
329
 
          <Publish Property="SKIPNETWORKING" Value="--skip-networking">NOT EnableNetworking</Publish>
330
 
          <Publish Property="SKIPNETWORKING">EnableNetworking</Publish>
331
 
        </Control>
332
 
        <Control Id="LabelTCPPort" Type="Text" Height="17" Width="75" X="25" Y="142" Text="TCP port:" />
333
 
        <Control Id="Port" Type="MaskedEdit" X="104" Y="140" Width="28" Height="15" Property="PORT"  Sunken="yes" Text="[PortTemplate]">
334
 
          <Condition Action="enable" >EnableNetworking</Condition>
335
 
          <Condition Action="disable">Not EnableNetworking</Condition>
336
 
        </Control>
337
 
 
338
 
        <?if $(var.HaveInnodb) = "1" ?>
339
 
        <Control Id="CheckBoxStandardConfig" Type="CheckBox" Height="18" Width="220" X="9" Y="171" Property="STDCONFIG" CheckBoxValue="1">
340
 
          <Text>{\Font1}Optimize for transactions</Text>
341
 
        </Control>
342
 
 
343
 
        <Control Id="StandardConfigExplain" Type="Text" X="25" Y="190" Width="270" Height="14" TabSkip="yes">
344
 
          <Text>(Uses transactional storage engine and "strict" SQL mode)</Text>
345
 
          <Condition Action="enable" >STDCONFIG</Condition>
346
 
          <Condition Action="disable">Not STDCONFIG</Condition>
347
 
        </Control>
348
 
        <Control Id="LabelInnodbBufferpool" Type="Text" Height="17" Width="77" X="25" Y="210" Text="Buffer pool size:" >
349
 
        <Condition Action="enable" >STDCONFIG</Condition>
350
 
          <Condition Action="disable">Not STDCONFIG</Condition>
351
 
        </Control>
352
 
        <Control Id="BPSize" Type="MaskedEdit" X="104" Y="208" Width="40" Height="15" Property="BUFFERPOOLSIZE"  Sunken="yes" Text="[BufferPoolSizeTemplate]">
353
 
          <Condition Action="enable" >STDCONFIG</Condition>
354
 
          <Condition Action="disable">Not STDCONFIG</Condition>
355
 
        </Control>
356
 
        <Control Id="LabelMB" Type="Text" Height="17" Width="15" X="150" Y="210" Text="MB" >
357
 
        <Condition Action="enable" >STDCONFIG</Condition>
358
 
          <Condition Action="disable">Not STDCONFIG</Condition>
359
 
        </Control>
360
 
       <?endif?>
361
 
 
362
 
        <!-- Navigation buttons-->
363
 
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;Back">
364
 
          <Publish Event="NewDialog" Value="UserSettingsDlg">1</Publish>
365
 
        </Control>
366
 
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="no" Text="&amp;Next">
367
 
          <Publish Property="SERVICENAME">NOT InstallService</Publish>
368
 
          <Publish Property="WarningText" Value="Please enter valid port or uncheck 'Enable Networking' checkbox">
369
 
            <![CDATA[EnableNetworking AND NOT PORT AND NOT WarningText]]>
370
 
          </Publish>
371
 
          <Publish Property="WarningText" Value="Please enter valid service name port or uncheck 'Install Service' checkbox">
372
 
            <![CDATA[InstallService AND NOT SERVICENAME AND NOT WarningText]]>
373
 
          </Publish>
374
 
          <Publish Event="DoAction" Value="CheckDatabaseProperties">NOT WarningText</Publish>
375
 
          <Publish Event="SpawnDialog" Value="WarningDlg">WarningText</Publish>
376
 
          <Publish Event="NewDialog" Value="Feedback">Not WarningText</Publish>
377
 
        </Control>
378
 
        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="no" Text="Cancel">
379
 
          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
380
 
        </Control>
381
 
        <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
382
 
        <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
383
 
          <Text>[ProductName] database configuration</Text>
384
 
        </Control>
385
 
        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="2" />
386
 
        <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
387
 
          <Text>{\WixUI_Font_Title}Default instance properties</Text>
388
 
        </Control>
389
 
        <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="2" />
390
 
      </Dialog>
391
 
    </UI>
392
 
 
393
 
    <Property Id="CRLF" Value="&#xD;&#xA;" />
394
 
    <CustomAction Id="CheckDataDirectoryEmpty" BinaryKey="wixca.dll" DllEntry="CheckDataDirectoryEmpty" Execute="immediate" Impersonate="yes"/>
395
 
    <!--  What to do when navigation buttons are clicked -->
396
 
    <UI Id="MyWixUI_Mondo">
397
 
      <UIRef Id="WixUI_FeatureTree" />
398
 
      <UIRef Id="WixUI_ErrorProgressText" />
399
 
      <Publish Dialog="WelcomeDlg"  Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="999">
400
 
        OLDERVERSIONBEINGUPGRADED
401
 
      </Publish>
402
 
      <Publish Dialog="LicenseAgreementDlg"  Control="Next" Event="NewDialog" Value="NewOrUpgradeInstanceDlg" Order="999">
403
 
        NOT Installed AND UpgradableServiceFound
404
 
      </Publish>
405
 
 
406
 
      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="Feedback" Order="3" ><![CDATA[&DBInstance=3 AND NOT !DBInstance=3]]></Publish>
407
 
      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3"> <![CDATA[OLDERVERSIONBEINGUPGRADED <>""]]></Publish>
408
 
      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ConfirmDataCleanupDlg" Order="1" ><![CDATA[(&DBInstance=2) AND (!DBInstance=3)]]></Publish>
409
 
 
410
 
 
411
 
      <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="NewOrUpgradeInstanceDlg" Order="999">
412
 
        NOT Installed AND UpgradableServiceFound
413
 
      </Publish>
414
 
      <Publish Dialog="CustomizeDlg" Control="Next" Event="DoAction" Value="CheckDataDirectoryEmpty" Order="1"><![CDATA[&DBInstance=3 AND NOT !DBInstance=3]]></Publish>
415
 
      <Publish Dialog="CustomizeDlg" Property="DATADIRNOTEMPTY" Control="Next"  Order="1"><![CDATA[NOT(&DBInstance=3 AND NOT !DBInstance=3)]]></Publish>
416
 
      <Publish  Dialog="CustomizeDlg" Control="Next"  Property="WarningText" Order="2"
417
 
         Value="Selected data directory [DATADIR] is not empty. Either clean it, or choose another location for 'Database Instance' feature.">
418
 
        DATADIRNOTEMPTY
419
 
      </Publish>
420
 
      <Publish Dialog="CustomizeDlg" Control="Next" Event="SpawnDialog" Value="WarningDlg" Order="3">WarningText</Publish>
421
 
      <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ConfirmDataCleanupDlg" Order="4">
422
 
        <![CDATA[(&DBInstance=2) AND (!DBInstance=3)]]>
423
 
      </Publish>
424
 
      <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="UserSettingsDlg" Order="5">
425
 
        <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND NOT WarningText]]>
426
 
      </Publish>
427
 
 
428
 
      <Publish Dialog="ConfirmDataCleanupDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg">WixUI_InstallMode = "Change"</Publish>
429
 
      <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="ConfirmDataCleanupDlg" Order="999">
430
 
        !DBInstance=3 AND (CLEANUPDATA Or USECONFIRMDATACLEANUPDLG)
431
 
      </Publish>
432
 
      <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Property="USECONFIRMDATACLEANUPDLG" Value="1" Order="999">
433
 
        !DBInstance=3 AND CLEANUPDATA
434
 
      </Publish>
435
 
      <Publish Dialog="ConfirmDataCleanupDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">WixUI_InstallMode = "Remove"</Publish>
436
 
    </UI>
437
 
 
438
 
    <!-- End of UI section -->
439
 
 
440
 
    <!-- Extra folders we need (DATADIR and shortcut folder) -->
441
 
    <DirectoryRef Id='INSTALLDIR'>
442
 
      <Directory Id="DATADIR" Name="data">
443
 
      </Directory>
444
 
      <Directory Id="ProgramMenuFolder">
445
 
        <Directory Id="ShortcutFolder" Name="@CPACK_WIX_PACKAGE_NAME@">
446
 
        </Directory>
447
 
      </Directory>
448
 
    </DirectoryRef>
449
 
 
450
 
 
451
 
    <!-- Extra feature (database instance). This could be split to several subfeatures if desired (e.g firewall exception)-->
452
 
    <Feature Id='DBInstance'
453
 
         Title='Database instance'
454
 
         Description=
455
 
             'Install database instance. Only new database can be installed with this feature.'
456
 
         ConfigurableDirectory='DATADIR'
457
 
         AllowAdvertise='no'
458
 
         Level='1'>
459
 
 
460
 
      <!-- Data directory with some reasonable security settings -->
461
 
      <Component Id="C.datadir" Guid="*" Directory="DATADIR">
462
 
        <RegistryValue Root='HKLM'
463
 
           Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
464
 
           Name='DATADIR' Value='[DATADIR]' Type='string' KeyPath='yes'/>
465
 
        <CreateFolder>
466
 
          <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
467
 
          <util:PermissionEx User="NetworkService" GenericAll="yes" />
468
 
        </CreateFolder>
469
 
      </Component>
470
 
 
471
 
      <!-- Database service conditioned on SERVICENAME property-->
472
 
      <Component Id="C.service" Guid="*" Directory="DATADIR">
473
 
        <Condition>SERVICENAME</Condition>
474
 
        <RegistryValue Root='HKLM'
475
 
           Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
476
 
           Name='SERVICENAME' Value='[SERVICENAME]' Type='string' KeyPath='yes'/>
477
 
        <ServiceControl Id='DBInstanceServiceStop' Name='[SERVICENAME]'  Stop='both' Remove='uninstall' Wait='yes'/>
478
 
        <ServiceControl Id='DBInstanceServiceStart' Name='[SERVICENAME]' Start='install' Wait='yes'/>
479
 
      </Component>
480
 
      <?if $(var.HaveInnodb) = "1" ?>
481
 
      <Component Id="C.myiniconfig" Guid="*" Directory="DATADIR">
482
 
      <Condition>STDCONFIG</Condition>
483
 
        <RegistryValue Root='HKLM'
484
 
           Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
485
 
           Name='STDCONFIG' Value='1' Type='string' KeyPath='yes'/>
486
 
        <IniFile Id="Ini1"
487
 
            Action="createLine"
488
 
            Directory="DATADIR"
489
 
            Section="mysqld"
490
 
            Name="my.ini"
491
 
            Key="sql_mode"
492
 
            Value="&quot;STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION&quot;" />
493
 
        <IniFile Id="Ini2"
494
 
            Action="createLine"
495
 
            Directory="DATADIR"
496
 
            Section="mysqld"
497
 
            Name="my.ini"
498
 
            Key="default_storage_engine"
499
 
            Value="innodb" />
500
 
        <IniFile Id="Ini3"
501
 
            Action="createLine"
502
 
            Directory="DATADIR"
503
 
            Section="mysqld"
504
 
            Name="my.ini"
505
 
            Key="innodb_buffer_pool_size"
506
 
            Value="[BUFFERPOOLSIZE]M" />
507
 
        <IniFile Id="Ini4"
508
 
            Action="createLine"
509
 
            Directory="DATADIR"
510
 
            Section="mysqld"
511
 
            Name="my.ini"
512
 
            Key="innodb_log_file_size"
513
 
            Value="[LOGFILESIZE]M" />
514
 
      </Component>
515
 
      <?endif?>
516
 
     
517
 
      <Component Id="C.feedback" Guid="*" Directory="DATADIR">
518
 
        <Condition>FEEDBACK</Condition>
519
 
        <RegistryValue Root='HKLM'
520
 
           Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
521
 
           Name='FEEDBACK' Value='1' Type='string' KeyPath='yes'/>
522
 
        <IniFile Id="Ini5"
523
 
            Action="createLine"
524
 
            Directory="DATADIR"
525
 
            Section="mysqld"
526
 
            Name="my.ini"
527
 
            Key="feedback"
528
 
            Value="ON" />
529
 
      </Component>
530
 
 
531
 
      <Component Id="C.utf8" Guid="*" Directory="DATADIR">
532
 
        <Condition>UTF8</Condition>
533
 
        <RegistryValue Root='HKLM'
534
 
           Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
535
 
           Name='UTF8' Value='1' Type='string' KeyPath='yes'/>
536
 
        <IniFile Id="Ini6"
537
 
            Action="createLine"
538
 
            Directory="DATADIR"
539
 
            Section="mysqld"
540
 
            Name="my.ini"
541
 
            Key="character-set-server"
542
 
            Value="utf8" />
543
 
      </Component>
544
 
 
545
 
      <!--- Grant service account permission to the database folder (Windows 7 and later) -->
546
 
      <Component Id="C.serviceaccount.permission" Guid="*" Directory='DATADIR' Transitive='yes'>
547
 
        <Condition><![CDATA[SERVICENAME AND (VersionNT > 600)]]></Condition>
548
 
        <RegistryValue Root='HKLM'
549
 
             Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
550
 
             Name='servicepermission' Value='1' Type='string' KeyPath='yes'/>
551
 
        <CreateFolder>
552
 
          <util:PermissionEx User="NT SERVICE\[SERVICENAME]" GenericAll="yes" />
553
 
        </CreateFolder>
554
 
      </Component>
555
 
 
556
 
      <!-- Shortcuts in program menu (mysql client etc) -->
557
 
      <Component Id="c.shortcuts" Guid="*" Directory="ShortcutFolder">
558
 
        <!-- shortcut to my.ini-->
559
 
        <RegistryValue  Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall" Name="shortcuts" Value="1" Type="string" KeyPath="yes"  />
560
 
        <RemoveFolder Id="RemoveShorcutFolder" On="uninstall" />
561
 
        <Shortcut Id="shortcut.my.ini"
562
 
          Name="my.ini (@CPACK_WIX_PACKAGE_NAME@)"
563
 
          Target="[System64Folder]notepad.exe"
564
 
          Arguments="&quot;[DATADIR]my.ini&quot;"
565
 
          Directory="ShortcutFolder"
566
 
          Description="Edit database configuration" />
567
 
        <Shortcut Id="shortcut.errorlog"
568
 
          Name="Error log (@CPACK_WIX_PACKAGE_NAME@)"
569
 
          Target="[System64Folder]notepad.exe"
570
 
          Arguments="&quot;[DATADIR][ComputerName].err&quot;"
571
 
          Directory="ShortcutFolder"
572
 
          Description="View Database Error log" />
573
 
        <Shortcut Id="shortcut.dbfolder" Name="Database directory (@CPACK_WIX_PACKAGE_NAME@)"
574
 
          Target="[DATADIR]" />
575
 
      </Component>
576
 
 
577
 
      <!-- add reference so mysql client won't get uninstalled and we have a shortcut pointing to nowhere-->
578
 
      <ComponentRef Id="C.bin.mysql.exe"/>
579
 
 
580
 
      <Component Id="c.shortcuts.commandline" Guid="*" Directory="ShortcutFolder">
581
 
        <RegistryValue
582
 
          Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall"
583
 
          Name="shortcuts.commandline"
584
 
          Value="1" Type="string" KeyPath="yes" />
585
 
        <!-- shortcut to client-->
586
 
        <Shortcut Id="shortcut.mysql.exe"
587
 
          Name="MySQL Client (@CPACK_WIX_PACKAGE_NAME@)"
588
 
          Target="[System64Folder]cmd.exe"
589
 
          Arguments="/k &quot; &quot;[D.bin]mysql.exe&quot; &quot;--defaults-file=[DATADIR]my.ini&quot; -uroot -p&quot;"
590
 
          Directory="ShortcutFolder"
591
 
          WorkingDirectory="D.bin"
592
 
          Description="Starts mysql.exe for root user"  />
593
 
      </Component>
594
 
      <Component Id="c.shortcuts.commandprompt.db"  Guid="*"  Directory="ShortcutFolder" Transitive="yes">
595
 
        <Condition>SERVICENAME</Condition>
596
 
        <RegistryValue
597
 
        Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall"
598
 
        Name="shortcuts.commandprompt.db"
599
 
        Value="1" Type="string" KeyPath="yes" />
600
 
        <!-- just command prompt in the bin directory (so all utilities can be called) -->
601
 
        <Shortcut Id="shortcut.commandprompt.exe.db"
602
 
          Name="Command Prompt (@CPACK_WIX_PACKAGE_NAME@)"
603
 
          Target="[System64Folder]cmd.exe"
604
 
          Directory="ShortcutFolder"
605
 
          Arguments="/k  &quot;set MYSQL_HOME=[DATADIR]&amp;&amp; set PATH=[D.bin];%PATH%;&amp;&amp;echo Setting environment for [ProductName] &quot;"
606
 
          Description="Opens command line in the installation bin directory" />
607
 
      </Component>
608
 
 
609
 
 
610
 
    </Feature>
611
 
 
612
 
    <Feature Id="SharedClientServerComponents"
613
 
      Title='Utilities used by both server and client.'
614
 
      Description=
615
 
      'Client utilities that are also used with server.Required for upgrade.'
616
 
      ConfigurableDirectory='INSTALLDIR'
617
 
      AllowAdvertise='no'
618
 
      Level='1'
619
 
      Display='hidden'>
620
 
      <ComponentRef Id='C.bin.mysql.exe'/>
621
 
      <ComponentRef Id='C.bin.mysqladmin.exe'/>
622
 
      <ComponentRef Id='C.bin.mysql_upgrade.exe'/>
623
 
      <ComponentRef Id='C.bin.mysqlcheck.exe'/>
624
 
      <Component Id="c.shortcuts.commandprompt.nodb"  Guid="*"  Directory="ShortcutFolder" Transitive="yes">
625
 
        <Condition>NOT SERVICENAME</Condition>
626
 
        <RegistryValue
627
 
          Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall"
628
 
          Name="shortcuts.commandprompt.nodb"
629
 
          Value="1" Type="string" KeyPath="yes" />
630
 
        <!-- just command prompt in the bin directory (so all utilities can be called) -->
631
 
        <Shortcut Id="shortcut.commandprompt.exe.nodb"
632
 
          Name="Command Prompt (@CPACK_WIX_PACKAGE_NAME@)"
633
 
          Target="[System64Folder]cmd.exe"
634
 
          Directory="ShortcutFolder"
635
 
          Arguments="/k  &quot;set PATH=[D.bin];%PATH%;&amp;&amp;echo Setting environment for [ProductName] &quot;"
636
 
          Description="Opens command line in the installation bin directory" />
637
 
      </Component>
638
 
     <?if $(var.HaveUpgradeWizard) != "0" ?>
639
 
     <ComponentRef Id='C.bin.mysql_upgrade_wizard.exe'/>
640
 
     <!--
641
 
     <Component Id="c.shortcuts.upgrade_wizard"  Guid="*"  Directory="ShortcutFolder" Transitive="yes">
642
 
       <RegistryValue
643
 
       Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall"
644
 
       Name="shortcuts.upgrade_wizard"
645
 
       Value="1" Type="string" KeyPath="yes" />
646
 
      <Shortcut Id="shortcut.upgrade_wizard"
647
 
        Name="Upgrade Wizard (@CPACK_WIX_PACKAGE_NAME@)"
648
 
       Target="[INSTALLDIR]bin\mysql_upgrade_wizard.exe"
649
 
       Directory="ShortcutFolder"
650
 
       Description="Upgrades older instances of MariaDB/MySQL services to version @MAJOR_VERSION@.@MINOR_VERSION@"  
651
 
       Advertise="no"/>
652
 
     </Component>
653
 
     -->
654
 
     <?endif?>
655
 
    </Feature>
656
 
 
657
 
    <!-- Optional 3rd party tools -->
658
 
    <DirectoryRef Id='TARGETDIR'>
659
 
     <Directory Id='CommonFilesFolder'>
660
 
       <Directory Id='MariaDBShared' Name='MariaDBShared'/>
661
 
     </Directory>
662
 
     <Directory Id='DesktopFolder'/>
663
 
     </DirectoryRef>
664
 
 
665
 
 
666
 
    <?if "@WITH_THIRD_PARTY@" != "" ?>
667
 
 
668
 
    <!-- Include definition of 3party components -->
669
 
    <?foreach tool in @WITH_THIRD_PARTY@ ?>
670
 
     <?include "${CMAKE_CURRENT_BINARY_DIR}\$(var.tool).wxi" ?>
671
 
    <?endforeach ?>
672
 
 
673
 
    <Feature Id="ThirdPartyTools"
674
 
      Title='Third party tools'
675
 
      Description= 'Third party tools'
676
 
      AllowAdvertise='no'
677
 
      Level='1'
678
 
      Display='expand'>
679
 
    @THIRD_PARTY_FEATURE_CONDITION@
680
 
    <!-- Include definition of 3rd party features -->
681
 
    <?foreach tool in @WITH_THIRD_PARTY@ ?>
682
 
     <?include "${CMAKE_CURRENT_BINARY_DIR}\$(var.tool)_feature.wxi" ?>
683
 
    <?endforeach ?>
684
 
 
685
 
   </Feature>
686
 
   
687
 
   <?endif ?>
688
 
   
689
 
    <!--  Custom action, call mysql_install_db  -->
690
 
    <SetProperty  Sequence='execute'  Before='CreateDatabaseCommand' Id="SKIPNETWORKING"  Value="--skip-networking" >SKIPNETWORKING</SetProperty>
691
 
    <SetProperty Sequence='execute'  Before='CreateDatabaseCommand'  Id="ALLOWREMOTEROOTACCESS" Value="--allow-remote-root-access">ALLOWREMOTEROOTACCESS</SetProperty>
692
 
    <SetProperty Sequence='execute'  Before='CreateDatabaseCommand' Id="DEFAULTUSER" Value="--default-user">DEFAULTUSER</SetProperty>
693
 
    <CustomAction Id='CheckDatabaseProperties' BinaryKey='wixca.dll' DllEntry='CheckDatabaseProperties' />
694
 
    <CustomAction Id='PresetDatabaseProperties' BinaryKey='wixca.dll' DllEntry='PresetDatabaseProperties' />
695
 
    <CustomAction Id="CreateDatabaseCommand" Property="CreateDatabase"
696
 
    Value=
697
 
    "&quot;[#F.bin.mysql_install_db.exe]&quot;  &quot;--service=[SERVICENAME]&quot; --port=[PORT] &quot;--password=[ESCAPEDPASSWORD]&quot; &quot;--datadir=[DATADIR]\&quot; [SKIPNETWORKING] [ALLOWREMOTEROOTACCESS] [DEFAULTUSER] --verbose-bootstrap"
698
 
     Execute="immediate"
699
 
     HideTarget="yes"
700
 
     />
701
 
    <CustomAction Id="CreateDatabaseRollbackCommand" Property="CreateDatabaseRollback"
702
 
        Value="[SERVICENAME]\[DATADIR]"
703
 
        Execute="immediate"/>
704
 
    <CustomAction Id="CreateDatabase" BinaryKey="WixCA" DllEntry="CAQuietExec"
705
 
            Execute="deferred" Return="check" Impersonate="no" />
706
 
    <CustomAction Id="CreateDatabaseRollback" BinaryKey="wixca.dll" DllEntry="CreateDatabaseRollback"
707
 
        Execute="rollback" Return="check" Impersonate="no"/>
708
 
    <UI>
709
 
      <ProgressText Action="CreateDatabase">Running mysql_install_db.exe</ProgressText>
710
 
    </UI>
711
 
 
712
 
    <!-- Error injection script activated by TEST_FAIL=1 passed to msiexec (to see how good custom action rollback works)  -->
713
 
    <Property Id="FailureProgram">
714
 
      <![CDATA[
715
 
         Function Main()
716
 
         Main = 3
717
 
         End Function
718
 
         ]]>
719
 
    </Property>
720
 
    <CustomAction Id="FakeFailure"
721
 
     VBScriptCall="Main"
722
 
     Property="FailureProgram"
723
 
     Execute="deferred" />
724
 
 
725
 
    <CustomAction Id='ErrorDataDirNotEmpty' 
726
 
                  Error='Chosen data directory [DATADIR] is not empty. It must be empty prior to installation.'/>
727
 
    <InstallExecuteSequence>
728
 
      <Custom Action="CheckDataDirectoryEmpty" After="CostFinalize">
729
 
        <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED=""]]>
730
 
      </Custom>
731
 
      <Custom Action="ErrorDataDirNotEmpty" After="CheckDataDirectoryEmpty" >DATADIRNOTEMPTY</Custom>
732
 
      <Custom Action="CheckDatabaseProperties" Before="CreateDatabaseCommand">SERVICENAME</Custom>
733
 
      <Custom Action="CreateDatabaseCommand" After="CostFinalize" >
734
 
        <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED=""]]>
735
 
      </Custom>
736
 
      <Custom Action="CreateDatabase" After="InstallFiles">
737
 
        <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED=""]]>
738
 
      </Custom>
739
 
      <Custom Action="CreateDatabaseRollbackCommand" After="CostFinalize">
740
 
        <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED=""]]>
741
 
      </Custom>
742
 
      <Custom Action="CreateDatabaseRollback" Before="CreateDatabase">
743
 
        <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED=""]]>
744
 
      </Custom>
745
 
      <Custom Action='FakeFailure' Before='InstallFinalize'>
746
 
        <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED="" AND TESTFAIL]]>
747
 
      </Custom>
748
 
    </InstallExecuteSequence>
749
 
 
750
 
 
751
 
    <!-- Custom action to remove data on uninstall  -->
752
 
    <Binary Id='wixca.dll' SourceFile='@WIXCA_LOCATION@' />
753
 
    <CustomAction Id="RemoveDataDirectory.SetProperty" Return="check" 
754
 
                  Property="RemoveDataDirectory" Value="[DATADIR]" />
755
 
    <CustomAction Id="RemoveDataDirectory"  BinaryKey="wixca.dll"
756
 
                  DllEntry="RemoveDataDirectory"
757
 
                  Execute="deferred"
758
 
                  Impersonate="no"
759
 
                  Return="ignore"   />
760
 
    <InstallExecuteSequence>
761
 
      <Custom Action="RemoveDataDirectory.SetProperty" After="CreateDatabaseCommand" >
762
 
        <![CDATA[($C.datadir=2) AND (CLEANUPDATA) AND NOT UPGRADINGPRODUCTCODE]]>
763
 
      </Custom>
764
 
      <Custom Action="RemoveDataDirectory" Before="RemoveFiles">
765
 
        <![CDATA[($C.datadir=2) AND (CLEANUPDATA) AND NOT UPGRADINGPRODUCTCODE]]>
766
 
      </Custom>
767
 
    </InstallExecuteSequence>
768
 
 
769
 
    <InstallExecuteSequence>
770
 
      <StopServices>SERVICENAME</StopServices>
771
 
      <DeleteServices>SERVICENAME</DeleteServices>
772
 
    </InstallExecuteSequence>
773
 
    <CustomAction Id="CheckDBInUse" Return="ignore" 
774
 
                  BinaryKey="wixca.dll" DllEntry="CheckDBInUse"  Execute="firstSequence"/>
775
 
    <InstallExecuteSequence>
776
 
      <Custom Action="CheckDBInUse" Before="LaunchConditions">Installed</Custom>
777
 
      <Custom Action="PresetDatabaseProperties" After="CheckDBInUse"></Custom>
778
 
    </InstallExecuteSequence>
779
 
    <InstallUISequence>
780
 
      <Custom Action="CheckDBInUse" Before="LaunchConditions">Installed</Custom>
781
 
      <Custom Action="PresetDatabaseProperties" After="CheckDBInUse"></Custom>
782
 
    </InstallUISequence>
783
 
 
784
 
    <!-- Store some properties persistently in registry, mainly for upgrades -->
785
 
 
786
 
    <Feature Id='StoreInstallLocation' Level='1' Absent='disallow' Display='hidden'>
787
 
      <Component Directory='INSTALLDIR' Guid='*' Id='C.storeinstalllocation'>
788
 
        <RegistryValue Root='HKLM' Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@' 
789
 
                       Name='INSTALLDIR' Value='[INSTALLDIR]' Type='string'  KeyPath='yes'/>
790
 
      </Component>
791
 
    </Feature>
792
 
 
793
 
    <?foreach STOREDVAR in SERVICENAME;DATADIR;INSTALLDIR?>
794
 
 
795
 
    <Property Id='$(var.STOREDVAR)' Secure='yes'>
796
 
      <RegistrySearch Id='$(var.STOREDVAR)Property' Root='HKLM'
797
 
                      Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
798
 
                      Name='$(var.STOREDVAR)' Type='raw' />
799
 
    </Property>
800
 
    <CustomAction Id='SaveCmdLineValue_$(var.STOREDVAR)' Property='CMDLINE_$(var.STOREDVAR)'
801
 
              Value='[$(var.STOREDVAR)]' Execute='firstSequence' />
802
 
    <CustomAction Id='SetFromCmdLineValue_$(var.STOREDVAR)' Property='$(var.STOREDVAR)' 
803
 
                  Value='[CMDLINE_$(var.STOREDVAR)]' Execute='firstSequence' />
804
 
    <InstallUISequence>
805
 
      <Custom Action='SaveCmdLineValue_$(var.STOREDVAR)' Before='AppSearch' />
806
 
      <Custom Action='SetFromCmdLineValue_$(var.STOREDVAR)' After='AppSearch'>CMDLINE_$(var.STOREDVAR)</Custom>
807
 
    </InstallUISequence>
808
 
    <InstallExecuteSequence>
809
 
      <Custom Action='SaveCmdLineValue_$(var.STOREDVAR)' Before='AppSearch' />
810
 
      <Custom Action='SetFromCmdLineValue_$(var.STOREDVAR)' After='AppSearch'>CMDLINE_$(var.STOREDVAR)</Custom>
811
 
    </InstallExecuteSequence>
812
 
 
813
 
    <?endforeach?>
814
 
 
815
 
    <!-- 
816
 
      Optionally, start upgrade wizard on exit.
817
 
    -->
818
 
    
819
 
 
820
 
    
821
 
    <?if $(var.HaveUpgradeWizard) != "0" ?>
822
 
    <UI>
823
 
      <Publish Dialog="ExitDialog"
824
 
          Control="Finish"
825
 
          Event="DoAction"
826
 
          Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
827
 
    </UI>
828
 
    <Property 
829
 
      Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" 
830
 
      Value="Launch wizard to upgrade existing MariaDB or MySQL services." />
831
 
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="0"/>
832
 
    <Property Id="WixShellExecTarget" Value="[#F.bin.mysql_upgrade_wizard.exe]" />
833
 
    <CustomAction Id="LaunchApplication"
834
 
        BinaryKey="WixCA"
835
 
        DllEntry="WixShellExec"
836
 
        Impersonate="yes" />
837
 
    <CustomAction 
838
 
      Id="CheckServiceUpgrades"   Return="ignore" BinaryKey="wixca.dll" 
839
 
      DllEntry="CheckServiceUpgrades"
840
 
      Execute="immediate" />
841
 
    <InstallUISequence>
842
 
      <Custom Action="CheckServiceUpgrades" After="CostFinalize">
843
 
        $C.bin.mysql_upgrade_wizard.exe = 3 AND NOT Installed AND NOT OLDERVERSIONBEINGUPGRADED
844
 
      </Custom>
845
 
    </InstallUISequence>
846
 
    <SetProperty Before="ExecuteAction" Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" 
847
 
       Sequence="ui"  Value="[NonExistentProperty]">
848
 
      <![CDATA[($C.bin.mysql_upgrade_wizard.exe <> 3) AND NOT Installed OR OLDERVERSIONBEINGUPGRADED]]>
849
 
    </SetProperty>
850
 
    <SetProperty Before="ExecuteAction" Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" 
851
 
       Sequence="ui"  Value="[NonExistentProperty]">
852
 
      <![CDATA[($C.bin.mysql_upgrade_wizard.exe <> 3) AND NOT Installed OR OLDERVERSIONBEINGUPGRADED]]>
853
 
    </SetProperty>
854
 
    
855
 
    <?endif ?> <!-- HaveUpgradeWizard -->
856
 
 
857
 
    <!-- 
858
 
      Author the registry entries for "add or remove programs" 
859
 
      We choose to define ARPSYSTEMCOMPONENT to 1 because we want to show 
860
 
      "do you want to remove data directory" on uninstall
861
 
    -->
862
 
    <Property Id="ARPSYSTEMCOMPONENT" Value="1" Secure="yes" />
863
 
    <Property Id="ARPINSTALLLOCATION" Secure="yes"/>
864
 
    <SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="InstallValidate"  Sequence="execute"/>
865
 
    <Feature Id='ARPRegistryEntries'
866
 
          Title='Add or remove program entries'
867
 
          Description='Add or remove program entries'
868
 
          AllowAdvertise='no'
869
 
          Absent='disallow'  Display='hidden'
870
 
          Level='1'>
871
 
      <Component Id="C.arp_entries" Guid="*" Directory="INSTALLDIR">
872
 
        <RemoveFolder Id="RemoveINSTALLDIR" On="uninstall"/>
873
 
        <RegistryValue Root='HKLM'
874
 
           Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_WIX_PACKAGE_NAME@'
875
 
           Name='DisplayName' Value='[ProductName]' Type='string' KeyPath='yes'/>
876
 
        <RegistryValue Root='HKLM'
877
 
          Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_WIX_PACKAGE_NAME@'
878
 
          Name='Publisher' Value='@MANUFACTURER@' Type='string'/>
879
 
        <RegistryValue Root='HKLM'
880
 
          Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_WIX_PACKAGE_NAME@'
881
 
          Name='DisplayVersion' Value='[ProductVersion]' Type='string'/>
882
 
        <RegistryValue Root='HKLM'
883
 
          Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_WIX_PACKAGE_NAME@'
884
 
          Name='InstallLocation' Value='[INSTALLDIR]' Type='string'/>
885
 
        <RegistryValue Root='HKLM'
886
 
          Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_WIX_PACKAGE_NAME@'
887
 
          Name='UninstallString' Value='msiexec.exe /I [ProductCode]' Type='string'/>
888
 
        <RegistryValue Root='HKLM'
889
 
          Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_WIX_PACKAGE_NAME@'
890
 
          Name='MajorVersion' Value='@MAJOR_VERSION@' Type='string'/>
891
 
        <RegistryValue Root='HKLM'
892
 
          Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_WIX_PACKAGE_NAME@'
893
 
          Name='MinorVersion' Value='@MINOR_VERSION@' Type='string'/>
894
 
      </Component>
895
 
    </Feature>
896
 
 
897
 
    <!-- Extra condition to block the installer if NSIS based installation is detected-->
898
 
    <Property Id="NSISINSTALLKEY">
899
 
      <RegistrySearch Id='NSISKey' Type='raw'
900
 
        Root='HKLM' Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\MariaDB' Name='DisplayName' />
901
 
    </Property>
902
 
    <Condition
903
 
      Message=
904
 
      'Previous version of MariaDB was found, that used incompatible installer.&#xD;&#xA;Please remove &quot;[NSISINSTALLKEY]&quot; before you proceed with this installation.'
905
 
      >
906
 
      <![CDATA[ NOT(NSISINSTALLKEY << "MariaDB @MAJOR_VERSION@.@MINOR_VERSION@.") OR Installed]]>
907
 
    </Condition>
908
 
    <Condition Message=
909
 
       'Setting the ALLUSERS property is not allowed because [ProductName] is a per-machine application. Setup will now exit.'>
910
 
      <![CDATA[ALLUSERS = "1"]]>
911
 
    </Condition>
912
 
  </Fragment>
913
 
</Wix>
 
1
<?xml version="1.0" encoding="utf-8"?>
 
2
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"  xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
 
3
  <Fragment>
 
4
    <!--
 
5
      Check, if upgrade wizard was built 
 
6
      It currently requires MFC, which is not in SDK 
 
7
      neither in express edítions of VS.
 
8
    -->
 
9
    <?ifndef HaveUpgradeWizard ?>
 
10
      <?define HaveUpgradeWizard="1"?>
 
11
    <?endif?>
 
12
 
 
13
    <!-- If Innodb is compiled in, enable "optimize for transactions" checkbox -->
 
14
    <?ifndef HaveInnodb ?>
 
15
      <?define HaveInnodb="0"?>
 
16
    <?endif?>
 
17
 
 
18
    <Property Id="PortTemplate" Value="#####" />
 
19
    <?if $(var.HaveInnodb) = "1" ?>
 
20
      <Property Id="BufferPoolSizeTemplate" Value="#######" />
 
21
    <?endif?>
 
22
    <!--
 
23
      Installation parameters that can be passed via msiexec command line
 
24
      For "booleans" (like skip networking), just providing any value means property set to "yes".
 
25
    -->
 
26
    <!-- instalation directory (default under program files)-->
 
27
    <!--- (defined elsewhere) <Property Id="INSTALLDIR" Secure="yes" /> -->
 
28
 
 
29
    <!-- Database data directory (default under INSTALLDIR\data) -->
 
30
    <!--- (defined elsewhere) <Property Id="DATADIR" Secure="yes"/> -->
 
31
 
 
32
    <!-- Service name of database instanced (default MySQL in GUI, nothing with command line) -->
 
33
    <!--  (defined elsewhere) <Property Id="SERVICENAME" Secure="yes" /> -->
 
34
 
 
35
    <!-- Root password -->
 
36
    <Property Id="PASSWORD" Hidden="yes" Secure="yes" />
 
37
    <Property Id="ESCAPEDPASSWORD" Hidden="yes" Secure="yes" />
 
38
    <!-- Database port -->
 
39
    <Property Id="PORT" Value="3306" Secure="yes"/>
 
40
    <!-- Whether to allow remote access for root user -->
 
41
    <Property Id="ALLOWREMOTEROOTACCESS" Secure="yes" />
 
42
    <!-- Skip networking. This will switch configuration to use named pipe-->
 
43
    <Property Id="SKIPNETWORKING" Secure="yes"/>
 
44
    <!-- Whether to keep default (unauthenticated) user. Default is no-->
 
45
    <Property Id="DEFAULTUSER" Secure="yes"/>
 
46
    <!-- Set server character set to UTF8 -->
 
47
    <Property Id="UTF8" Secure="yes"/>
 
48
    <!-- Whether to data on uninstall (default yes, after asking user consent) -->
 
49
    <Property Id="CLEANUPDATA" Secure="yes" Value="1"/>
 
50
    <!-- Force per machine installation -->
 
51
    <Property Id="ALLUSERS" Secure="yes" Value="1"/>
 
52
    <!-- Disable advertised shortcuts weirdness -->
 
53
    <Property Id="DISABLEADVTSHORTCUTS" Secure="yes" Value="1"/>
 
54
 
 
55
    <!-- Activate feedback plugin-->
 
56
    <Property Id="FEEDBACK" Secure="yes"/>
 
57
 
 
58
    <?if $(var.HaveInnodb) = "1" ?>
 
59
      <!-- Quick configuration : set default storage engine to innodb, use strict sql_mode -->
 
60
      <Property Id="STDCONFIG" Secure="yes" Value="1"/>
 
61
    <?endif?>
 
62
    <!-- Innodb Buffer pool size in MB-->
 
63
    <Property Id="BUFFERPOOLSIZE" Secure="yes"/>
 
64
 
 
65
 
 
66
    <CustomAction Id="LaunchUrl" BinaryKey="WixCA" DllEntry="WixShellExec"  Execute="immediate" Return="check" Impersonate="yes" />
 
67
 
 
68
 
 
69
    <!-- 
 
70
      User interface dialogs 
 
71
     -->
 
72
    <WixVariable Id='WixUIBannerBmp' Value='@CMAKE_CURRENT_SOURCE_DIR@\WixUIBannerBmp.jpg' />
 
73
    <WixVariable Id='WixUIDialogBmp' Value='@CMAKE_CURRENT_SOURCE_DIR@\WixUIDialogBmp.jpg' />
 
74
    <UI>
 
75
 
 
76
      <!-- Dialog on uninstall of the database -->
 
77
      <Dialog Id="ConfirmDataCleanupDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
 
78
 
 
79
        <!--<Control Id="CleanupDataCheckBox" Type="CheckBox" X="20" Y="100" Height="30" Property="CLEANUPDATA" Width="300" CheckBoxValue="1"
 
80
                Text="{\Font1}Remove default database directory &#xD;&#xA;'[DATADIR]'"/>
 
81
                -->
 
82
        <Control Id="RemoveDatadirButton" Type="PushButton" X="40" Y="65" Width="80" Height="18"
 
83
                  Text="Remove data">
 
84
          <Publish Property="CLEANUPDATA" Value="1">1</Publish>
 
85
          <Publish Event="NewDialog" Value="VerifyReadyDlg">WixUI_InstallMode</Publish>
 
86
          <Publish Event="EndDialog" Value="Return">NOT WixUI_InstallMode</Publish>
 
87
 
 
88
        </Control>
 
89
        <Control Id="RemoveDatadirText" Type="Text" X="60" Y="85" Width="280" Height="20">
 
90
          <Text>Remove default database directory [DATADIR]. Ensures proper cleanup on uninstall.</Text>
 
91
        </Control>
 
92
 
 
93
        <Control Id="KeepDatadirButton" Type="PushButton" X="40" Y="118" Width="80" Height="18"
 
94
                 Text="Keep data">
 
95
          <Publish Property="CLEANUPDATA">1</Publish>
 
96
          <Publish Event="NewDialog" Value="VerifyReadyDlg">WixUI_InstallMode</Publish>
 
97
          <Publish Event="EndDialog" Value="Return">NOT WixUI_InstallMode</Publish>
 
98
        </Control>
 
99
        <Control Id="KeepDataDirText" Type="Text" X="60" Y="138" Width="280" Height="70" >
 
100
          <Text>Do not remove [DATADIR]. Choose this option if you intend to use data in the future</Text>
 
101
        </Control>
 
102
 
 
103
 
 
104
        <!-- Navigation buttons-->
 
105
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;Back">
 
106
          <Publish Event="NewDialog" Value="CustomizeDlg">WixUI_InstallMode="Change"</Publish>
 
107
          <Condition Action="disable">NOT WixUI_InstallMode</Condition>
 
108
        </Control>
 
109
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Disabled="yes" Text="&amp;Next">
 
110
          <Publish Event="NewDialog" Value="VerifyReadyDlg">WixUI_InstallMode</Publish>
 
111
          <Publish Event="EndDialog" Value="Return">NOT WixUI_InstallMode</Publish>
 
112
        </Control>
 
113
        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
 
114
          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
 
115
        </Control>
 
116
        <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
 
117
        <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
 
118
          <Text>Remove default [ProductName] database</Text>
 
119
        </Control>
 
120
        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
 
121
        <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
 
122
          <Text>{\WixUI_Font_Title}Default instance properties</Text>
 
123
        </Control>
 
124
        <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
 
125
      </Dialog>
 
126
 
 
127
      <!-- Dialog new or upgrade instance -->
 
128
 
 
129
      <Property Id="CreateOrUpgradeChoice" Value="Create"/>
 
130
      
 
131
      <Dialog Id="NewOrUpgradeInstanceDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
 
132
        <Control Id="Text" Type="Text" X="40" Y="65" Width="270" Height="30">
 
133
          <Text>Setup found existing database instances that can be upgraded to [ProductName].You can create a new instance and/or upgrade existing one.
 
134
          </Text>
 
135
        </Control>
 
136
 
 
137
        <Control Id="CreateOrUpgradeButton" 
 
138
                 Type="RadioButtonGroup" X="40" Y="100" Width="300" Height="70" 
 
139
                 Property="CreateOrUpgradeChoice" Text="Specify what to do">
 
140
          <RadioButtonGroup Property="CreateOrUpgradeChoice">
 
141
            <RadioButton Value="Create" X="0" Y="0" Width="300" Height="25"
 
142
                  Text="{\Font1}Create new database instance."/>
 
143
            <RadioButton Value="Upgrade" X="0" Y="30" Width="300" Height="25"
 
144
                  Text="{\Font1}Do not create a new database. Optionally upgrade existing instances." />
 
145
          </RadioButtonGroup>
 
146
        </Control>
 
147
 
 
148
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;Back">
 
149
          <Publish Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
 
150
        </Control>
 
151
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Text="&amp;Next">
 
152
          <Publish Event="Remove" Value="DBInstance">CreateOrUpgradeChoice = "Upgrade" </Publish>
 
153
          <Publish Event="AddLocal" Value="DBInstance">CreateOrUpgradeChoice = "Create"</Publish>
 
154
          <Publish Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="[NonExistentProperty]">CreateOrUpgradeChoice = "Create"</Publish>
 
155
          <Publish Property="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="[NonExistentProperty]">CreateOrUpgradeChoice = "Create"</Publish>
 
156
          <Publish Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1">CreateOrUpgradeChoice = "Upgrade"</Publish>
 
157
          <Publish Event="NewDialog" Value="CustomizeDlg">1</Publish>
 
158
        </Control>
 
159
        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
 
160
          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
 
161
        </Control>
 
162
        <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
 
163
        <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
 
164
          <Text>Create or upgrade database instance</Text>
 
165
        </Control>
 
166
        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
 
167
        <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
 
168
          <Text>{\WixUI_Font_Title}[ProductName] setup</Text>
 
169
        </Control>
 
170
        <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
 
171
      </Dialog>
 
172
 
 
173
       <!-- Feedback dialog -->
 
174
       <Dialog Id="Feedback" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
 
175
 
 
176
         <Control Id="CheckBoxFeedback" Type="CheckBox" X="8" Y="61" Width="360" Height="12" Property="FEEDBACK" CheckBoxValue="1" TabSkip="no">
 
177
          <Text>{\Font1}Enable the Feedback plugin and submit anonymous usage information</Text>
 
178
        </Control>
 
179
 
 
180
        <Control Id="Text" Type="Text" X="23" Y="82" Width="290" Height="55">
 
181
         <Text>Monty Program has created a Feedback plugin for MariaDB which, if enabled, collects basic anonymous statistical information. This information is used by the developers to improve MariaDB. Enabling this plugin is an easy way to help with MariaDB development. Collected statistics, and more information on the plugin, can be viewed at http://mariadb.org/feedback_plugin         </Text>
 
182
        </Control>
 
183
 
 
184
       <Control Id="MoreInfo" Type="PushButton" X="23" Y="140" Width="56" Height="17" Text="More Info" ToolTip="http://mariadb.org/feedback_plugin" >
 
185
          <Publish Property="WixShellExecTarget" Value="http://mariadb.org/feedback_plugin"  Order="1">1</Publish>
 
186
          <Publish Event="DoAction" Value="LaunchUrl" Order="2">1</Publish>
 
187
        </Control>
 
188
 
 
189
 
 
190
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;Back">
 
191
          <Publish Event="NewDialog" Value="ServicePortDlg">1</Publish>
 
192
        </Control>
 
193
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Text="&amp;Next">
 
194
          <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
 
195
        </Control>
 
196
        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
 
197
          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
 
198
        </Control>
 
199
        <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
 
200
        <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
 
201
          <Text>Submit usage information</Text>
 
202
        </Control>
 
203
        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
 
204
        <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
 
205
          <Text>{\WixUI_Font_Title}[ProductName] setup</Text>
 
206
        </Control>
 
207
        <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
 
208
      </Dialog>
 
209
      
 
210
      <!-- Error popup dialog -->
 
211
      <Dialog Id="WarningDlg" Width="320" Height="85" Title="[ProductName] Setup" NoMinimize="yes">
 
212
       <Control Id="Icon" Type="Icon" X="15" Y="15" Width="24" Height="24"
 
213
       ToolTip="Information icon" FixedSize="yes" IconSize="32" Text="WixUI_Ico_Info" />
 
214
        <Control Id="Ok" Type="PushButton" X="132" Y="57" Width="56" Height="17"
 
215
          Default="yes" Cancel="yes" Text="OK">
 
216
          <Publish Property="WarningText">1</Publish>
 
217
          <Publish Event="EndDialog" Value="Return">1</Publish>
 
218
        </Control>
 
219
        <Control Id="Text" Type="Text" X="48" Y="15" Width="260" Height="30">
 
220
          <Text>[WarningText]</Text>
 
221
        </Control>
 
222
      </Dialog>
 
223
 
 
224
 
 
225
      <Property Id="ModifyRootPassword" Value="1"/>
 
226
      <TextStyle Id="Font1" FaceName="Tahoma" Size="8" Red="0" Green="0" Blue="0" Bold="yes" />
 
227
 
 
228
      <!-- Root password plus default user dialog  -->
 
229
      <Dialog Id="UserSettingsDlg" X="50" Y="50" Width="370" Height="270" Title="User settings">
 
230
        <Control Id="EditRootPassword" Type="Edit" X="104" Y="82" Width="91" Height="15" Property="PASSWORD" Password="yes" TabSkip="no">
 
231
          <Text>{100}</Text>
 
232
          <Condition Action="enable">ModifyRootPassword</Condition>
 
233
          <Condition Action="disable">NOT ModifyRootPassword</Condition>
 
234
        </Control>
 
235
        <Control Id="EditRootPasswordConfirm" Type="Edit" X="104" Y="103" Width="91" Height="15" Property="RootPasswordConfirm"  Password="yes" TabSkip="no">
 
236
          <Text>{100}</Text>
 
237
          <Condition Action="enable">ModifyRootPassword</Condition>
 
238
          <Condition Action="disable">NOT ModifyRootPassword</Condition>
 
239
        </Control>
 
240
 
 
241
        <Control Id="CheckBoxModifyRootPassword" Type="CheckBox" X="8" Y="62" Width="222" Height="18" Property="ModifyRootPassword" CheckBoxValue="1" TabSkip="no">
 
242
          <Text>{\Font1}Modify password for database user 'root'</Text>
 
243
          <Publish Property="PASSWORD" >NOT ModifyRootPassword</Publish>
 
244
          <Publish Property="RootPasswordConfirm">NOT ModifyRootPassword</Publish>
 
245
          <Publish Property="ALLOWREMOTEROOTACCESS">NOT ModifyRootPassword</Publish>
 
246
          <Publish Property="ALLOWREMOTEROOTACCESS" Value="1">ModifyRootPassword</Publish>
 
247
        </Control>
 
248
 
 
249
        <Control Id="Text5" Type="Text" X="23" Y="82" Width="77" Height="14" TabSkip="yes">
 
250
          <Text>New root password:</Text>
 
251
        </Control>
 
252
        <Control Id="Text6" Type="Text" X="201" Y="85" Width="100" Height="17" TabSkip="yes">
 
253
          <Text>Enter new root password</Text>
 
254
        </Control>
 
255
        <Control Id="Text8" Type="Text" X="23" Y="105" Width="75" Height="17" TabSkip="yes">
 
256
          <Text>Confirm:</Text>
 
257
        </Control>
 
258
 
 
259
        <Control Id="Text10" Type="Text" X="201" Y="104" Width="100" Height="17" TabSkip="yes">
 
260
          <Text>Retype the password</Text>
 
261
        </Control>
 
262
        <Control Id="CheckBoxALLOWREMOTEROOTACCESS" Type="CheckBox" X="23" Y="122" Width="196" Height="18" Property="ALLOWREMOTEROOTACCESS"
 
263
                 CheckBoxValue="--allow-remote-root-access" TabSkip="no">
 
264
          <Text>{\Font1}Enable access from remote machines for 'root' user</Text>
 
265
          <Condition Action="enable">ModifyRootPassword</Condition>
 
266
          <Condition Action="disable">NOT ModifyRootPassword</Condition>
 
267
        </Control>
 
268
 
 
269
        <Control Id="CheckBoxCreateDefaultUser" Type="CheckBox" X="8" Y="154" Width="200" Height="18" Property="DEFAULTUSER"
 
270
                 CheckBoxValue="--default-user" TabSkip="no">
 
271
          <Text>{\Font1}Create An Anonymous Account</Text>
 
272
        </Control>
 
273
        <Control Id="Text14" Type="Text" X="21" Y="174" Width="268" Height="16" TabSkip="yes">
 
274
          <Text>This option will create an anonymous account on this server. </Text>
 
275
        </Control>
 
276
        <Control Id="Text13" Type="Text" X="21" Y="190" Width="254" Height="24" TabSkip="yes">
 
277
          <Text>Please note: this setting can lead to insecure systems.</Text>
 
278
        </Control>
 
279
 
 
280
        <Control Id="CheckBoxUTF8" Type="CheckBox" X="8" Y="215" Width="250" Height="18" Property="UTF8" CheckBoxValue="1" TabSkip="no">
 
281
          <Text>{\Font1}Use UTF8 as default server's character set</Text>
 
282
        </Control>
 
283
 
 
284
        <!-- Navigation buttons-->
 
285
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;Back">
 
286
          <Publish Event="NewDialog" Value="CustomizeDlg">1</Publish>
 
287
        </Control>
 
288
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&amp;Next">
 
289
          <Publish Property="WarningText" Value="Passwords do not match."><![CDATA[PASSWORD <> RootPasswordConfirm]]></Publish>
 
290
          <Publish Event="SpawnDialog" Value="WarningDlg"><![CDATA[WarningText <>""]]></Publish>
 
291
          <Publish Property="SERVICENAME" Value="MySQL">NOT SERVICENAME AND NOT WarningText</Publish>
 
292
          <Publish Event="NewDialog" Value="ServicePortDlg"><![CDATA[WarningText=""]]></Publish>
 
293
          <Condition Action="enable"><![CDATA[NOT ModifyRootPassword OR PASSWORD]]> </Condition>
 
294
          <Condition Action="disable"><![CDATA[ModifyRootPassword AND (NOT PASSWORD)]]> </Condition>
 
295
        </Control>
 
296
        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
 
297
          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
 
298
        </Control>
 
299
        <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
 
300
        <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
 
301
          <Text> [ProductName] database configuration</Text>
 
302
        </Control>
 
303
        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
 
304
        <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
 
305
          <Text>{\WixUI_Font_Title}Default instance properties</Text>
 
306
        </Control>
 
307
        <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
 
308
      </Dialog>
 
309
 
 
310
      <Property Id="InstallService" Value="1"/>
 
311
      <Property Id="EnableNetworking" Value="1"/>
 
312
 
 
313
      <!-- Service and port configuration -->
 
314
      <Dialog Id="ServicePortDlg" Width="370" Height="270" Title="Database settings">
 
315
        <Control Id="InstallAsService" Type="CheckBox" X="9" Y="61" Width="222" Height="19" Property="InstallService" CheckBoxValue="1" TabSkip="no">
 
316
          <Text>{\Font1}Install as service</Text>
 
317
        </Control>
 
318
        <Control Id="EditServiceName" Type="Edit" X="104" Y="82" Width="91" Height="15" Property="SERVICENAME" TabSkip="no">
 
319
          <Text>{20}</Text>
 
320
          <Condition Action="enable">InstallService</Condition>
 
321
          <Condition Action="disable">Not InstallService</Condition>
 
322
        </Control>
 
323
        <Control Id="Text5" Type="Text" X="25" Y="82" Width="77" Height="14" TabSkip="yes">
 
324
          <Text>Service Name:</Text>
 
325
        </Control>
 
326
        <Control Id="CheckBoxEnableNetworking" Type="CheckBox" Height="18" Width="102" X="9" Y="117" Property="EnableNetworking" CheckBoxValue="1">
 
327
          <Text>{\Font1}Enable networking</Text>
 
328
          <!--<Publish Property="PORT">NOT EnableNetworking</Publish>-->
 
329
          <Publish Property="SKIPNETWORKING" Value="--skip-networking">NOT EnableNetworking</Publish>
 
330
          <Publish Property="SKIPNETWORKING">EnableNetworking</Publish>
 
331
        </Control>
 
332
        <Control Id="LabelTCPPort" Type="Text" Height="17" Width="75" X="25" Y="142" Text="TCP port:" />
 
333
        <Control Id="Port" Type="MaskedEdit" X="104" Y="140" Width="28" Height="15" Property="PORT"  Sunken="yes" Text="[PortTemplate]">
 
334
          <Condition Action="enable" >EnableNetworking</Condition>
 
335
          <Condition Action="disable">Not EnableNetworking</Condition>
 
336
        </Control>
 
337
 
 
338
        <?if $(var.HaveInnodb) = "1" ?>
 
339
        <Control Id="CheckBoxStandardConfig" Type="CheckBox" Height="18" Width="220" X="9" Y="171" Property="STDCONFIG" CheckBoxValue="1">
 
340
          <Text>{\Font1}Optimize for transactions</Text>
 
341
        </Control>
 
342
 
 
343
        <Control Id="StandardConfigExplain" Type="Text" X="25" Y="190" Width="270" Height="14" TabSkip="yes">
 
344
          <Text>(Uses transactional storage engine and "strict" SQL mode)</Text>
 
345
          <Condition Action="enable" >STDCONFIG</Condition>
 
346
          <Condition Action="disable">Not STDCONFIG</Condition>
 
347
        </Control>
 
348
        <Control Id="LabelInnodbBufferpool" Type="Text" Height="17" Width="77" X="25" Y="210" Text="Buffer pool size:" >
 
349
        <Condition Action="enable" >STDCONFIG</Condition>
 
350
          <Condition Action="disable">Not STDCONFIG</Condition>
 
351
        </Control>
 
352
        <Control Id="BPSize" Type="MaskedEdit" X="104" Y="208" Width="40" Height="15" Property="BUFFERPOOLSIZE"  Sunken="yes" Text="[BufferPoolSizeTemplate]">
 
353
          <Condition Action="enable" >STDCONFIG</Condition>
 
354
          <Condition Action="disable">Not STDCONFIG</Condition>
 
355
        </Control>
 
356
        <Control Id="LabelMB" Type="Text" Height="17" Width="15" X="150" Y="210" Text="MB" >
 
357
        <Condition Action="enable" >STDCONFIG</Condition>
 
358
          <Condition Action="disable">Not STDCONFIG</Condition>
 
359
        </Control>
 
360
       <?endif?>
 
361
 
 
362
        <!-- Navigation buttons-->
 
363
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;Back">
 
364
          <Publish Event="NewDialog" Value="UserSettingsDlg">1</Publish>
 
365
        </Control>
 
366
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="no" Text="&amp;Next">
 
367
          <Publish Property="SERVICENAME">NOT InstallService</Publish>
 
368
          <Publish Property="WarningText" Value="Please enter valid port or uncheck 'Enable Networking' checkbox">
 
369
            <![CDATA[EnableNetworking AND NOT PORT AND NOT WarningText]]>
 
370
          </Publish>
 
371
          <Publish Property="WarningText" Value="Please enter valid service name port or uncheck 'Install Service' checkbox">
 
372
            <![CDATA[InstallService AND NOT SERVICENAME AND NOT WarningText]]>
 
373
          </Publish>
 
374
          <Publish Event="DoAction" Value="CheckDatabaseProperties">NOT WarningText</Publish>
 
375
          <Publish Event="SpawnDialog" Value="WarningDlg">WarningText</Publish>
 
376
          <Publish Event="NewDialog" Value="Feedback">Not WarningText</Publish>
 
377
        </Control>
 
378
        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="no" Text="Cancel">
 
379
          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
 
380
        </Control>
 
381
        <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
 
382
        <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
 
383
          <Text>[ProductName] database configuration</Text>
 
384
        </Control>
 
385
        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="2" />
 
386
        <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
 
387
          <Text>{\WixUI_Font_Title}Default instance properties</Text>
 
388
        </Control>
 
389
        <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="2" />
 
390
      </Dialog>
 
391
    </UI>
 
392
 
 
393
    <Property Id="CRLF" Value="&#xD;&#xA;" />
 
394
    <CustomAction Id="CheckDataDirectoryEmpty" BinaryKey="wixca.dll" DllEntry="CheckDataDirectoryEmpty" Execute="immediate" Impersonate="yes"/>
 
395
    <!--  What to do when navigation buttons are clicked -->
 
396
    <UI Id="MyWixUI_Mondo">
 
397
      <UIRef Id="WixUI_FeatureTree" />
 
398
      <UIRef Id="WixUI_ErrorProgressText" />
 
399
      <Publish Dialog="WelcomeDlg"  Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="999">
 
400
        OLDERVERSIONBEINGUPGRADED
 
401
      </Publish>
 
402
      <Publish Dialog="LicenseAgreementDlg"  Control="Next" Event="NewDialog" Value="NewOrUpgradeInstanceDlg" Order="999">
 
403
        NOT Installed AND UpgradableServiceFound
 
404
      </Publish>
 
405
 
 
406
      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="Feedback" Order="3" ><![CDATA[&DBInstance=3 AND NOT !DBInstance=3]]></Publish>
 
407
      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3"> <![CDATA[OLDERVERSIONBEINGUPGRADED <>""]]></Publish>
 
408
      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ConfirmDataCleanupDlg" Order="1" ><![CDATA[(&DBInstance=2) AND (!DBInstance=3)]]></Publish>
 
409
 
 
410
 
 
411
      <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="NewOrUpgradeInstanceDlg" Order="999">
 
412
        NOT Installed AND UpgradableServiceFound
 
413
      </Publish>
 
414
      <Publish Dialog="CustomizeDlg" Control="Next" Event="DoAction" Value="CheckDataDirectoryEmpty" Order="1"><![CDATA[&DBInstance=3 AND NOT !DBInstance=3]]></Publish>
 
415
      <Publish Dialog="CustomizeDlg" Property="DATADIRNOTEMPTY" Control="Next"  Order="1"><![CDATA[NOT(&DBInstance=3 AND NOT !DBInstance=3)]]></Publish>
 
416
      <Publish  Dialog="CustomizeDlg" Control="Next"  Property="WarningText" Order="2"
 
417
         Value="Selected data directory [DATADIR] is not empty. Either clean it, or choose another location for 'Database Instance' feature.">
 
418
        DATADIRNOTEMPTY
 
419
      </Publish>
 
420
      <Publish Dialog="CustomizeDlg" Control="Next" Event="SpawnDialog" Value="WarningDlg" Order="3">WarningText</Publish>
 
421
      <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ConfirmDataCleanupDlg" Order="4">
 
422
        <![CDATA[(&DBInstance=2) AND (!DBInstance=3)]]>
 
423
      </Publish>
 
424
      <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="UserSettingsDlg" Order="5">
 
425
        <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND NOT WarningText]]>
 
426
      </Publish>
 
427
 
 
428
      <Publish Dialog="ConfirmDataCleanupDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg">WixUI_InstallMode = "Change"</Publish>
 
429
      <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="ConfirmDataCleanupDlg" Order="999">
 
430
        !DBInstance=3 AND (CLEANUPDATA Or USECONFIRMDATACLEANUPDLG)
 
431
      </Publish>
 
432
      <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Property="USECONFIRMDATACLEANUPDLG" Value="1" Order="999">
 
433
        !DBInstance=3 AND CLEANUPDATA
 
434
      </Publish>
 
435
      <Publish Dialog="ConfirmDataCleanupDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">WixUI_InstallMode = "Remove"</Publish>
 
436
    </UI>
 
437
 
 
438
    <!-- End of UI section -->
 
439
 
 
440
    <!-- Extra folders we need (DATADIR and shortcut folder) -->
 
441
    <DirectoryRef Id='INSTALLDIR'>
 
442
      <Directory Id="DATADIR" Name="data">
 
443
      </Directory>
 
444
      <Directory Id="ProgramMenuFolder">
 
445
        <Directory Id="ShortcutFolder" Name="@CPACK_WIX_PACKAGE_NAME@">
 
446
        </Directory>
 
447
      </Directory>
 
448
    </DirectoryRef>
 
449
 
 
450
 
 
451
    <!-- Extra feature (database instance). This could be split to several subfeatures if desired (e.g firewall exception)-->
 
452
    <Feature Id='DBInstance'
 
453
         Title='Database instance'
 
454
         Description=
 
455
             'Install database instance. Only new database can be installed with this feature.'
 
456
         ConfigurableDirectory='DATADIR'
 
457
         AllowAdvertise='no'
 
458
         Level='1'>
 
459
 
 
460
      <!-- Data directory with some reasonable security settings -->
 
461
      <Component Id="C.datadir" Guid="*" Directory="DATADIR">
 
462
        <RegistryValue Root='HKLM'
 
463
           Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
 
464
           Name='DATADIR' Value='[DATADIR]' Type='string' KeyPath='yes'/>
 
465
        <CreateFolder>
 
466
          <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
 
467
          <util:PermissionEx User="NetworkService" GenericAll="yes" />
 
468
        </CreateFolder>
 
469
      </Component>
 
470
 
 
471
      <!-- Database service conditioned on SERVICENAME property-->
 
472
      <Component Id="C.service" Guid="*" Directory="DATADIR">
 
473
        <Condition>SERVICENAME</Condition>
 
474
        <RegistryValue Root='HKLM'
 
475
           Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
 
476
           Name='SERVICENAME' Value='[SERVICENAME]' Type='string' KeyPath='yes'/>
 
477
        <ServiceControl Id='DBInstanceServiceStop' Name='[SERVICENAME]'  Stop='both' Remove='uninstall' Wait='yes'/>
 
478
        <ServiceControl Id='DBInstanceServiceStart' Name='[SERVICENAME]' Start='install' Wait='yes'/>
 
479
      </Component>
 
480
      <?if $(var.HaveInnodb) = "1" ?>
 
481
      <Component Id="C.myiniconfig" Guid="*" Directory="DATADIR">
 
482
      <Condition>STDCONFIG</Condition>
 
483
        <RegistryValue Root='HKLM'
 
484
           Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
 
485
           Name='STDCONFIG' Value='1' Type='string' KeyPath='yes'/>
 
486
        <IniFile Id="Ini1"
 
487
            Action="createLine"
 
488
            Directory="DATADIR"
 
489
            Section="mysqld"
 
490
            Name="my.ini"
 
491
            Key="sql_mode"
 
492
            Value="&quot;STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION&quot;" />
 
493
        <IniFile Id="Ini2"
 
494
            Action="createLine"
 
495
            Directory="DATADIR"
 
496
            Section="mysqld"
 
497
            Name="my.ini"
 
498
            Key="default_storage_engine"
 
499
            Value="innodb" />
 
500
        <IniFile Id="Ini3"
 
501
            Action="createLine"
 
502
            Directory="DATADIR"
 
503
            Section="mysqld"
 
504
            Name="my.ini"
 
505
            Key="innodb_buffer_pool_size"
 
506
            Value="[BUFFERPOOLSIZE]M" />
 
507
        <IniFile Id="Ini4"
 
508
            Action="createLine"
 
509
            Directory="DATADIR"
 
510
            Section="mysqld"
 
511
            Name="my.ini"
 
512
            Key="innodb_log_file_size"
 
513
            Value="[LOGFILESIZE]M" />
 
514
      </Component>
 
515
      <?endif?>
 
516
     
 
517
      <Component Id="C.feedback" Guid="*" Directory="DATADIR">
 
518
        <Condition>FEEDBACK</Condition>
 
519
        <RegistryValue Root='HKLM'
 
520
           Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
 
521
           Name='FEEDBACK' Value='1' Type='string' KeyPath='yes'/>
 
522
        <IniFile Id="Ini5"
 
523
            Action="createLine"
 
524
            Directory="DATADIR"
 
525
            Section="mysqld"
 
526
            Name="my.ini"
 
527
            Key="feedback"
 
528
            Value="ON" />
 
529
      </Component>
 
530
 
 
531
      <Component Id="C.utf8" Guid="*" Directory="DATADIR">
 
532
        <Condition>UTF8</Condition>
 
533
        <RegistryValue Root='HKLM'
 
534
           Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
 
535
           Name='UTF8' Value='1' Type='string' KeyPath='yes'/>
 
536
        <IniFile Id="Ini6"
 
537
            Action="createLine"
 
538
            Directory="DATADIR"
 
539
            Section="mysqld"
 
540
            Name="my.ini"
 
541
            Key="character-set-server"
 
542
            Value="utf8" />
 
543
      </Component>
 
544
 
 
545
      <!--- Grant service account permission to the database folder (Windows 7 and later) -->
 
546
      <Component Id="C.serviceaccount.permission" Guid="*" Directory='DATADIR' Transitive='yes'>
 
547
        <Condition><![CDATA[SERVICENAME AND (VersionNT > 600)]]></Condition>
 
548
        <RegistryValue Root='HKLM'
 
549
             Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
 
550
             Name='servicepermission' Value='1' Type='string' KeyPath='yes'/>
 
551
        <CreateFolder>
 
552
          <util:PermissionEx User="NT SERVICE\[SERVICENAME]" GenericAll="yes" />
 
553
        </CreateFolder>
 
554
      </Component>
 
555
 
 
556
      <!-- Shortcuts in program menu (mysql client etc) -->
 
557
      <Component Id="c.shortcuts" Guid="*" Directory="ShortcutFolder">
 
558
        <!-- shortcut to my.ini-->
 
559
        <RegistryValue  Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall" Name="shortcuts" Value="1" Type="string" KeyPath="yes"  />
 
560
        <RemoveFolder Id="RemoveShorcutFolder" On="uninstall" />
 
561
        <Shortcut Id="shortcut.my.ini"
 
562
          Name="my.ini (@CPACK_WIX_PACKAGE_NAME@)"
 
563
          Target="[System64Folder]notepad.exe"
 
564
          Arguments="&quot;[DATADIR]my.ini&quot;"
 
565
          Directory="ShortcutFolder"
 
566
          Description="Edit database configuration" />
 
567
        <Shortcut Id="shortcut.errorlog"
 
568
          Name="Error log (@CPACK_WIX_PACKAGE_NAME@)"
 
569
          Target="[System64Folder]notepad.exe"
 
570
          Arguments="&quot;[DATADIR][ComputerName].err&quot;"
 
571
          Directory="ShortcutFolder"
 
572
          Description="View Database Error log" />
 
573
        <Shortcut Id="shortcut.dbfolder" Name="Database directory (@CPACK_WIX_PACKAGE_NAME@)"
 
574
          Target="[DATADIR]" />
 
575
      </Component>
 
576
 
 
577
      <!-- add reference so mysql client won't get uninstalled and we have a shortcut pointing to nowhere-->
 
578
      <ComponentRef Id="C.bin.mysql.exe"/>
 
579
 
 
580
      <Component Id="c.shortcuts.commandline" Guid="*" Directory="ShortcutFolder">
 
581
        <RegistryValue
 
582
          Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall"
 
583
          Name="shortcuts.commandline"
 
584
          Value="1" Type="string" KeyPath="yes" />
 
585
        <!-- shortcut to client-->
 
586
        <Shortcut Id="shortcut.mysql.exe"
 
587
          Name="MySQL Client (@CPACK_WIX_PACKAGE_NAME@)"
 
588
          Target="[System64Folder]cmd.exe"
 
589
          Arguments="/k &quot; &quot;[D.bin]mysql.exe&quot; &quot;--defaults-file=[DATADIR]my.ini&quot; -uroot -p&quot;"
 
590
          Directory="ShortcutFolder"
 
591
          WorkingDirectory="D.bin"
 
592
          Description="Starts mysql.exe for root user"  />
 
593
      </Component>
 
594
      <Component Id="c.shortcuts.commandprompt.db"  Guid="*"  Directory="ShortcutFolder" Transitive="yes">
 
595
        <Condition>SERVICENAME</Condition>
 
596
        <RegistryValue
 
597
        Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall"
 
598
        Name="shortcuts.commandprompt.db"
 
599
        Value="1" Type="string" KeyPath="yes" />
 
600
        <!-- just command prompt in the bin directory (so all utilities can be called) -->
 
601
        <Shortcut Id="shortcut.commandprompt.exe.db"
 
602
          Name="Command Prompt (@CPACK_WIX_PACKAGE_NAME@)"
 
603
          Target="[System64Folder]cmd.exe"
 
604
          Directory="ShortcutFolder"
 
605
          Arguments="/k  &quot;set MYSQL_HOME=[DATADIR]&amp;&amp; set PATH=[D.bin];%PATH%;&amp;&amp;echo Setting environment for [ProductName] &quot;"
 
606
          Description="Opens command line in the installation bin directory" />
 
607
      </Component>
 
608
 
 
609
 
 
610
    </Feature>
 
611
 
 
612
    <Feature Id="SharedClientServerComponents"
 
613
      Title='Utilities used by both server and client.'
 
614
      Description=
 
615
      'Client utilities that are also used with server.Required for upgrade.'
 
616
      ConfigurableDirectory='INSTALLDIR'
 
617
      AllowAdvertise='no'
 
618
      Level='1'
 
619
      Display='hidden'>
 
620
      <ComponentRef Id='C.bin.mysql.exe'/>
 
621
      <ComponentRef Id='C.bin.mysqladmin.exe'/>
 
622
      <ComponentRef Id='C.bin.mysql_upgrade.exe'/>
 
623
      <ComponentRef Id='C.bin.mysqlcheck.exe'/>
 
624
      <Component Id="c.shortcuts.commandprompt.nodb"  Guid="*"  Directory="ShortcutFolder" Transitive="yes">
 
625
        <Condition>NOT SERVICENAME</Condition>
 
626
        <RegistryValue
 
627
          Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall"
 
628
          Name="shortcuts.commandprompt.nodb"
 
629
          Value="1" Type="string" KeyPath="yes" />
 
630
        <!-- just command prompt in the bin directory (so all utilities can be called) -->
 
631
        <Shortcut Id="shortcut.commandprompt.exe.nodb"
 
632
          Name="Command Prompt (@CPACK_WIX_PACKAGE_NAME@)"
 
633
          Target="[System64Folder]cmd.exe"
 
634
          Directory="ShortcutFolder"
 
635
          Arguments="/k  &quot;set PATH=[D.bin];%PATH%;&amp;&amp;echo Setting environment for [ProductName] &quot;"
 
636
          Description="Opens command line in the installation bin directory" />
 
637
      </Component>
 
638
     <?if $(var.HaveUpgradeWizard) != "0" ?>
 
639
     <ComponentRef Id='C.bin.mysql_upgrade_wizard.exe'/>
 
640
     <!--
 
641
     <Component Id="c.shortcuts.upgrade_wizard"  Guid="*"  Directory="ShortcutFolder" Transitive="yes">
 
642
       <RegistryValue
 
643
       Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall"
 
644
       Name="shortcuts.upgrade_wizard"
 
645
       Value="1" Type="string" KeyPath="yes" />
 
646
      <Shortcut Id="shortcut.upgrade_wizard"
 
647
        Name="Upgrade Wizard (@CPACK_WIX_PACKAGE_NAME@)"
 
648
       Target="[INSTALLDIR]bin\mysql_upgrade_wizard.exe"
 
649
       Directory="ShortcutFolder"
 
650
       Description="Upgrades older instances of MariaDB/MySQL services to version @MAJOR_VERSION@.@MINOR_VERSION@"  
 
651
       Advertise="no"/>
 
652
     </Component>
 
653
     -->
 
654
     <?endif?>
 
655
    </Feature>
 
656
 
 
657
    <!-- Optional 3rd party tools -->
 
658
    <DirectoryRef Id='TARGETDIR'>
 
659
     <Directory Id='CommonFilesFolder'>
 
660
       <Directory Id='MariaDBShared' Name='MariaDBShared'/>
 
661
     </Directory>
 
662
     <Directory Id='DesktopFolder'/>
 
663
     </DirectoryRef>
 
664
 
 
665
 
 
666
    <?if "@WITH_THIRD_PARTY@" != "" ?>
 
667
 
 
668
    <!-- Include definition of 3party components -->
 
669
    <?foreach tool in @WITH_THIRD_PARTY@ ?>
 
670
     <?include "${CMAKE_CURRENT_BINARY_DIR}\$(var.tool).wxi" ?>
 
671
    <?endforeach ?>
 
672
 
 
673
    <Feature Id="ThirdPartyTools"
 
674
      Title='Third party tools'
 
675
      Description= 'Third party tools'
 
676
      AllowAdvertise='no'
 
677
      Level='1'
 
678
      Display='expand'>
 
679
    @THIRD_PARTY_FEATURE_CONDITION@
 
680
    <!-- Include definition of 3rd party features -->
 
681
    <?foreach tool in @WITH_THIRD_PARTY@ ?>
 
682
     <?include "${CMAKE_CURRENT_BINARY_DIR}\$(var.tool)_feature.wxi" ?>
 
683
    <?endforeach ?>
 
684
 
 
685
   </Feature>
 
686
   
 
687
   <?endif ?>
 
688
   
 
689
    <!--  Custom action, call mysql_install_db  -->
 
690
    <SetProperty  Sequence='execute'  Before='CreateDatabaseCommand' Id="SKIPNETWORKING"  Value="--skip-networking" >SKIPNETWORKING</SetProperty>
 
691
    <SetProperty Sequence='execute'  Before='CreateDatabaseCommand'  Id="ALLOWREMOTEROOTACCESS" Value="--allow-remote-root-access">ALLOWREMOTEROOTACCESS</SetProperty>
 
692
    <SetProperty Sequence='execute'  Before='CreateDatabaseCommand' Id="DEFAULTUSER" Value="--default-user">DEFAULTUSER</SetProperty>
 
693
    <CustomAction Id='CheckDatabaseProperties' BinaryKey='wixca.dll' DllEntry='CheckDatabaseProperties' />
 
694
    <CustomAction Id='PresetDatabaseProperties' BinaryKey='wixca.dll' DllEntry='PresetDatabaseProperties' />
 
695
    <CustomAction Id="CreateDatabaseCommand" Property="CreateDatabase"
 
696
    Value=
 
697
    "&quot;[#F.bin.mysql_install_db.exe]&quot;  &quot;--service=[SERVICENAME]&quot; --port=[PORT] &quot;--password=[ESCAPEDPASSWORD]&quot; &quot;--datadir=[DATADIR]\&quot; [SKIPNETWORKING] [ALLOWREMOTEROOTACCESS] [DEFAULTUSER] --verbose-bootstrap"
 
698
     Execute="immediate"
 
699
     HideTarget="yes"
 
700
     />
 
701
    <CustomAction Id="CreateDatabaseRollbackCommand" Property="CreateDatabaseRollback"
 
702
        Value="[SERVICENAME]\[DATADIR]"
 
703
        Execute="immediate"/>
 
704
    <CustomAction Id="CreateDatabase" BinaryKey="WixCA" DllEntry="CAQuietExec"
 
705
            Execute="deferred" Return="check" Impersonate="no" />
 
706
    <CustomAction Id="CreateDatabaseRollback" BinaryKey="wixca.dll" DllEntry="CreateDatabaseRollback"
 
707
        Execute="rollback" Return="check" Impersonate="no"/>
 
708
    <UI>
 
709
      <ProgressText Action="CreateDatabase">Running mysql_install_db.exe</ProgressText>
 
710
    </UI>
 
711
 
 
712
    <!-- Error injection script activated by TEST_FAIL=1 passed to msiexec (to see how good custom action rollback works)  -->
 
713
    <Property Id="FailureProgram">
 
714
      <![CDATA[
 
715
         Function Main()
 
716
         Main = 3
 
717
         End Function
 
718
         ]]>
 
719
    </Property>
 
720
    <CustomAction Id="FakeFailure"
 
721
     VBScriptCall="Main"
 
722
     Property="FailureProgram"
 
723
     Execute="deferred" />
 
724
 
 
725
    <CustomAction Id='ErrorDataDirNotEmpty' 
 
726
                  Error='Chosen data directory [DATADIR] is not empty. It must be empty prior to installation.'/>
 
727
    <InstallExecuteSequence>
 
728
      <Custom Action="CheckDataDirectoryEmpty" After="CostFinalize">
 
729
        <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED=""]]>
 
730
      </Custom>
 
731
      <Custom Action="ErrorDataDirNotEmpty" After="CheckDataDirectoryEmpty" >DATADIRNOTEMPTY</Custom>
 
732
      <Custom Action="CheckDatabaseProperties" Before="CreateDatabaseCommand">SERVICENAME</Custom>
 
733
      <Custom Action="CreateDatabaseCommand" After="CostFinalize" >
 
734
        <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED=""]]>
 
735
      </Custom>
 
736
      <Custom Action="CreateDatabase" After="InstallFiles">
 
737
        <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED=""]]>
 
738
      </Custom>
 
739
      <Custom Action="CreateDatabaseRollbackCommand" After="CostFinalize">
 
740
        <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED=""]]>
 
741
      </Custom>
 
742
      <Custom Action="CreateDatabaseRollback" Before="CreateDatabase">
 
743
        <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED=""]]>
 
744
      </Custom>
 
745
      <Custom Action='FakeFailure' Before='InstallFinalize'>
 
746
        <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED="" AND TESTFAIL]]>
 
747
      </Custom>
 
748
    </InstallExecuteSequence>
 
749
 
 
750
 
 
751
    <!-- Custom action to remove data on uninstall  -->
 
752
    <Binary Id='wixca.dll' SourceFile='@WIXCA_LOCATION@' />
 
753
    <CustomAction Id="RemoveDataDirectory.SetProperty" Return="check" 
 
754
                  Property="RemoveDataDirectory" Value="[DATADIR]" />
 
755
    <CustomAction Id="RemoveDataDirectory"  BinaryKey="wixca.dll"
 
756
                  DllEntry="RemoveDataDirectory"
 
757
                  Execute="deferred"
 
758
                  Impersonate="no"
 
759
                  Return="ignore"   />
 
760
    <InstallExecuteSequence>
 
761
      <Custom Action="RemoveDataDirectory.SetProperty" After="CreateDatabaseCommand" >
 
762
        <![CDATA[($C.datadir=2) AND (CLEANUPDATA) AND NOT UPGRADINGPRODUCTCODE]]>
 
763
      </Custom>
 
764
      <Custom Action="RemoveDataDirectory" Before="RemoveFiles">
 
765
        <![CDATA[($C.datadir=2) AND (CLEANUPDATA) AND NOT UPGRADINGPRODUCTCODE]]>
 
766
      </Custom>
 
767
    </InstallExecuteSequence>
 
768
 
 
769
    <InstallExecuteSequence>
 
770
      <StopServices>SERVICENAME</StopServices>
 
771
      <DeleteServices>SERVICENAME</DeleteServices>
 
772
    </InstallExecuteSequence>
 
773
    <CustomAction Id="CheckDBInUse" Return="ignore" 
 
774
                  BinaryKey="wixca.dll" DllEntry="CheckDBInUse"  Execute="firstSequence"/>
 
775
    <InstallExecuteSequence>
 
776
      <Custom Action="CheckDBInUse" Before="LaunchConditions">Installed</Custom>
 
777
      <Custom Action="PresetDatabaseProperties" After="CheckDBInUse"></Custom>
 
778
    </InstallExecuteSequence>
 
779
    <InstallUISequence>
 
780
      <Custom Action="CheckDBInUse" Before="LaunchConditions">Installed</Custom>
 
781
      <Custom Action="PresetDatabaseProperties" After="CheckDBInUse"></Custom>
 
782
    </InstallUISequence>
 
783
 
 
784
    <!-- Store some properties persistently in registry, mainly for upgrades -->
 
785
 
 
786
    <Feature Id='StoreInstallLocation' Level='1' Absent='disallow' Display='hidden'>
 
787
      <Component Directory='INSTALLDIR' Guid='*' Id='C.storeinstalllocation'>
 
788
        <RegistryValue Root='HKLM' Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@' 
 
789
                       Name='INSTALLDIR' Value='[INSTALLDIR]' Type='string'  KeyPath='yes'/>
 
790
      </Component>
 
791
    </Feature>
 
792
 
 
793
    <?foreach STOREDVAR in SERVICENAME;DATADIR;INSTALLDIR?>
 
794
 
 
795
    <Property Id='$(var.STOREDVAR)' Secure='yes'>
 
796
      <RegistrySearch Id='$(var.STOREDVAR)Property' Root='HKLM'
 
797
                      Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
 
798
                      Name='$(var.STOREDVAR)' Type='raw' />
 
799
    </Property>
 
800
    <CustomAction Id='SaveCmdLineValue_$(var.STOREDVAR)' Property='CMDLINE_$(var.STOREDVAR)'
 
801
              Value='[$(var.STOREDVAR)]' Execute='firstSequence' />
 
802
    <CustomAction Id='SetFromCmdLineValue_$(var.STOREDVAR)' Property='$(var.STOREDVAR)' 
 
803
                  Value='[CMDLINE_$(var.STOREDVAR)]' Execute='firstSequence' />
 
804
    <InstallUISequence>
 
805
      <Custom Action='SaveCmdLineValue_$(var.STOREDVAR)' Before='AppSearch' />
 
806
      <Custom Action='SetFromCmdLineValue_$(var.STOREDVAR)' After='AppSearch'>CMDLINE_$(var.STOREDVAR)</Custom>
 
807
    </InstallUISequence>
 
808
    <InstallExecuteSequence>
 
809
      <Custom Action='SaveCmdLineValue_$(var.STOREDVAR)' Before='AppSearch' />
 
810
      <Custom Action='SetFromCmdLineValue_$(var.STOREDVAR)' After='AppSearch'>CMDLINE_$(var.STOREDVAR)</Custom>
 
811
    </InstallExecuteSequence>
 
812
 
 
813
    <?endforeach?>
 
814
 
 
815
    <!-- 
 
816
      Optionally, start upgrade wizard on exit.
 
817
    -->
 
818
    
 
819
 
 
820
    
 
821
    <?if $(var.HaveUpgradeWizard) != "0" ?>
 
822
    <UI>
 
823
      <Publish Dialog="ExitDialog"
 
824
          Control="Finish"
 
825
          Event="DoAction"
 
826
          Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
 
827
    </UI>
 
828
    <Property 
 
829
      Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" 
 
830
      Value="Launch wizard to upgrade existing MariaDB or MySQL services." />
 
831
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="0"/>
 
832
    <Property Id="WixShellExecTarget" Value="[#F.bin.mysql_upgrade_wizard.exe]" />
 
833
    <CustomAction Id="LaunchApplication"
 
834
        BinaryKey="WixCA"
 
835
        DllEntry="WixShellExec"
 
836
        Impersonate="yes" />
 
837
    <CustomAction 
 
838
      Id="CheckServiceUpgrades"   Return="ignore" BinaryKey="wixca.dll" 
 
839
      DllEntry="CheckServiceUpgrades"
 
840
      Execute="immediate" />
 
841
    <InstallUISequence>
 
842
      <Custom Action="CheckServiceUpgrades" After="CostFinalize">
 
843
        $C.bin.mysql_upgrade_wizard.exe = 3 AND NOT Installed AND NOT OLDERVERSIONBEINGUPGRADED
 
844
      </Custom>
 
845
    </InstallUISequence>
 
846
    <SetProperty Before="ExecuteAction" Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" 
 
847
       Sequence="ui"  Value="[NonExistentProperty]">
 
848
      <![CDATA[($C.bin.mysql_upgrade_wizard.exe <> 3) AND NOT Installed OR OLDERVERSIONBEINGUPGRADED]]>
 
849
    </SetProperty>
 
850
    <SetProperty Before="ExecuteAction" Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" 
 
851
       Sequence="ui"  Value="[NonExistentProperty]">
 
852
      <![CDATA[($C.bin.mysql_upgrade_wizard.exe <> 3) AND NOT Installed OR OLDERVERSIONBEINGUPGRADED]]>
 
853
    </SetProperty>
 
854
    
 
855
    <?endif ?> <!-- HaveUpgradeWizard -->
 
856
 
 
857
    <!-- 
 
858
      Author the registry entries for "add or remove programs" 
 
859
      We choose to define ARPSYSTEMCOMPONENT to 1 because we want to show 
 
860
      "do you want to remove data directory" on uninstall
 
861
    -->
 
862
    <Property Id="ARPSYSTEMCOMPONENT" Value="1" Secure="yes" />
 
863
    <Property Id="ARPINSTALLLOCATION" Secure="yes"/>
 
864
    <SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="InstallValidate"  Sequence="execute"/>
 
865
    <Feature Id='ARPRegistryEntries'
 
866
          Title='Add or remove program entries'
 
867
          Description='Add or remove program entries'
 
868
          AllowAdvertise='no'
 
869
          Absent='disallow'  Display='hidden'
 
870
          Level='1'>
 
871
      <Component Id="C.arp_entries" Guid="*" Directory="INSTALLDIR">
 
872
        <RemoveFolder Id="RemoveINSTALLDIR" On="uninstall"/>
 
873
        <RegistryValue Root='HKLM'
 
874
           Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_WIX_PACKAGE_NAME@'
 
875
           Name='DisplayName' Value='[ProductName]' Type='string' KeyPath='yes'/>
 
876
        <RegistryValue Root='HKLM'
 
877
          Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_WIX_PACKAGE_NAME@'
 
878
          Name='Publisher' Value='@MANUFACTURER@' Type='string'/>
 
879
        <RegistryValue Root='HKLM'
 
880
          Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_WIX_PACKAGE_NAME@'
 
881
          Name='DisplayVersion' Value='[ProductVersion]' Type='string'/>
 
882
        <RegistryValue Root='HKLM'
 
883
          Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_WIX_PACKAGE_NAME@'
 
884
          Name='InstallLocation' Value='[INSTALLDIR]' Type='string'/>
 
885
        <RegistryValue Root='HKLM'
 
886
          Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_WIX_PACKAGE_NAME@'
 
887
          Name='UninstallString' Value='msiexec.exe /I [ProductCode]' Type='string'/>
 
888
        <RegistryValue Root='HKLM'
 
889
          Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_WIX_PACKAGE_NAME@'
 
890
          Name='MajorVersion' Value='@MAJOR_VERSION@' Type='string'/>
 
891
        <RegistryValue Root='HKLM'
 
892
          Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_WIX_PACKAGE_NAME@'
 
893
          Name='MinorVersion' Value='@MINOR_VERSION@' Type='string'/>
 
894
      </Component>
 
895
    </Feature>
 
896
 
 
897
    <!-- Extra condition to block the installer if NSIS based installation is detected-->
 
898
    <Property Id="NSISINSTALLKEY">
 
899
      <RegistrySearch Id='NSISKey' Type='raw'
 
900
        Root='HKLM' Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\MariaDB' Name='DisplayName' />
 
901
    </Property>
 
902
    <Condition
 
903
      Message=
 
904
      'Previous version of MariaDB was found, that used incompatible installer.&#xD;&#xA;Please remove &quot;[NSISINSTALLKEY]&quot; before you proceed with this installation.'
 
905
      >
 
906
      <![CDATA[ NOT(NSISINSTALLKEY << "MariaDB @MAJOR_VERSION@.@MINOR_VERSION@.") OR Installed]]>
 
907
    </Condition>
 
908
    <Condition Message=
 
909
       'Setting the ALLUSERS property is not allowed because [ProductName] is a per-machine application. Setup will now exit.'>
 
910
      <![CDATA[ALLUSERS = "1"]]>
 
911
    </Condition>
 
912
  </Fragment>
 
913
</Wix>