Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ menu.tools.color_selector = Color Selector...
menu.tools.create_font = Create Font...
menu.tools.archive_sketch = Archive Sketch
menu.tools.fix_the_serial_lbrary = Fix the Serial Library
menu.tools.install_processing_java = Install “processing-java
menu.tools.install_processing_java=Install “processing”
# menu.tools.add_tool = Add Tool...
menu.tools.manage_tools = Manage Tools…

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_ar.properties
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ menu.tools.color_selector = أداة اختيار الألوان...
menu.tools.create_font = أداة صناعة الخطوط
menu.tools.archive_sketch = أرشفة المخطوط
menu.tools.fix_the_serial_lbrary = إصلاح مكتبة الاتصالات التسلسلية
menu.tools.install_processing_java = تثبيت"processing-java"
menu.tools.install_processing_java = تثبيت"processing"
menu.tools.add_tool = أضف أداة

# | File | Edit | Sketch | Debug | Tools | Help |
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_ca.properties
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ menu.tools.color_selector = Selector de color...
menu.tools.create_font = Creació de fonts tipogràfiques...
menu.tools.archive_sketch = Arxiva l'sketch
menu.tools.fix_the_serial_lbrary = Arregla la «Serial Library»
menu.tools.install_processing_java = Instal·la «processing-java»
menu.tools.install_processing_java = Instal·la «processing»
# menu.tools.add_tool = Afegeix una eina...
menu.tools.manage_tools = Gestiona les eines...

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ menu.tools.color_selector = Farbauswahl ...
menu.tools.create_font = Schrift erstellen ...
menu.tools.archive_sketch = Sketch archivieren ...
menu.tools.fix_the_serial_lbrary = "Serial Library" beheben ...
menu.tools.install_processing_java = "processing-java" installieren ...
menu.tools.install_processing_java="processing" installieren ...
#menu.tools.add_tool = Tool hinzufügen ...
menu.tools.manage_tools = Tools verwalten...

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_el.properties
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ menu.tools.color_selector = Επιλογή Χρώματος...
menu.tools.create_font = Δημιουργία Γραμματοσειράς...
menu.tools.archive_sketch = Αρχειοθέτηση Σχεδίου
menu.tools.fix_the_serial_lbrary = Διόρθωση Σειριακής Βιβλιοθήκης
menu.tools.install_processing_java = Εγκατάσταση της "processing-java"
menu.tools.install_processing_java = Εγκατάσταση της "processing"
menu.tools.add_tool = Προσθήκη Εργαλείου...

# | File | Edit | Sketch | Debug | Tools | Help |
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ menu.tools.color_selector = Selector de colores...
menu.tools.create_font = Crear fuente...
menu.tools.archive_sketch = Archivar sketch
menu.tools.fix_the_serial_lbrary = Corregir «Serial library»
menu.tools.install_processing_java = Instalar «processing-java»
menu.tools.install_processing_java = Instalar «processing»
# menu.tools.add_tool = Añadir herramienta...
menu.tools.manage_tools = Gestionar herramientas...

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ menu.tools.color_selector = Sélecteur de couleurs...
menu.tools.create_font = Générer la police...
menu.tools.archive_sketch = Archiver le sketch...
menu.tools.fix_the_serial_lbrary = Réparer la "Serial Library"...
menu.tools.install_processing_java = Installer "processing-java"...
menu.tools.install_processing_java = Installer "processing"...
menu.tools.add_tool = Ajouter un outil...

# | File | Edit | Sketch | Debug | Tools | Help |
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ menu.tools.color_selector = Selezionatore dei colori...
menu.tools.create_font = Crea Font...
menu.tools.archive_sketch = Archivia Sketch
menu.tools.fix_the_serial_lbrary = Ripara la "Serial Library"
menu.tools.install_processing_java = Installa "processing-java"
menu.tools.install_processing_java = Installa "processing"
menu.tools.add_tool = Aggiungi Strumento...

# | File | Edit | Sketch | Debug | Tools | Help |
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ menu.tools.color_selector = 色選択...
menu.tools.create_font = フォント作成...
menu.tools.archive_sketch = スケッチをアーカイブ
menu.tools.fix_the_serial_lbrary = シリアルライブラリを修正
menu.tools.install_processing_java = "processing-java" をインストール
menu.tools.install_processing_java = "processing" をインストール
menu.tools.add_tool = ツールを追加...

# | File | Edit | Sketch | Debug | Tools | Help |
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_ko.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ menu.tools.create_font = 글꼴 생성...
menu.tools.color_selector = 색상 선택
menu.tools.archive_sketch = .zip으로 압축하기
menu.tools.fix_the_serial_lbrary = 시리얼 라이브러리 오류 수정
menu.tools.install_processing_java = "processing-java" 설치
menu.tools.install_processing_java = "processing" 설치
menu.tools.add_tool = 추가도구 생성...

# | File | Edit | Sketch | Debug | Tools | Help |
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_nl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ menu.tools.color_selector = Kleur Selecteren...
menu.tools.create_font = Lettertype Maken...
menu.tools.archive_sketch = Schets Archiveren
menu.tools.fix_the_serial_lbrary = Seriële Bibliotheek Herstellen
menu.tools.install_processing_java = Installeren "processing-java"
menu.tools.install_processing_java = Installeren "processing"
menu.tools.add_tool = Tool Toevoegen...

# | File | Edit | Sketch | Debug | Tools | Help |
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_pt.properties
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ menu.tools.color_selector = Selector de Cor...
menu.tools.create_font = Criar Fonte...
menu.tools.archive_sketch = Arquivar Sketch
menu.tools.fix_the_serial_lbrary = Corrijir a Biblioteca Serial
menu.tools.install_processing_java = Instalar "processing-java"
menu.tools.install_processing_java = Instalar "processing"
menu.tools.add_tool = Adicionar Ferramenta...

# | File | Edit | Sketch | Debug | Tools | Help |
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ menu.tools.color_selector = Выбрать цвет...
menu.tools.create_font = Создать шрифты...
menu.tools.archive_sketch = Архивировать набросок
menu.tools.fix_the_serial_lbrary = Исправить библиотеку Serial
menu.tools.install_processing_java = Установить "processing-java"
menu.tools.install_processing_java = Установить "processing"
menu.tools.add_tool = Добавить инструмент...

# | File | Edit | Sketch | Debug | Tools | Help |
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_tr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ menu.tools.color_selector = Renk Seçici
menu.tools.create_font = Yazı Tipi Oluştur...
menu.tools.archive_sketch = Sketch'i Arşivle
menu.tools.fix_the_serial_lbrary = "Serial Kütüphanesi"ni Onar...
menu.tools.install_processing_java = "Processing-Java"yı Yükle...
menu.tools.install_processing_java = "Processing"yı Yükle...
menu.tools.add_tool = Araç Ekle...

# | File | Edit | Sketch | Debug | Tools | Help |
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_uk.properties
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ menu.tools.color_selector = Вибрати колір...
menu.tools.create_font = Створити шрифт...
menu.tools.archive_sketch = Архівувати ескіз
menu.tools.fix_the_serial_lbrary = Виправити Serial Library
menu.tools.install_processing_java = Встановити "processing-java"
menu.tools.install_processing_java = Встановити "processing"
# menu.tools.add_tool = Додати інструмент...
menu.tools.manage_tools = Керувати інструментами...

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_zh-CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ menu.tools.color_selector = 颜色选择器...
menu.tools.create_font = 创建字体...
menu.tools.archive_sketch = 速写本压缩输出
menu.tools.fix_the_serial_lbrary = 修复串口库文件
menu.tools.install_processing_java = 安装 "processing-java"
menu.tools.install_processing_java = 安装 "processing"
menu.tools.add_tool = 添加工具...

# | File | Edit | Sketch | Debug | Tools | Help |
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/languages/PDE_zh-TW.properties
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ menu.tools.color_selector = 顏色選擇器(Color Selector)...
menu.tools.create_font = 建字型檔(Create Font)...
menu.tools.archive_sketch = 壓縮程式專案(Archive Sketch)
menu.tools.fix_the_serial_library = 修復Serial函式庫(Fix the Serial Library)
menu.tools.install_processing_java = 安裝 "processing-java"
menu.tools.install_processing_java = 安裝 "processing"
menu.tools.add_tool = 新增工具(Add Tool)...

# | File | Edit | Sketch | Debug | Tools | Help |
Expand Down
64 changes: 34 additions & 30 deletions app/src/processing/app/tools/InstallCommander.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@

package processing.app.tools;

import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.PrintWriter;

import javax.swing.JOptionPane;

import processing.app.Base;
import processing.app.Language;
import processing.app.Messages;
Expand All @@ -36,6 +29,12 @@
import processing.core.PApplet;
import processing.data.StringList;

import javax.swing.*;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.PrintWriter;


public class InstallCommander implements Tool {
Base base;
Expand All @@ -55,26 +54,31 @@ public void run() {
try {
Editor editor = base.getActiveEditor();

final String primary =
"Install processing-java for all users?";
final String secondary =
"This will install the processing-java program, which is capable " +
"of building and running Java Mode sketches from the command line. " +
"Click “Yes” to install it for all users (an administrator password " +
"is required), or “No” to place the program in your home directory. " +
"If you rename or move Processing.app, " +
"you'll need to reinstall the tool.";
final String messageHtml = """
<html>
<head> <style type="text/css">
b { font: 13pt "Lucida Grande" }
p { font: 11pt "Lucida Grande"; margin-top: 8px; width: 200px }
</style> </head>
<b>Install processing for all users?</b>
<p>
This utility will install the processing command line interface,
which is capable of building and running
sketches from the command line.
<br><br>
Click “Yes” to install it for all users
(an administrator password is required).
<br><br>
or “No” to place the program in your home directory.
<br><br>
If you rename or move Processing.app,
you'll need to reinstall the tool.
</p>
""".replaceAll("\n", " ");

int result =
JOptionPane.showConfirmDialog(editor,
"<html> " +
"<head> <style type=\"text/css\">"+
"b { font: 13pt \"Lucida Grande\" }"+
"p { font: 11pt \"Lucida Grande\"; margin-top: 8px; width: 300px }"+
"</style> </head>" +
"<b>" + primary + "</b>" +
"<p>" + secondary + "</p>",
"Commander",
JOptionPane.showConfirmDialog(editor, messageHtml,
"Processing CLI",
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE);

Expand All @@ -92,7 +96,7 @@ public void run() {
var appBinary = (resourcesDir
.split("\\.app")[0] + ".app/Contents/MacOS/Processing")
.replaceAll(" ", "\\\\ ");
writer.print(appBinary + " cli $@");
writer.print(appBinary + " $@");

} else {
// Ant based distributable
Expand Down Expand Up @@ -130,7 +134,7 @@ public void run() {
// Moving to /usr/local/bin instead of /usr/bin for compatibility
// with OS X 10.11 and its "System Integrity Protection"
// https://github.com/processing/processing/issues/3497
String targetPath = "/usr/local/bin/processing-java";
String targetPath = "/usr/local/bin/processing";
// Remove the old version in case it exists
// https://github.com/processing/processing/issues/3786
String oldPath = "/usr/bin/processing-java";
Expand All @@ -139,14 +143,14 @@ public void run() {
" && /bin/mv " + sourcePath + " " + targetPath;
String appleScript =
"do shell script \"" + shellScript + "\" with administrator privileges";
PApplet.exec(new String[] { "osascript", "-e", appleScript });
PApplet.exec("osascript", "-e", appleScript);

} else if (result == JOptionPane.NO_OPTION) {
File targetFile = new File(System.getProperty("user.home"), "processing-java");
File targetFile = new File(System.getProperty("user.home"), "processing");
String targetPath = targetFile.getAbsolutePath();
if (targetFile.exists()) {
Messages.showWarning("File Already Exists",
"The processing-java program already exists at:\n" +
"The processing program already exists at:\n" +
targetPath + "\n" +
"Please remove it and try again.");
} else {
Expand Down