解决可执行文件的问题

This commit is contained in:
fofolee 2019-04-24 19:29:57 +08:00
parent 54cf06b932
commit dba776a002

View File

@ -57,16 +57,8 @@ function IconExtractor(){
function getPlatformIconProcess(){
if (os.type() == 'Windows_NT') {
let exeSrc = path.join(__dirname,'/bin/IconExtractor.exe');
let exeDst = path.join(os.tmpdir(), 'IconExtractor.exe');
let dllSrc = path.join(__dirname,'/bin/Newtonsoft.Json.dll');
let dllDst = path.join(os.tmpdir(), 'Newtonsoft.Json.dll');
if (!fs.existsSync(exeDst)) {
fs.writeFileSync(exeDst, fs.readFileSync(exeSrc));
fs.writeFileSync(dllDst, fs.readFileSync(dllSrc));
}
return exeDst;
// return path.join(__dirname, 'bin', 'IconExtractor.exe');
return path.join(__dirname.replace(/(unsafe-\w+\.asar)/,'$1.unpacked'), 'bin', 'IconExtractor.exe')
//Do stuff here to get the icon that doesn't have the shortcut thing on it
} else {
throw('This platform (' + os.type() + ') is unsupported =(');