
	var cordova = require('cordova'),
		fileOpener2 = require('./FileOpener2');

	var schemes = [
        { protocol: 'ms-app', getFile: getFileFromApplicationUri },
        { protocol: 'file:///', getFile: getFileFromFileUri }
	]

	function getFileFromApplicationUri(uri) {
	    var applicationUri = new Windows.Foundation.Uri(uri);

	    return Windows.Storage.StorageFile.getFileFromApplicationUriAsync(applicationUri);
	}

	function getFileFromFileUri(uri) {
	    var path = Windows.Storage.ApplicationData.current.localFolder.path +
                        uri.substr(8);

	    return getFileFromNativePath(path);
	}

	function getFileFromNativePath(path) {
	    var nativePath = path.split("/").join("\\");

	    return Windows.Storage.StorageFile.getFileFromPathAsync(nativePath);
	}

	function getFileLoaderForScheme(path) {
	    var fileLoader = getFileFromNativePath;

	    schemes.some(function (scheme) {
	        return path.indexOf(scheme.protocol) === 0 ? ((fileLoader = scheme.getFile), true) : false;
	    });

	    return fileLoader;
	}

	module.exports = {

	    open: function (successCallback, errorCallback, args) {
	        var path = args[0];
	        
	        var getFile = getFileLoaderForScheme(path);

	        getFile(path).then(function (file) {
	            var options = new Windows.System.LauncherOptions();

	            Windows.System.Launcher.launchFileAsync(file, options).then(function (success) {
	                if (success) {
	                    successCallback();
	                } else {
	                    errorCallback();
	                }
	            });

	        }, function (errror) {
	            console.log("Error abriendo el archivo");
	        });
		}
		
	};

	require("cordova/exec/proxy").add("FileOpener2", module.exports);


@@ -182,16 +182,15 @@
 l: '
+cdv
 file
-:///
 ', g
@@ -221,55 +221,497 @@
 ri %7D
-%0A%09%5D%0A%0A%09function getFileFromApplicationUri(uri) %7B
+    //protocol cdvfile%0A%09%5D%0A%0A%09function nthIndex(str, pat, n) %7B%0A%09    var L = str.length, i = -1;%0A%09    while (n-- && i++ %3C L) %7B%0A%09        i = str.indexOf(pat, i);%0A%09        if (i %3C 0) break;%0A%09    %7D%0A%09    return i;%0A%09%7D%0A%0A%09function getFileFromApplicationUri(uri) %7B%0A%09    /* bad path from a file entry due to the last '//' %0A               example: ms-appdata:///local//path/to/file%0A            */%0A%09    var index = nthIndex(uri, %22//%22, 3);%0A%09    var newUri = uri.substr(0, index) + uri.substr(index + 1);%0A
 %0A%09  
@@ -760,17 +760,20 @@
 ion.Uri(
-u
+newU
 ri);%0A%0A%09 
@@ -857,16 +857,17 @@
 ionUri);
+;
 %0A%09%7D%0A%0A%09fu
@@ -900,27 +900,415 @@
 uri) %7B%0A%09    
-var
+/* uri example:%0A               cdvfile://localhost/persistent%7Ctemporary%7Canother-fs-root/path/to/file%0A            */%0A%09    var indexFrom = nthIndex(uri, %22/%22, 3) + 1;%0A%09    var indexTo = nthIndex(uri, %22/%22, 4);%0A%09    var whichFolder = uri.substring(indexFrom, indexTo);%0A%09    var filePath = uri.substr(indexTo + 1);%0A%09    var path = %22%5C%5C%22 + filePath;%0A%0A%09    if (whichFolder == %22persistent%22) %7B%0A%09       
  path = Wind
@@ -1365,47 +1365,167 @@
 th +
-%0A
+ path;%0A%09
     
+%7D%0A%09
     
-                uri.substr(8);
+else %7B  //temporary, note: no roaming management%0A%09        path = Windows.Storage.ApplicationData.current.temporaryFolder.path + path;%0A%09    %7D
 %0A%0A%09 
@@ -2078,24 +2078,34 @@
 ck, args) %7B%0A
+%09        %0A
 %09        var
@@ -2184,16 +2184,25 @@
 (path);%0A
+%09        
 %0A%09      
@@ -2305,16 +2305,29 @@
 ions();%0A
+%09            
 %0A%09      
@@ -2387,20 +2387,20 @@
 ptions).
-then
+done
 (functio
@@ -2434,44 +2434,8 @@
     
-if (success) %7B%0A%09                    
 succ
@@ -2466,26 +2466,31 @@
     
-    %7D else %7B%0A%09    
+%7D, function (error) %7B%0A%09
     
@@ -2519,29 +2519,15 @@
 ack(
-);%0A%09                %7D
+error);
 %0A%09  
@@ -2566,17 +2566,16 @@
 ion (err
-r
 or) %7B%0A%09 
@@ -2608,28 +2608,39 @@
 ror 
-abriendo el archivo%22
+while opening the file: %22+error
 );%0A%09

Update fileOpener2Proxy.js