diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-07-14 10:44:52 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-08-04 09:46:53 +0200 |
commit | 4fb6c4ea4456a93cd3e75583a4087d6c6af44217 (patch) | |
tree | a5f397004712dc04ae5f9bf697c178cfc1a6fe38 | |
parent | 9338e908d37312a845e2573bb5d99774b9456f25 (diff) |
Add HKEY_CURRENT_USER registry integration.
It seems rather odd that we dump this to a file and parse again to me.
Conflicts:
configmgr/source/components.cxx
instsetoo_native/CustomTarget_setup.mk
scp2/source/ooo/common_brand.scp
Conflicts:
scp2/source/ooo/common_brand.scp
Change-Id: Ia32ba9ff3e7878d40032bd7d10fba2c143d11757
-rw-r--r-- | configmgr/source/components.cxx | 8 | ||||
-rw-r--r-- | configmgr/source/winreg.cxx | 5 | ||||
-rw-r--r-- | configmgr/source/winreg.hxx | 4 | ||||
-rw-r--r-- | scp2/source/ooo/common_brand.scp | 2 |
4 files changed, 12 insertions, 7 deletions
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 8dcf88dbab0b..8ba712570461 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -529,7 +529,7 @@ Components::Components( parseModificationLayer(url); } #ifdef WNT - else if ( type == "winreg" ) + else if (type == "winreg" || type == "winuserreg") { if (!url.isEmpty()) { SAL_WARN( @@ -537,8 +537,10 @@ Components::Components( "winreg URL is not empty, URL handling is not implemented for winreg"); } 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, data_, 0, 0, 0); layer++; osl::File::remove(aTempFileURL); diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx index 99886d6ff9ed..e19266925a50 100644 --- a/configmgr/source/winreg.cxx +++ b/configmgr/source/winreg.cxx @@ -190,10 +190,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/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp index e567574852f3..1c2738ead12f 100644 --- a/scp2/source/ooo/common_brand.scp +++ b/scp2/source/ooo/common_brand.scp @@ -1156,7 +1156,7 @@ ProfileItem gid_Brand_Profileitem_Fundamental_Configuration_Layers Section = "Bootstrap"; Key = "CONFIGURATION_LAYERS"; #if defined WNT - Value = "xcsxcu:${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/registry winreg: res:${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/registry 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 winreg: winuserreg: res:${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/registry 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"; #else Value = "xcsxcu:${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/registry res:${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/registry 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"; #endif |