|  |  |  | @ -70,36 +70,7 @@ app.post('/createShortcut', (req, res) => { | 
			
		
	
		
			
				
					|  |  |  |  |     fs.unlinkSync(shortcutLinkPath); | 
			
		
	
		
			
				
					|  |  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   // 快捷方式的配置
 | 
			
		
	
		
			
				
					|  |  |  |  |   const config = { | 
			
		
	
		
			
				
					|  |  |  |  |     name: shortcutName, | 
			
		
	
		
			
				
					|  |  |  |  |     exec: 'x-www-browser', | 
			
		
	
		
			
				
					|  |  |  |  |     // icon: '/path/to/favicon.png', // 图标路径,可选
 | 
			
		
	
		
			
				
					|  |  |  |  |     icon: '', | 
			
		
	
		
			
				
					|  |  |  |  |     url: shortcutURL, | 
			
		
	
		
			
				
					|  |  |  |  |     terminal: false, | 
			
		
	
		
			
				
					|  |  |  |  |     type: 'Application', | 
			
		
	
		
			
				
					|  |  |  |  |     categories: 'Network;WebBrowser;' | 
			
		
	
		
			
				
					|  |  |  |  |   }; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   // 快捷方式文件内容
 | 
			
		
	
		
			
				
					|  |  |  |  |   let desktopFileContent = `[Desktop Entry]
 | 
			
		
	
		
			
				
					|  |  |  |  |   Name=${config.name} | 
			
		
	
		
			
				
					|  |  |  |  |   Exec=${config.exec} ${config.url} | 
			
		
	
		
			
				
					|  |  |  |  |   Type=${config.type} | 
			
		
	
		
			
				
					|  |  |  |  |   Icon=${config.icon || ''} | 
			
		
	
		
			
				
					|  |  |  |  |   Terminal=${config.terminal} | 
			
		
	
		
			
				
					|  |  |  |  |   Categories=${config.categories} | 
			
		
	
		
			
				
					|  |  |  |  |   Comment=Open ${config.name} in your web browser`;
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   // 如果有图标路径,确保图标文件存在
 | 
			
		
	
		
			
				
					|  |  |  |  |   // if (config.icon && !fs.existsSync(config.icon)) {
 | 
			
		
	
		
			
				
					|  |  |  |  |   //   console.error('Icon file does not exist.');
 | 
			
		
	
		
			
				
					|  |  |  |  |   //   process.exit(1);
 | 
			
		
	
		
			
				
					|  |  |  |  |   // }
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   // 创建快捷方式文件
 | 
			
		
	
		
			
				
					|  |  |  |  |   fs.writeFile(shortcutLinkPath, desktopFileContent, 'utf8', function (err) { | 
			
		
	
		
			
				
					|  |  |  |  |   fs.symlink(shortcutURL, shortcutLinkPath, 'file', (err) => { | 
			
		
	
		
			
				
					|  |  |  |  |     if (err) { | 
			
		
	
		
			
				
					|  |  |  |  |       console.error(err); | 
			
		
	
		
			
				
					|  |  |  |  |       res.status(500).send('安装失败!'); | 
			
		
	
	
		
			
				
					|  |  |  | @ -108,7 +79,36 @@ app.post('/createShortcut', (req, res) => { | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  |   }); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   // fs.symlink(shortcutURL, shortcutLinkPath, 'file', (err) => {
 | 
			
		
	
		
			
				
					|  |  |  |  |   // // 快捷方式的配置
 | 
			
		
	
		
			
				
					|  |  |  |  |   // const config = {
 | 
			
		
	
		
			
				
					|  |  |  |  |   //   name: shortcutName,
 | 
			
		
	
		
			
				
					|  |  |  |  |   //   exec: 'x-www-browser',
 | 
			
		
	
		
			
				
					|  |  |  |  |   //   // icon: '/path/to/favicon.png', // 图标路径,可选
 | 
			
		
	
		
			
				
					|  |  |  |  |   //   icon: '',
 | 
			
		
	
		
			
				
					|  |  |  |  |   //   url: shortcutURL,
 | 
			
		
	
		
			
				
					|  |  |  |  |   //   terminal: false,
 | 
			
		
	
		
			
				
					|  |  |  |  |   //   type: 'Application',
 | 
			
		
	
		
			
				
					|  |  |  |  |   //   categories: 'Network;WebBrowser;'
 | 
			
		
	
		
			
				
					|  |  |  |  |   // };
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   // // 快捷方式文件内容
 | 
			
		
	
		
			
				
					|  |  |  |  |   // let desktopFileContent = `[Desktop Entry]
 | 
			
		
	
		
			
				
					|  |  |  |  |   // Name=${config.name}
 | 
			
		
	
		
			
				
					|  |  |  |  |   // Exec=${config.exec} ${config.url}
 | 
			
		
	
		
			
				
					|  |  |  |  |   // Type=${config.type}
 | 
			
		
	
		
			
				
					|  |  |  |  |   // Icon=${config.icon || ''}
 | 
			
		
	
		
			
				
					|  |  |  |  |   // Terminal=${config.terminal}
 | 
			
		
	
		
			
				
					|  |  |  |  |   // Categories=${config.categories}
 | 
			
		
	
		
			
				
					|  |  |  |  |   // Comment=Open ${config.name} in your web browser`;
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   // // 如果有图标路径,确保图标文件存在
 | 
			
		
	
		
			
				
					|  |  |  |  |   // // if (config.icon && !fs.existsSync(config.icon)) {
 | 
			
		
	
		
			
				
					|  |  |  |  |   // //   console.error('Icon file does not exist.');
 | 
			
		
	
		
			
				
					|  |  |  |  |   // //   process.exit(1);
 | 
			
		
	
		
			
				
					|  |  |  |  |   // // }
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   // // 创建快捷方式文件
 | 
			
		
	
		
			
				
					|  |  |  |  |   // fs.writeFile(shortcutLinkPath, desktopFileContent, 'utf8', function (err) {
 | 
			
		
	
		
			
				
					|  |  |  |  |   //   if (err) {
 | 
			
		
	
		
			
				
					|  |  |  |  |   //     console.error(err);
 | 
			
		
	
		
			
				
					|  |  |  |  |   //     res.status(500).send('安装失败!');
 | 
			
		
	
	
		
			
				
					|  |  |  | 
 |