mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
@ -97,16 +97,17 @@ public class LibraryInstaller {
|
|||||||
rescanLibraryIndex(progress);
|
rescanLibraryIndex(progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void install(ContributedLibrary lib, ContributedLibrary replacedLib) throws Exception {
|
public void install(ContributedLibrary lib, ContributedLibrary replacedLib) {
|
||||||
if (lib.isInstalled()) {
|
if (lib.isInstalled()) {
|
||||||
throw new Exception(_("Library is already installed!"));
|
System.out.println(_("Library is already installed: \"" + lib.getName() + "\""));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final MultiStepProgress progress = new MultiStepProgress(3);
|
final MultiStepProgress progress = new MultiStepProgress(3);
|
||||||
|
|
||||||
// Step 1: Download library
|
// Step 1: Download library
|
||||||
try {
|
try {
|
||||||
downloader.download(lib, progress, _("Downloading library."));
|
downloader.download(lib, progress, _("Downloading library: \"" + lib.getName() + "\""));
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
// Download interrupted... just exit
|
// Download interrupted... just exit
|
||||||
return;
|
return;
|
||||||
@ -117,7 +118,7 @@ public class LibraryInstaller {
|
|||||||
// all the temporary folders and abort installation.
|
// all the temporary folders and abort installation.
|
||||||
|
|
||||||
// Step 2: Unpack library on the correct location
|
// Step 2: Unpack library on the correct location
|
||||||
progress.setStatus(_("Installing library..."));
|
progress.setStatus(_("Installing library: \"" + lib.getName() + "\""));
|
||||||
onProgress(progress);
|
onProgress(progress);
|
||||||
File libsFolder = indexer.getSketchbookLibrariesFolder();
|
File libsFolder = indexer.getSketchbookLibrariesFolder();
|
||||||
File tmpFolder = FileUtils.createTempFolderIn(libsFolder);
|
File tmpFolder = FileUtils.createTempFolderIn(libsFolder);
|
||||||
@ -148,7 +149,7 @@ public class LibraryInstaller {
|
|||||||
final MultiStepProgress progress = new MultiStepProgress(2);
|
final MultiStepProgress progress = new MultiStepProgress(2);
|
||||||
|
|
||||||
// Step 1: Remove library
|
// Step 1: Remove library
|
||||||
progress.setStatus(_("Removing library..."));
|
progress.setStatus(_("Removing library: \"" + lib.getName() + "\""));
|
||||||
onProgress(progress);
|
onProgress(progress);
|
||||||
FileUtils.recursiveDelete(lib.getInstalledFolder());
|
FileUtils.recursiveDelete(lib.getInstalledFolder());
|
||||||
progress.stepDone();
|
progress.stepDone();
|
||||||
|
Reference in New Issue
Block a user