import Unix from './Unix' import Path from 'path' var fs= core.System.IO.Fs.async import OsxWriter from './OsxWriter' class OsxInstall extends Unix{ getConfig(){ return this._conf } async generateIconAsync(conf, installConfig){ conf.binStr= this._binStr this._conf= conf var desktop, writer= new OsxWriter(this), sym await writer.copy() // Crear acceso en escritorio ... desktop= Path.join(process.env.HOME, "desktop") sym= Path.join(desktop, conf.name || conf.id) if(await fs.exists(sym)) await fs.unlink(sym) await fs.symlink(writer.path, sym) this._conf.appInstalledPath= writer.path } async generateAutoStart(conf, installConfig){ var path, text, f, file= Path.join(__dirname, "osx-autostart", "autostart.plist.es6") f= require(file).default text= f(this._conf) if(!this.local) path= Path.join("/Library/LaunchAgents/", conf.uid + ".plist") else path= Path.join(process.env.HOME, "Library/LaunchAgents/", conf.uid + ".plist") await fs.writeFile(path, text) } } export default OsxInstall