diff options
-rw-r--r-- | configmgr/source/components.cxx | 7 | ||||
-rw-r--r-- | configmgr/source/winreg.cxx | 5 | ||||
-rw-r--r-- | configmgr/source/winreg.hxx | 4 | ||||
-rw-r--r-- | instsetoo_native/CustomTarget_setup.mk | 2 | ||||
-rw-r--r-- | scp2/source/ooo/common_brand.scp | 4 |
5 files changed, 15 insertions, 7 deletions
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 4b1eaeabfeaf..9e19ef94024a 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -537,13 +537,16 @@ Components::Components( ++layer; //TODO: overflow #endif #if defined WNT - } else if (type == "winreg") { + } else if (type == "winreg" || type == "winuserreg") { if (!url.isEmpty()) { throw css::uno::RuntimeException( "CONFIGURATION_LAYERS: non-empty \"winreg\" URL"); } OUString aTempFileURL; - if (dumpWindowsRegistry(&aTempFileURL)) { + WinRegType eType = WinRegType::LOCAL_MACHINE; + if (type == "winuserreg") + eType = WinRegType::CURRENT_USER; + if (dumpWindowsRegistry(&aTempFileURL, eType)) { parseFileLeniently(&parseXcuFile, aTempFileURL, layer, 0, 0, 0); osl::File::remove(aTempFileURL); } diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx index a5723d7588ef..455c7119f329 100644 --- a/configmgr/source/winreg.cxx +++ b/configmgr/source/winreg.cxx @@ -188,10 +188,11 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString aKeyName, oslFileHandle aFileHan } } -bool dumpWindowsRegistry(OUString* pFileURL) +bool dumpWindowsRegistry(OUString* pFileURL, WinRegType eType) { HKEY hKey; - if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\LibreOffice", 0, KEY_READ, &hKey) != ERROR_SUCCESS) + HKEY hDomain = eType == LOCAL_MACHINE ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; + if(RegOpenKeyExW(hDomain, L"SOFTWARE\\Policies\\LibreOffice", 0, KEY_READ, &hKey) != ERROR_SUCCESS) { SAL_INFO( "configmgr", diff --git a/configmgr/source/winreg.hxx b/configmgr/source/winreg.hxx index 020977262beb..fb880ac0c564 100644 --- a/configmgr/source/winreg.hxx +++ b/configmgr/source/winreg.hxx @@ -13,7 +13,9 @@ namespace configmgr { -bool dumpWindowsRegistry(OUString* pFileURL); +enum WinRegType { LOCAL_MACHINE, CURRENT_USER }; + +bool dumpWindowsRegistry(OUString* pFileURL, WinRegType eType); } diff --git a/instsetoo_native/CustomTarget_setup.mk b/instsetoo_native/CustomTarget_setup.mk index 44c30019dbf4..e3f645b99d6c 100644 --- a/instsetoo_native/CustomTarget_setup.mk +++ b/instsetoo_native/CustomTarget_setup.mk @@ -48,7 +48,7 @@ $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_ && echo 'BRAND_BASE_DIR=$${ORIGIN}/..' \ && echo 'BRAND_INI_DIR=$${ORIGIN}' \ && echo 'BRAND_SHARE_SUBDIR=$(LIBO_SHARE_FOLDER)' \ - && echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/$(LIBO_SHARE_FOLDER)/registry res:$${BRAND_BASE_DIR}/$(LIBO_SHARE_FOLDER)/registry $(if $(ENABLE_DCONF),dconf: )$(if $(filter WNT,$(OS)),winreg: )bundledext:$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno):BUNDLED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini sharedext:$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno):SHARED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini userext:$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno):UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini user:$${$$BRAND_BASE_DIR/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,bootstrap):UserInstallation}/user/registrymodifications.xcu' \ + && echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/$(LIBO_SHARE_FOLDER)/registry res:$${BRAND_BASE_DIR}/$(LIBO_SHARE_FOLDER)/registry $(if $(ENABLE_DCONF),dconf: )$(if $(filter WNT,$(OS)),winreg: )bundledext:$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno):BUNDLED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini sharedext:$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno):SHARED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini userext:$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno):UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini $(if $(filter WNT,$(OS)),winuserreg: )user:$${$$BRAND_BASE_DIR/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,bootstrap):UserInstallation}/user/registrymodifications.xcu' \ && echo 'LO_JAVA_DIR=$${BRAND_BASE_DIR}/$(LIBO_SHARE_JAVA_FOLDER)' \ && echo 'LO_LIB_DIR=$${BRAND_BASE_DIR}/$(LIBO_LIB_FOLDER)' \ && echo 'BAK_EXTENSIONS=$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):TMP_EXTENSIONS}' \ diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp index 6bf7b30b8179..5c835846c502 100644 --- a/scp2/source/ooo/common_brand.scp +++ b/scp2/source/ooo/common_brand.scp @@ -1125,15 +1125,17 @@ End #endif #if defined WNT #define CONFIGURATION_LAYERS_WINREG " winreg:" +#define CONFIGURATION_LAYERS_WINUSERREG " winuserreg:" #else #define CONFIGURATION_LAYERS_WINREG +#define CONFIGURATION_LAYERS_WINUSERREG #endif ProfileItem gid_Brand_Profileitem_Fundamental_Configuration_Layers ProfileID = gid_Brand_Profile_Fundamental_Ini; ModuleID = gid_Module_Root_Brand; Section = "Bootstrap"; Key = "CONFIGURATION_LAYERS"; - Value = "xcsxcu:${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/registry res:${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/registry" CONFIGURATION_LAYERS_WINREG " bundledext:${${BRAND_BASE_DIR}/" LIBO_ETC_FOLDER "/" PROFILENAME(louno) ":BUNDLED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini sharedext:${${BRAND_BASE_DIR}/" LIBO_ETC_FOLDER "/" PROFILENAME(louno) ":SHARED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini userext:${${BRAND_BASE_DIR}/" LIBO_ETC_FOLDER "/" PROFILENAME(louno) ":UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini user:${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" PROFILENAME(bootstrap) ":UserInstallation}/user/registrymodifications.xcu"; + Value = "xcsxcu:${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/registry res:${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/registry" CONFIGURATION_LAYERS_WINREG " bundledext:${${BRAND_BASE_DIR}/" LIBO_ETC_FOLDER "/" PROFILENAME(louno) ":BUNDLED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini sharedext:${${BRAND_BASE_DIR}/" LIBO_ETC_FOLDER "/" PROFILENAME(louno) ":SHARED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini userext:${${BRAND_BASE_DIR}/" LIBO_ETC_FOLDER "/" PROFILENAME(louno) ":UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini " CONFIGURATION_LAYERS_WINUSERREG " user:${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" PROFILENAME(bootstrap) ":UserInstallation}/user/registrymodifications.xcu"; End #undef CONFIGURATION_LAYERS_DCONF #undef CONFIGURATION_LAYERS_WINREG |