Skip to content

Commit 637a42b

Browse files
ctruedenclaude
andcommitted
Fail gracefully if no app executable is set
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e379f8d commit 637a42b

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

src/main/java/org/scijava/desktop/DefaultDesktopService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ private void maybeAutoInstallDesktopIntegrations() {
288288
prefs.getBoolean(DesktopService.class, "installedOnce", false);
289289
if (installedOnce) return;
290290

291+
// Without a launcher binary, there is nothing to register.
292+
if (System.getProperty("scijava.app.executable") == null) return;
293+
291294
// We haven't installed the integration before now! So here we go.
292295
// We use a dedicated thread to avoid blocking context creation completion;
293296
// nothing in the desktop registration needs to be completed synchronously;

src/main/java/org/scijava/desktop/platform/linux/LinuxPlatform.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,7 @@ public void syncDesktopIntegration(final boolean webLinks,
202202

203203
// An executable is required for any feature to work.
204204
final String appExec = System.getProperty("scijava.app.executable");
205-
if (appExec == null) {
206-
throw new IOException(
207-
"No executable path set (scijava.app.executable property)");
208-
}
205+
if (appExec == null) return;
209206

210207
final DesktopFile df = new DesktopFile(path);
211208

src/main/java/org/scijava/desktop/platform/windows/WindowsPlatform.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ public void setWebLinksEnabled(final boolean enable) throws IOException {
111111
final WindowsSchemeInstaller installer = new WindowsSchemeInstaller(log);
112112
final String executablePath = System.getProperty("scijava.app.executable");
113113

114-
if (executablePath == null) {
115-
throw new IOException("No executable path set (scijava.app.executable property)");
116-
}
114+
if (executablePath == null) return;
117115

118116
final Set<String> schemes = schemes();
119117
for (final String scheme : schemes) {
@@ -183,9 +181,7 @@ public boolean isFileExtensionsToggleable() {
183181
@Override
184182
public void setFileExtensionsEnabled(final boolean enable) throws IOException {
185183
final String executablePath = System.getProperty("scijava.app.executable");
186-
if (executablePath == null) {
187-
throw new IOException("No executable path set (scijava.app.executable property)");
188-
}
184+
if (executablePath == null) return;
189185

190186
final String executableName = getExecutableName();
191187
if (executableName == null) {

0 commit comments

Comments
 (0)