Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions arduino-core/src/processing/app/BaseNoGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import cc.arduino.Compiler;
import cc.arduino.Constants;
import cc.arduino.UploaderUtils;
import cc.arduino.contributions.DownloadableContribution;
import cc.arduino.contributions.GPGDetachedSignatureVerifier;
import cc.arduino.contributions.SignatureVerificationFailedException;
import cc.arduino.contributions.libraries.LibrariesIndexer;
Expand Down Expand Up @@ -853,15 +854,18 @@ public static void createToolPreferences(Collection<ContributedTool> installedTo
}

for (ContributedTool tool : installedTools) {
File installedFolder = tool.getDownloadableContribution(getPlatform()).getInstalledFolder();
String absolutePath;
if (installedFolder != null) {
absolutePath = installedFolder.getAbsolutePath();
} else {
absolutePath = Constants.PREF_REMOVE_PLACEHOLDER;
DownloadableContribution dlContrib = tool.getDownloadableContribution(getPlatform());
if (dlContrib != null) {
File installedFolder = dlContrib.getInstalledFolder();
String absolutePath;
if (installedFolder != null) {
absolutePath = installedFolder.getAbsolutePath();
} else {
absolutePath = Constants.PREF_REMOVE_PLACEHOLDER;
}
PreferencesData.set(prefix + tool.getName() + ".path", absolutePath);
PreferencesData.set(prefix + tool.getName() + "-" + tool.getVersion() + ".path", absolutePath);
}
PreferencesData.set(prefix + tool.getName() + ".path", absolutePath);
PreferencesData.set(prefix + tool.getName() + "-" + tool.getVersion() + ".path", absolutePath);
}
}

Expand Down