mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-17 13:15:44 +02:00
- fixed NPE on Linux
This commit is contained in:
parent
8d8ae63dbe
commit
8143e89a59
1 changed files with 5 additions and 1 deletions
|
@ -58,6 +58,7 @@ public class MingwEnvironmentVariableSupplier implements
|
||||||
private IBuildEnvironmentVariable path;
|
private IBuildEnvironmentVariable path;
|
||||||
|
|
||||||
public static IPath getBinDir() {
|
public static IPath getBinDir() {
|
||||||
|
|
||||||
IPath subPath = new Path("mingw\\bin");
|
IPath subPath = new Path("mingw\\bin");
|
||||||
// 1. Try the mingw directory in the platform install directory
|
// 1. Try the mingw directory in the platform install directory
|
||||||
IPath installPath = new Path(Platform.getInstallLocation().getURL().getFile());
|
IPath installPath = new Path(Platform.getInstallLocation().getURL().getFile());
|
||||||
|
@ -71,7 +72,10 @@ public class MingwEnvironmentVariableSupplier implements
|
||||||
return binPath;
|
return binPath;
|
||||||
|
|
||||||
// 3. Try looking if the mingw installer ran
|
// 3. Try looking if the mingw installer ran
|
||||||
String mingwPath = WindowsRegistry.getRegistry().getLocalMachineValue(
|
WindowsRegistry registry = WindowsRegistry.getRegistry();
|
||||||
|
if (registry==null) return null; // probably not even windows
|
||||||
|
|
||||||
|
String mingwPath = registry.getLocalMachineValue(
|
||||||
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW",
|
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW",
|
||||||
"InstallLocation");
|
"InstallLocation");
|
||||||
if (mingwPath != null) {
|
if (mingwPath != null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue