--- /tmp/bzr-diff-a1Mf8n/old/src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebDriver.java
+++ /home/rfb/projects/fwd/3821c_dev/src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebDriver.java
@@ -160,6 +160,8 @@
 ** 068 CA  20201011 Use a fast-access bitmap instead of an integer set.
 **     EVL 20201027 Replacing hash map usage with simple array for storing scale cache to improve search time.
 **     SBI 20210304 Changed openMimeResource according to its new specification.
+**     RFB 20210316 Added handling of launcher protocol/mime-type using openLauncherResource helper for
+**                  openMimeResource.
 */
 
 /*
@@ -225,6 +227,7 @@
 import java.io.*;
 import java.lang.reflect.*;
 import java.net.*;
+import java.nio.charset.StandardCharsets;
 import java.nio.channels.*;
 import java.nio.file.*;
 import java.util.function.*;
@@ -270,6 +273,12 @@
            DocumentOutputStorage,
            FileUploadStorage
 {
+   /** Special mime-type for the launcher. */
+   private static final String LAUNCHER_MIME_TYPE = "application/fwd-local-launcher";
+
+   /** Special scheme for launcher URI. */
+   private static final String LAUNCHER_SCHEME = "launcher://";
+
    /** Taskbar height in pixels when it exists. */
    public static final int TASKBAR_HEIGHT = 32;
    
@@ -2752,9 +2761,45 @@
                                 boolean embedded)
    throws URISyntaxException
    {
-      Uri wrappedUri = new Uri(uriString);
-      URI uri = wrappedUri.getUri();
-      boolean local = wrappedUri.isLocal();
+      URI uri;
+      boolean finalDelete = deleteContent;
+      String finalUri = uriString;
+      boolean finalEmbedded = embedded;
+      boolean local = true;
+      String launchFilePath = uriString;
+      String scheme = "file:///";
+      
+      try
+      {
+         uri = new URI(uriString);
+         scheme = uri.getScheme();
+         launchFilePath = uri.getPath();
+      }
+      catch(URISyntaxException e)
+      {
+         if (LAUNCHER_MIME_TYPE.equalsIgnoreCase(mimeType))
+         {
+             launchFilePath = uriString;
+         }
+      }
+      
+      if (LAUNCHER_MIME_TYPE.equalsIgnoreCase(mimeType) || LAUNCHER_SCHEME.equalsIgnoreCase(scheme))
+      {
+         finalDelete = true;
+         finalEmbedded = false;
+         try
+         {
+            finalUri = openLauncherResource(UiUtils.resolveLocalFileResource(launchFilePath));
+         }
+         catch(IOException e)
+         {
+             finalUri = uriString;
+         }
+      }
+      
+      Uri wrappedUri = new Uri(finalUri);
+      uri = wrappedUri.getUri();
+      local = wrappedUri.isLocal();
       
       String id = uri.toASCIIString();
       
@@ -2762,10 +2807,10 @@
       {
          File originalFile = Paths.get(uri).toFile();
          
-         id = resolveResourceId(deleteContent, mimeType, originalFile);
-      }
-      
-      websock.openMimeResource(id, mimeType, embedded, local);
+         id = resolveResourceId(finalDelete, mimeType, originalFile);
+      }
+      
+      websock.openMimeResource(id, mimeType, finalEmbedded, local);
    }
    
    /**
@@ -3090,6 +3135,36 @@
    }
    
    /**
+    * Create the wrapper for the launcher resource.
+    * 
+    * @param    uriString
+    *           The string presentation of the target resource.
+    * 
+    * @throws   IOException
+    *           If this string presentation of the target resource is not formatted strictly
+    *           according to to RFC2396 and cannot be converted to a URI.
+    * @throws   RuntimeException
+    *           For other IO errors during file operations.
+    */
+   private String openLauncherResource(String uriString)
+   throws IOException
+   {
+      Path wrapperFile  = Files.createTempFile("launcher", ".fwl");
+   
+      try
+      {
+         Files.write(wrapperFile, uriString.getBytes(StandardCharsets.UTF_8));
+         //wrapperFile.deleteOnExit();            
+      }
+      catch (IOException e)
+      {
+         e.printStackTrace();
+      }
+      
+      return "file:///" + wrapperFile.toString();
+   }
+   
+   /**
     * Detect MIME type of image.
     * 
     * @param   icon

