File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/main/java/org/scijava/plugins/platforms/windows Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -55,11 +55,18 @@ public String osName() {
5555 @ Override
5656 public void open (final URL url ) throws IOException {
5757 final String cmd ;
58+ final String arg ;
59+ // NB: the cmd and arg separate is necessary for Windows OS
60+ // to open the default browser correctly.
5861 if (System .getProperty ("os.name" ).startsWith ("Windows 2000" )) {
59- cmd = "rundll32 shell32.dll,ShellExec_RunDLL" ;
62+ cmd = "rundll32" ;
63+ arg = "shell32.dll,ShellExec_RunDLL" ;
6064 }
61- else cmd = "rundll32 url.dll,FileProtocolHandler" ;
62- if (getPlatformService ().exec (cmd , url .toString ()) != 0 ) {
65+ else {
66+ cmd = "rundll32" ;
67+ arg = "url.dll,FileProtocolHandler" ;
68+ }
69+ if (getPlatformService ().exec (cmd , arg , url .toString ()) != 0 ) {
6370 throw new IOException ("Could not open " + url );
6471 }
6572 }
You can’t perform that action at this time.
0 commit comments