3

Tried many time and many solution but all give me the same problem. Everything works just fine, the app works and no issues with it, it's just the shourtcut that is not being created on Desktop. I can see from the log files 'EmulateFileIOPermissionChecks' and a message error 'The given path's format is not supported.' but not sure what it means. I experienced the same error with this module "electron-squirrel-startup". Here is what is happening related to SquirrelSetup.log

2018-06-28 17:56:15> Program: Starting Squirrel Updater: --createShortcut C:\Users\name\AppData\Local\myApp\app-0.1.0\myapp.exe
2018-06-28 17:56:15> ApplyReleasesImpl: About to create shortcuts for 
C:\Users\user\AppData\Local\myApp\app-0.1.0\myapp.exe, rootAppDir 
C:\Users\user\AppData\Local\idpAuthElectronApp 2018-06-28 17:56:15> Unhandled exception: System.NotSupportedException: The given path's format is not supported. atSystem.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath) at 
System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess 
access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean 
checkHost)
 at System.IO.Directory.CreateDirectory(String path)

And Here is my code:

var handleSquirrelEvent = function() {

if (process.platform != 'win32') {
  return false;
}

function executeSquirrelCommand(args, done) {
  var updateDotExe = path.resolve(path.dirname(process.execPath), '..', 'update.exe');
  var child = cp.spawn(updateDotExe, args, { detached: true });

  child.on('close', function(code) {
     done();
  });
  };

function install(done) {
  var target = path.resolve(process.execPath);
  executeSquirrelCommand(['--createShortcut', target], done);
};

function uninstall(done) {
  var target = path.resolve(process.execPath);
  executeSquirrelCommand(["--removeShortcut", target], done);
};

var squirrelEvent = process.argv[1];

switch (squirrelEvent) {

  case '--squirrel-install':

     install(app.quit);

     return true;

  case '--squirrel-updated':

     install(app.quit);

     return true;

  case '--squirrel-obsolete':

     app.quit();

     return true;

  case '--squirrel-uninstall':
     uninstall(app.quit);
     return true;
}
 return false;
};

if (handleSquirrelEvent()) {
 return;
}
itismelito
  • 245
  • 3
  • 11

0 Answers0