[Libreoffice-commits] core.git: configmgr/source instsetoo_native/CustomTarget_setup.mk scp2/source
Michael Meeks
michael.meeks at collabora.com
Tue Jul 14 13:20:58 PDT 2015
configmgr/source/components.cxx | 7 +++++--
configmgr/source/winreg.cxx | 5 +++--
configmgr/source/winreg.hxx | 4 +++-
instsetoo_native/CustomTarget_setup.mk | 2 +-
scp2/source/ooo/common_brand.scp | 4 +++-
5 files changed, 15 insertions(+), 7 deletions(-)
New commits:
commit 097292feab4fc3c064983e1dd08ac4bebe1fe216
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Tue Jul 14 10:44:52 2015 +0100
Add HKEY_CURRENT_USER registry integration.
It seems rather odd that we dump this to a file and parse again to me.
Change-Id: Ia32ba9ff3e7878d40032bd7d10fba2c143d11757
Reviewed-on: https://gerrit.libreoffice.org/17033
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 4b1eaea..9e19ef9 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 a5723d7..455c711 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 0209772..fb880ac 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 44c3001..e3f645b 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 6bf7b30..5c83584 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
More information about the Libreoffice-commits
mailing list