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@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
This commit is contained in:
Michael Meeks
2015-07-14 20:20:32 +00:00
committed by Andras Timar
parent 0a7375e372
commit 097292feab
5 changed files with 15 additions and 7 deletions
+5 -2
View File
@@ -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);
}
+3 -2
View File
@@ -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",
+3 -1
View File
@@ -13,7 +13,9 @@
namespace configmgr {
bool dumpWindowsRegistry(OUString* pFileURL);
enum WinRegType { LOCAL_MACHINE, CURRENT_USER };
bool dumpWindowsRegistry(OUString* pFileURL, WinRegType eType);
}
+1 -1
View File
@@ -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}' \
+3 -1
View File
@@ -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