node-auto-launch
node-auto-launch copied to clipboard
TypeError: Path must be a string. Received undefined
- The target platform(s) the problem occurs on (Linux, Mac, Mac App Store, and or Windows): Windows 8.1
- Node version (run
node -v
): 7.7.4 - auto-launch version: 5.0.3
- The options you're passing to auto-launch:
- Are you using NW.js or Electron?
Electron
- If so, which version? 1.7.9
- If you're using Electron, are you using auto-launch from the main process or a renderer process? main
- Can you reproduce this with a simple Hello World example app?
- If needs be, would you be able to provide us with a simple app (as simple as possible) which reproduces the problem?
const launcher = new AutoLaunch({
name: result.productName,
path: 'C:\\Program Files\\test\\service\\6.0.177\\test.exe',
isHidden: true
});
try {
await launcher.enable();
log.info(MODULE_NAME, `auto-launch ${result.productName} successfully!`);
} catch (error) {
log.error(MODULE_NAME, `auto-launch ${result.productName} failed! ${error}`);
}```
I also tried to remove `path` but it's the same result
to whoever uses Electron and wants to do auto-launch, Electron has native support for this functionality. Here is the doc for that https://electronjs.org/docs/api/app#appgetloginitemsettingsoptions-macos-windows
@4ver can you get someone to test on Windows?
have a look! dependencies: auto-launch -> AutoLaunchWindows -> winreg -> getRegExePath . path.join(process.env.windir, 'system32', 'reg.exe'); process.env.windir is undefined.
you should use auto-launch module in main process, I solved this problem