Changeset 2262


Ignore:
Timestamp:
02/14/07 14:20:03 (13 years ago)
Author:
curtis
Message:

Fix Windows browser launching.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/visbio/util/BrowserLauncher.java

    r1390 r2262  
    200200 
    201201  /** 
    202    * The first parameter that needs to be passed into Runtime.exec() 
     202   * The parameter that needs to be passed into Runtime.exec() 
    203203   * to open the default web browser on Windows. 
    204204   */ 
    205   private static final String FIRST_WINDOWS_PARAMETER = "/c"; 
    206  
    207   /** The second parameter for Runtime.exec() on Windows. */ 
    208   private static final String SECOND_WINDOWS_PARAMETER = "start"; 
    209  
    210   /** 
    211    * The third parameter for Runtime.exec() on Windows.  This is a "title" 
    212    * parameter that the command line expects.  Setting this parameter allows 
    213    * URLs containing spaces to work. 
    214    */ 
    215   private static final String THIRD_WINDOWS_PARAMETER = "\"\""; 
     205  private static final String WINDOWS_PARAMETER = 
     206    "url.dll,FileProtocolHandler"; 
    216207 
    217208  /** 
     
    547538        break; 
    548539      case WINDOWS_NT: 
    549         theBrowser = "cmd.exe"; 
    550         break; 
    551540      case WINDOWS_9X: 
    552         theBrowser = "command.com"; 
     541        theBrowser = "rundll32"; 
    553542        break; 
    554543      case OTHER: 
     
    646635          // characters to work. 
    647636        Process process = Runtime.getRuntime().exec(new String[] { 
    648           (String) browser, FIRST_WINDOWS_PARAMETER, SECOND_WINDOWS_PARAMETER, 
    649           THIRD_WINDOWS_PARAMETER, '"' + url + '"' 
     637          (String) browser, WINDOWS_PARAMETER, '"' + url + '"' 
    650638        }); 
    651639        // This avoids a memory leak on some versions of Java on Windows. 
Note: See TracChangeset for help on using the changeset viewer.