|
|
|
@ -70,13 +70,16 @@ app.post('/createShortcut', (req, res) => {
|
|
|
|
|
// fs.unlinkSync(shortcutLinkPath);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
fs.linkSync(shortcutURL, shortcutLinkPath);
|
|
|
|
|
res.status(200).send('安装成功!');
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error(err);
|
|
|
|
|
res.status(500).send('安装失败!');
|
|
|
|
|
}
|
|
|
|
|
console.log('shortcutURL', shortcutURL);
|
|
|
|
|
console.log('shortcutLinkPath', shortcutLinkPath);
|
|
|
|
|
fs.symlink(shortcutURL, shortcutLinkPath, 'file', (err) => {
|
|
|
|
|
if (err) {
|
|
|
|
|
console.error(err);
|
|
|
|
|
res.status(500).send('安装失败');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
res.send('安装成功');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// // 快捷方式的配置
|
|
|
|
|
// const config = {
|
|
|
|
|