Commit 35118856 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-26714 - Allow credential manager in installer

Add a checkbox in the MSI, and parameter in mysql_install_db.exe
The effect is adding credential_manager=1 to the [client] section
parent f60036a0
......@@ -62,6 +62,7 @@ static my_bool opt_skip_networking;
static my_bool opt_verbose_bootstrap;
static my_bool verbose_errors;
static my_bool opt_large_pages;
static my_bool opt_allow_credential_manager;
static char *opt_config;
#define DEFAULT_INNODB_PAGE_SIZE 16*1024
......@@ -100,6 +101,9 @@ static struct my_option my_long_options[]=
&opt_large_pages, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"config",'c', "my.ini config template file", &opt_config,
&opt_config, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"allow-credential-manager", 'C', "Allows storing passwords in the credential manager (for client programs)",
&opt_allow_credential_manager, &opt_allow_credential_manager, 0, GET_BOOL,
OPT_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
......@@ -427,6 +431,8 @@ static int create_myini()
else if (opt_port)
write_myini_int("port",opt_port,"client");
if(opt_allow_credential_manager)
write_myini_str("credential-manager", "1", "client");
char *plugin_dir = get_plugindir();
if (plugin_dir)
write_myini_str("plugin-dir", plugin_dir, "client");
......
......@@ -39,6 +39,8 @@
<Property Id="PORT" Value="3306" Secure="yes"/>
<!-- Whether to allow remote access for root user -->
<Property Id="ALLOWREMOTEROOTACCESS" Secure="yes" />
<!-- Whether to allow remote access for root user -->
<Property Id="CREDENTIALMANAGER" Secure="yes" Value="1"/>
<!-- Skip networking. This will switch configuration to use named pipe-->
<Property Id="SKIPNETWORKING" Secure="yes"/>
<!-- Whether to keep default (unauthenticated) user. Default is no-->
......@@ -230,10 +232,15 @@
<Control Id="CheckBoxUTF8" Type="CheckBox" X="8" Y="154" Width="250" Height="18" Property="UTF8" CheckBoxValue="1" TabSkip="no">
<Text>{\Font1}Use UTF8 as default server's character set</Text>
</Control>
<Control Type="Text" Id="Text11" Width="67" Height="17" X="8" Y="190" Text="{\Font1}Data directory" />
<Control Type="PathEdit" Id="TxtDir" Width="175" Height="18" X="80" Y="190" Property="DATADIR">
<Control Id="CheckBoxCREDENTIALMANAGER" Type="CheckBox" X="8" Y="180" Width="300" Height="18"
Property="CREDENTIALMANAGER"
CheckBoxValue="1" TabSkip="no">
<Text>{\Font1}Command line clients : allow storing passwords with credential manager</Text>
</Control>
<Control Type="Text" Id="Text11" Width="67" Height="17" X="8" Y="205" Text="{\Font1}Data directory" />
<Control Type="PathEdit" Id="TxtDir" Width="175" Height="18" X="80" Y="205" Property="DATADIR">
</Control>
<Control Id="btnDirBrowse" Type="PushButton" Width="56" Height="17" X="278" Y="190" Text="Browse...">
<Control Id="btnDirBrowse" Type="PushButton" Width="56" Height="17" X="278" Y="205" Text="Browse...">
<Publish Property="_BrowseProperty" Value="DATADIR" Order="1">1</Publish>
<Publish Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
</Control>
......@@ -617,12 +624,13 @@
<!-- Custom action, call mysql_install_db -->
<SetProperty Sequence='execute' Before='CreateDatabaseCommand' Id="SKIPNETWORKING" Value="--skip-networking" >SKIPNETWORKING</SetProperty>
<SetProperty Sequence='execute' Before='CreateDatabaseCommand' Id="ALLOWREMOTEROOTACCESS" Value="--allow-remote-root-access">ALLOWREMOTEROOTACCESS</SetProperty>
<SetProperty Sequence='execute' Before='CreateDatabaseCommand' Id="CREDENTIALMANAGER" Value="--allow-credential-manager">CREDENTIALMANAGER</SetProperty>
<SetProperty Sequence='execute' Before='CreateDatabaseCommand' Id="DEFAULTUSER" Value="--default-user">DEFAULTUSER</SetProperty>
<CustomAction Id='CheckDatabaseProperties' BinaryKey='wixca.dll' DllEntry='CheckDatabaseProperties' />
<CustomAction Id='PresetDatabaseProperties' BinaryKey='wixca.dll' DllEntry='PresetDatabaseProperties' />
<CustomAction Id="CreateDatabaseCommand" Property="CreateDatabase"
Value=
"&quot;[#F.bin.mysql_install_db.exe]&quot; &quot;--service=[SERVICENAME]&quot; --port=[PORT] --innodb-page-size=[PAGESIZE] &quot;--password=[ESCAPEDPASSWORD]&quot; &quot;--datadir=[DATADIR]\&quot; [SKIPNETWORKING] [ALLOWREMOTEROOTACCESS] [DEFAULTUSER] --verbose-bootstrap"
"&quot;[#F.bin.mysql_install_db.exe]&quot; &quot;--service=[SERVICENAME]&quot; --port=[PORT] --innodb-page-size=[PAGESIZE] &quot;--password=[ESCAPEDPASSWORD]&quot; &quot;--datadir=[DATADIR]\&quot; [SKIPNETWORKING] [ALLOWREMOTEROOTACCESS] [DEFAULTUSER] [CREDENTIALMANAGER] --verbose-bootstrap"
Execute="immediate"
HideTarget="yes"
/>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment