| | |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | |
| | | Component.prototype.operationForLinux = function() |
| | | { |
| | | var params = "Name=mbc" + "\n"; |
| | | params += "Icon=@TargetDir@/logo.png " + "\n"; |
| | | params += "Version=@Version@" + "\n"; |
| | | params += "Exec=@TargetDir@/mbc" + "\n"; |
| | | params += "Terminal=false" + "\n"; |
| | | params += "Encoding=UTF-8" + "\n"; |
| | | params += "Type=Application" + "\n"; |
| | | params += "Categories=Network" + "\n"; |
| | | |
| | | var desktop = "mbc" + ".desktop"; |
| | | component.addOperation("CreateDesktopEntry", desktop, params); |
| | | |
| | | var homeDir = installer.environmentVariable("HOME"); |
| | | if(homeDir.length > 0){ |
| | | //获取XDG_DATA_HOME环境变量 |
| | | var deskTopSaveDir = installer.environmentVariable("XDG_DATA_HOME"); |
| | | |
| | | if(deskTopSaveDir.length === 0){ |
| | | //XDG_DATA_HOME环境变量不存在,则查找固定目录下 |
| | | if(installer.fileExists(homeDir + "/.local/share/applications/mbc.desktop")){ |
| | | deskTopSaveDir = homeDir + "/.local/share/"; |
| | | } |
| | | } |
| | | if(deskTopSaveDir.length > 0){ |
| | | component.addOperation("Copy", deskTopSaveDir+"/applications/" + desktop, homeDir + "/Desktop/"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | Component.prototype.createOperations = function() |
| | | { |
| | |
| | | component.addOperation("Execute", "@TargetDir@/mbwatch.exe", "-i", ""); |
| | | component.addOperation("Execute", "@TargetDir@/mbwatch.exe", "start", ""); |
| | | |
| | | }else{ |
| | | // |
| | | } |
| | | |
| | | if(systemInfo.kernelType === "linux"){ |
| | | this.operationForLinux(); |
| | | |
| | | component.addOperation("Execute", "@TargetDir@/mbwatch", "-i", ""); |
| | | component.addOperation("Execute", "@TargetDir@/mbwatch", "start", ""); |
| | | } |
| | | } |
| | | |
| | | |
| | | } catch(e) { |