diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-02-15 08:31:49 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-02-15 23:21:48 +0100 |
commit | 1104be609f2847387da2da16c4dd1be624f1c858 (patch) | |
tree | 43cb7ed049b9f7c9793d91ead4c06d5ae24a7604 | |
parent | 926a200f0aaed63dda3c019da246720350a3e246 (diff) |
Find Java 9 with the new registry keys on Windowscp-5.3-40
See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37-
4D12-AB10-49F82F720027> section "Windows Registry Key Changes".
Reviewed-on: https://gerrit.libreoffice.org/49792
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit cc8e8215c8d7583f36feca20f0a1235edc05a6d7)
Conflicts:
jvmfwk/plugins/sunmajor/pluginlib/util.cxx
Change-Id: Ic30ce430663cc1608c6268fa937142f73c55f138
Reviewed-on: https://gerrit.libreoffice.org/49822
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 72 |
1 files changed, 43 insertions, 29 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index d1a0088f1510..062abf494f0a 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -577,35 +577,6 @@ bool decodeOutput(const OString& s, OUString* out) #if defined(_WIN32) -void addJavaInfoFromWinReg( - std::vector<rtl::Reference<VendorBase> > & allInfos, - std::vector<rtl::Reference<VendorBase> > & addedInfos) -{ - // Get Java s from registry - std::vector<OUString> vecJavaHome; - if(getSDKInfoFromRegistry(vecJavaHome)) - { - // create impl objects - typedef std::vector<OUString>::iterator ItHome; - for(ItHome it_home= vecJavaHome.begin(); it_home != vecJavaHome.end(); - ++it_home) - { - getAndAddJREInfoByPath(*it_home, allInfos, addedInfos); - } - } - - vecJavaHome.clear(); - if(getJREInfoFromRegistry(vecJavaHome)) - { - typedef std::vector<OUString>::iterator ItHome; - for(ItHome it_home= vecJavaHome.begin(); it_home != vecJavaHome.end(); - ++it_home) - { - getAndAddJREInfoByPath(*it_home, allInfos, addedInfos); - } - } -} - bool getJavaInfoFromRegistry(const wchar_t* szRegKey, vector<OUString>& vecJavaHome) @@ -687,6 +658,49 @@ bool getJREInfoFromRegistry(vector<OUString>& vecJavaHome) return getJavaInfoFromRegistry(HKEY_SUN_JRE, vecJavaHome); } +void addJavaInfoFromWinReg( + std::vector<rtl::Reference<VendorBase> > & allInfos, + std::vector<rtl::Reference<VendorBase> > & addedInfos) +{ + // Get Java s from registry + std::vector<OUString> vecJavaHome; + if(getSDKInfoFromRegistry(vecJavaHome)) + { + // create impl objects + typedef std::vector<OUString>::iterator ItHome; + for(ItHome it_home= vecJavaHome.begin(); it_home != vecJavaHome.end(); + ++it_home) + { + getAndAddJREInfoByPath(*it_home, allInfos, addedInfos); + } + } + + vecJavaHome.clear(); + if(getJREInfoFromRegistry(vecJavaHome)) + { + typedef std::vector<OUString>::iterator ItHome; + for(ItHome it_home= vecJavaHome.begin(); it_home != vecJavaHome.end(); + ++it_home) + { + getAndAddJREInfoByPath(*it_home, allInfos, addedInfos); + } + } + + vecJavaHome.clear(); + if (getJavaInfoFromRegistry(L"Software\\JavaSoft\\JDK", vecJavaHome)) { + for (auto const & javaHome: vecJavaHome) { + getAndAddJREInfoByPath(javaHome, allInfos, addedInfos); + } + } + + vecJavaHome.clear(); + if (getJavaInfoFromRegistry(L"Software\\JavaSoft\\JRE", vecJavaHome)) { + for (auto const & javaHome: vecJavaHome) { + getAndAddJREInfoByPath(javaHome, allInfos, addedInfos); + } + } +} + #endif // WNT void bubbleSortVersion(vector<rtl::Reference<VendorBase> >& vec) |