Skip to content

Commit f6d1610

Browse files
committed
Fix Windows registry editing argument quoting
When we want a literal double-quote symbol within the registry value, we need to escape it with backslash. In the Java source, we need to escape backslash and quote symbols when within a string literal, so: In Java code: "\\\"something.exe\\\" registry value -> "something.exe"
1 parent b30f10a commit f6d1610

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void install(final String scheme, final String executablePath) throws IOE
100100
{"reg", "add", keyPath, "/v", "URL Protocol", "/f"},
101101
{"reg", "add", shellPath, "/f"},
102102
{"reg", "add", openPath, "/f"},
103-
{"reg", "add", commandPath, "/ve", "/d", "\"" + executablePath + "\" \"%1\"", "/f"}
103+
{"reg", "add", commandPath, "/ve", "/d", "\\\"" + executablePath + "\\\" \\\"%1\\\"", "/f"}
104104
};
105105

106106
// Execute commands

0 commit comments

Comments
 (0)