platformMap['win32'] = '"../bin/nircmdc.exe" savescreenshot "' + filePathAbs + '"';
这样计算路径是相对于当前工作目录计算的。注意工作目录与可执行程序目录不一定相同,在这种情况下会导致出错。
更正建议:
platformMap['win32'] = '"' + path.resolve(__dirname, '../bin/nircmdc.exe') +'" savescreenshot "' + filePathAbs + '"';
platformMap['win32'] = '"../bin/nircmdc.exe" savescreenshot "' + filePathAbs + '"';
这样计算路径是相对于当前工作目录计算的。注意工作目录与可执行程序目录不一定相同,在这种情况下会导致出错。
更正建议:
platformMap['win32'] = '"' + path.resolve(__dirname, '../bin/nircmdc.exe') +'" savescreenshot "' + filePathAbs + '"';