summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2022-01-31 15:40:41 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2022-01-31 20:10:08 +0100
commit12cea0971381fa7404555d2e5ae598a4e59ee7df (patch)
treec34873f080c05adaeaffc2dec883250f9723670f /win
parent2a0962f39b3e7ef91915240176bab0abc03d2daa (diff)
downloadmariadb-git-12cea0971381fa7404555d2e5ae598a4e59ee7df.tar.gz
MDEV-27535 Service does not start after MSI install into restricted directory
This happens for example if one installs into home directory of a user C:\Users\<username>\mariadb The reason is that the service user "NT SERVICE\<service_name>" does not have read and execute permissions for service executable mysqld.exe in this directory. Moreover, it would not have read permissions for server.dll loaded by the exe, or to plugin directory, where plugins may reside. The fix is to give service users read and execute permissions to bin, share, and lib\plugin subdirectories. The permission setting is doneby mysql_install_db.exe, but also in MSI. It is important to do that in MSI, as we want permissions to survive the MSI upgrade.
Diffstat (limited to 'win')
-rw-r--r--win/packaging/extra.wxs.in40
1 files changed, 23 insertions, 17 deletions
diff --git a/win/packaging/extra.wxs.in b/win/packaging/extra.wxs.in
index d003cea26d6..a6428313f24 100644
--- a/win/packaging/extra.wxs.in
+++ b/win/packaging/extra.wxs.in
@@ -409,9 +409,6 @@
<RegistryValue Root='HKLM'
Key='SOFTWARE\@CPACK_WIX_PACKAGE_NAME@'
Name='DATADIR' Value='[DATADIR]' Type='string' KeyPath='yes'/>
- <CreateFolder>
- <util:PermissionEx User="NetworkService" GenericAll="yes" />
- </CreateFolder>
</Component>
<Component Id="C.datadir.permissions" Directory="DATADIR">
@@ -531,6 +528,29 @@
AllowAdvertise='no'
Level='1'
Display='hidden'>
+
+ <Component Id="C_Permissions.bin" Guid="2ce05496-3273-4866-a5b5-1eff2837b4cb" Directory="D.bin">
+ <!-- in case service is installed now on it the future -->
+ <CreateFolder>
+ <util:PermissionEx User="ALL SERVICES" Domain="NT SERVICE" GenericRead="yes" GenericExecute="yes" />
+ </CreateFolder>
+ <Condition>SERVICENAME</Condition>
+ </Component>
+
+ <Component Id="C_Permissions.lib.plugin" Guid="ff2e8f47-83fd-4dee-9e22-f103600cfc80" Directory="D.lib.plugin">
+ <CreateFolder>
+ <util:PermissionEx User="ALL SERVICES" Domain="NT SERVICE" GenericRead="yes" GenericExecute="yes" />
+ </CreateFolder>
+ <Condition>SERVICENAME</Condition>
+ </Component>
+
+ <Component Id="C_Permissions.share" Guid="be8ee2fb-a837-4b31-b59a-68a506d97d81" Directory="D.share">
+ <CreateFolder>
+ <util:PermissionEx User="ALL SERVICES" Domain="NT SERVICE" GenericRead="yes" GenericExecute="yes" />
+ </CreateFolder>
+ <Condition>SERVICENAME</Condition>
+ </Component>
+
<ComponentRef Id='C.bin.mysql.exe'/>
<ComponentRef Id='C.bin.mysqladmin.exe'/>
<ComponentRef Id='C.bin.mysql_upgrade.exe'/>
@@ -551,20 +571,6 @@
</Component>
<?if $(var.HaveUpgradeWizard) != "0" ?>
<ComponentRef Id='C.bin.mysql_upgrade_wizard.exe'/>
- <!--
- <Component Id="c.shortcuts.upgrade_wizard" Guid="*" Directory="ShortcutFolder" Transitive="yes">
- <RegistryValue
- Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall"
- Name="shortcuts.upgrade_wizard"
- Value="1" Type="string" KeyPath="yes" />
- <Shortcut Id="shortcut.upgrade_wizard"
- Name="Upgrade Wizard (@CPACK_WIX_PACKAGE_NAME@)"
- Target="[INSTALLDIR]bin\mysql_upgrade_wizard.exe"
- Directory="ShortcutFolder"
- Description="Upgrades older instances of MariaDB/MySQL services to version @MAJOR_VERSION@.@MINOR_VERSION@"
- Advertise="no"/>
- </Component>
- -->
<?endif?>
</Feature>