diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-02-15 08:31:49 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-02-15 12:53:04 +0100 |
commit | cc8e8215c8d7583f36feca20f0a1235edc05a6d7 (patch) | |
tree | ea3f7a7bf9eca3d53a023862b78a48c4c2ca56ad | |
parent | bf10acd917dab972b461960720cd044527e22f16 (diff) |
Find Java 9 with the new registry keys on Windows
See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37-
4D12-AB10-49F82F720027> section "Windows Registry Key Changes".
Change-Id: Ic30ce430663cc1608c6268fa937142f73c55f138
Reviewed-on: https://gerrit.libreoffice.org/49792
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 64 |
1 files changed, 39 insertions, 25 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index fb6ec2ba6eb4..187a2789b4cc 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -569,31 +569,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 - for (auto const& javaHome : vecJavaHome) - { - getAndAddJREInfoByPath(javaHome, allInfos, addedInfos); - } - } - - vecJavaHome.clear(); - if(getJREInfoFromRegistry(vecJavaHome)) - { - for (auto const& javaHome : vecJavaHome) - { - getAndAddJREInfoByPath(javaHome, allInfos, addedInfos); - } - } -} - bool getJavaInfoFromRegistry(const wchar_t* szRegKey, vector<OUString>& vecJavaHome) @@ -678,6 +653,45 @@ 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 + for (auto const& javaHome : vecJavaHome) + { + getAndAddJREInfoByPath(javaHome, allInfos, addedInfos); + } + } + + vecJavaHome.clear(); + if(getJREInfoFromRegistry(vecJavaHome)) + { + for (auto const& javaHome : vecJavaHome) + { + getAndAddJREInfoByPath(javaHome, 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) |