Skip to content

Commit 1adcbdc

Browse files
author
jantje
committed
#1070 Parent of arduinoPlugin folder does not need to be writable
1 parent 1360659 commit 1adcbdc

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

io.sloeber.core/src/io/sloeber/core/Activator.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,25 @@ private static void testKnownIssues() {
124124
String errorString = new String();
125125
String addString = new String();
126126
IPath installPath = ConfigurationPreferences.getInstallationPath();
127-
if (!installPath.toFile().getParentFile().canWrite()) {
128-
errorString += addString + "The plugin Needs write access to " + installPath.toString();
129-
addString = "\nand\n";
127+
File installFile = installPath.toFile();
128+
if (installFile.exists()) {
129+
if (!installFile.canWrite()) {
130+
errorString += addString + "The folder " + installPath.toString()
131+
+ " exists but Sloeber does not have write access to it.";
132+
addString = "\nand\n";
133+
}
134+
} else {
135+
if (!installFile.getParentFile().canWrite()) {
136+
errorString += addString + "Sloeber does not have write access to "
137+
+ installFile.getParentFile().toString() + " and therefore can not create the folder "
138+
+ installPath.toString();
139+
addString = "\nand\n";
140+
}
130141
}
131142

132143
if (installPathToLong()) {
133144
errorString += errorString + addString;
134-
errorString += "Due to issues with long pathnames on Windows, the plugin installation path must be less than 40 characters. \n";
145+
errorString += "Due to issues with long pathnames on Windows, the Sloeber installation path must be less than 40 characters. \n";
135146
errorString += "Your current path: " + installPath.toString();
136147
errorString += " is too long and the plugin will no longer function correctly for all packages.";
137148
errorString += "Please visit issue #705 for details. https://github.com/Sloeber/arduino-eclipse-plugin/issues/705";

0 commit comments

Comments
 (0)