Skip to content

Commit

Permalink
[DDW-691] Add try/catch and get launcher exe
Browse files Browse the repository at this point in the history
  • Loading branch information
tomislavhoracek committed Oct 14, 2021
1 parent 5a5fc38 commit 6590cf3
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions source/main/index.js
Expand Up @@ -260,25 +260,30 @@ const onAppReady = async () => {
);

if (process.platform === 'win32') {
logger.info('[Custom-Protocol] Set Windows protocol params: ', {
execPath: process.execPath,
argv: process.argv,
process,
processEnv: process.env,
processEnvPath: process.env.PATH,
});
logger.info(`[Custom-Protocol] Current working directory is: ${process.cwd()}`, {
cwd: process.cwd(),
execPath: path.dirname(process.execPath),
});
const cardanoLauncherExe = path.resolve(path.dirname(process.execPath), '..', 'cardano-launcher.exe')
logger.info(`[Custom-Protocol] cardano-launcher.exe: ${cardanoLauncherExe}`, {
cardanoLauncherExe,
});
/* app.setAsDefaultProtocolClient('web+cardano', process.execPath, [
process.argv[1],
]); */
app.setAsDefaultProtocolClient('web+cardano', cardanoLauncherExe);
logger.info('[Custom-Protocol] SET WINDOWS PROTOCOL')
try {
logger.info('[Custom-Protocol] Set Windows protocol params: ', {
execPath: process.execPath,
argv: process.argv,
processEnv: process.env,
processEnvPath: process.env.PATH,
});
logger.info("[Custom-Protocol] Current working directory is: ${process.cwd()}", {
cwd: process.cwd(),
execPath: path.dirname(process.execPath),
});
const cardanoLauncherExe = path.resolve(path.dirname(process.execPath), '..', 'cardano-launcher.exe')
logger.info("[Custom-Protocol] cardano-launcher.exe:", {
cardanoLauncherExe,
});
/* app.setAsDefaultProtocolClient('web+cardano', process.execPath, [
process.argv[1],
]); */
app.setAsDefaultProtocolClient('web+cardano', cardanoLauncherExe);
} catch (e) {
logger.info('[Custom-Protocol] SET WINDOWS PROTOCOL - has error');
logger.info('[Custom-Protocol] SET WINDOWS PROTOCOL - ERROR: ', { e });
}
} else {
logger.info('[Custom-Protocol] Set Mac / Linux protocol params: ', {
platform: process.platform,
Expand Down

0 comments on commit 6590cf3

Please sign in to comment.