!function(){if("undefined"!=typeof process){require("nw.gui").Window.get().maximize();var e=require("fs"),o=require("path"),n=require("qyutil"),i=o.join(process.cwd(),"log"),l=o.join(i,"client_log.txt");n.ensureDir(i),global.log=function(){e.appendFileSync(l,n.getLogLine(arguments)+"\n")},console.log=global.log,console.info=console.log,console.error=console.log;var c,r=process.platform;"win32"==r?c="taskkill /im qynwnode.exe":"linux"==r&&(c="pkill qynwnode");var s=require("child_process");process.on("exit",function(){"win32"==r?s.execSync(c):s.exec(c),console.log("closing client")}),process.on("uncaughtException",function(e){console.log("Caught exception: "+e)})}}();