function qystart(){function e(){var e=i.existsSync(o.join(process.cwd(),"/config/install.js"))||i.existsSync(o.join(process.cwd(),"/config/newVersion.js"));return e}var n=require("qyutil"),i=require("fs"),o=(require("nw.gui"),require("path")),t=require("child_process"),r="",s={log:function(e){r&&(r+="<br>");r+=e;document.body.innerHTML=r}},c=o.join(process.cwd(),"log"),l=o.join(c,"nwpid.txt"),d=o.join(c,"client_log.txt");n.ensureDir(c);i.existsSync(d)&&i.unlinkSync(d);var w,a;if("win32"==process.platform){w="taskkill /f /im qynwnode.exe";a="qynwnode.exe qynwserver.js"}else if("linux"==process.platform){w="pkill qynwnode";a="./qynwnode qynwserver.js"}else if("darwin"==process.platform){w="pkill qynwnode";a="./qynwnode qynwserver.js"}t.exec(w,function(){i.existsSync(l)&&i.unlinkSync(l);var n=i.watch(c,function(r,l){if("nwpid.txt"==l){n.close();e()?window.location.href="http://127.0.0.1:1337/qiyun/gamemei_sln_new/gamemei/index.html?clear=true":window.location.href="http://127.0.0.1:1337/qiyun/gamemei_sln_new/gamemei/index.html?clear=false";var d=i.watch(c,function(e,n){if("doUpdate.txt"==n){d.close();var r=i.watch(c,function(e,n){if("updated.txt"==n){r.close();t.exec(a,{cwd:o.join(process.cwd(),"bin")},function(e,n,i){n&&s.log("stdout: "+n);i&&s.log("stderr: "+i)})}})}})}});t.exec(a,{cwd:o.join(process.cwd(),"bin")},function(e,n,i){n&&s.log("stdout: "+n);i&&s.log("stderr: "+i)})})}