解决可执行文件的问题

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

View File

@ -57,19 +57,11 @@ function IconExtractor(){
function getPlatformIconProcess(){ function getPlatformIconProcess(){
if (os.type() == 'Windows_NT') { if (os.type() == 'Windows_NT') {
// return path.join(__dirname, 'bin', 'IconExtractor.exe');
let exeSrc = path.join(__dirname,'/bin/IconExtractor.exe'); return path.join(__dirname.replace(/(unsafe-\w+\.asar)/,'$1.unpacked'), 'bin', 'IconExtractor.exe')
let exeDst = path.join(os.tmpdir(), 'IconExtractor.exe'); //Do stuff here to get the icon that doesn't have the shortcut thing on it
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;
//Do stuff here to get the icon that doesn't have the shortcut thing on it
} else { } else {
throw('This platform (' + os.type() + ') is unsupported =('); throw('This platform (' + os.type() + ') is unsupported =(');
} }
} }