//!wrt $BSPEC:{"icn":null,"cpr":"Copyright (C) Windows 96 Team 2021.","dsc":"Windows 96 Shell","frn":"shell36","ver":1,"ssy":"gui"}

const{Taskbar:Taskbar,NotifyIcon:NotifyIcon}=w96.shell,{flags:Flags,execCmd:execCmd,execFile:execFile,MobileDeviceConfiguration:MobileDeviceConfiguration,loader:Loader}=w96.sys,{WindowSystem:WindowSystem,sysConf:SCM}=w96,{klog:klog,gfxEl:gfxEl,cover:cover}=current.boxedEnv,{FSView:FSView}=w96.ui.components,{Theme:Theme,MsgBoxSimple:MsgBoxSimple,ContextMenu:ContextMenu,OpenFileDialog:OpenFileDialog,DialogCreator:DialogCreator}=w96.ui,{escapeHtml:escapeHtml,argParser:ArgParser,blobToDataURI:blobToDataURI}=w96.util,DESKTOP_CONFIG_DEFAULT={background:{type:"local",bg:"c:/system/wallpapers/default.jpg"},misc:{hookMetaKeys:!1}},START_MENU_CONFIG={text:"Windows 96",items:[{name:"Programs",type:"dir-menu",path:"C:/system/programs",command:"explorer C:/system/programs",icon:"places/folder-programs",dirEntryIcon:"places/folder-prgm"},{name:"Documents",type:"dir-menu",path:"C:/user/documents",command:"explorer C:/user/documents",icon:"places/documents"},{name:"Settings",type:"normal",command:"ctrl",icon:"apps/settings"},{type:"separator"},{name:"Device Config",type:"normal",command:"ctrl --cpl devcfg",icon:"apps/touchcfg"},{name:"Help",type:"normal",command:"internete https://wiki.windows96.net",icon:"objects/help-book"},{name:"Run",type:"normal",command:"run",icon:"apps/run"},{type:"separator"},{name:"Reboot",type:"normal",command:"reboot",icon:"apps/shutdown"},{name:"Reset",type:"normal",command:"resetwiz",icon:"apps/reinstall"},{type:"separator"},{name:"About",type:"normal",command:"about-ui",icon:"apps/about"}]};async function folder2ContextMenu(e,t="places/folder"){var o=[];const n=await FS.readdir(e),i=await n.aFilter((async e=>await FS.isFile(e))),s=await n.aFilter((async e=>!await FS.isFile(e))),a=function(e,t){return FSUtil.fname(e)<FSUtil.fname(t)?-1:FSUtil.fname(e)>FSUtil.fname(t)?1:0};return i.sort(a),s.sort(a),await s.aForEach((async e=>{o.push({type:"submenu",id:Math.floor(1e3*Math.random()).toString(),label:FSUtil.fname(e),icon:await Theme.getIconUrl(t,"16x16"),items:await folder2ContextMenu(e),onclick:e=>{e.preventDefault(),e.stopPropagation()}})})),await i.aForEach((async e=>{var t=await Theme.getFileIconUrl(e,"16x16"),n=FSUtil.fname(e);if(e.endsWith(".link"))try{n=n.split(".").slice(0,-1).join(".");const o=JSON.parse(await FS.readstr(e));o.icon_small?t=o.icon_small.startsWith("data:")?o.icon_small:await Theme.getIconUrl(o.icon_small):o.icon?t=o.icon.startsWith("data:")?o.icon:await Theme.getIconUrl(o.icon,"16x16",null!=o.iconFmt?o.iconFmt:"png"):await FS.exists(o.action)&&(t=await Theme.getFileIconUrl(o.action,"16x16",null!=o.iconFmt?o.iconFmt:"png"))}catch(e){console.log(e),t="system/resource/misc/missing.png"}o.push({type:"normal",icon:t,label:n,onclick:(e,t)=>{execFile(t),startClose()},tag:e})})),o}let smConfig={...START_MENU_CONFIG},isStartOpen=!1;function startOpen(){if(isStartOpen)return;const e=document.createElement("div");e.classList.add("shell36-start-menu","oc-event-exempt"),e.style.bottom=Theme.uiVars.taskbarHeight-3+"px";const t=document.createElement("div");t.classList.add("sidebar"),t.textContent=smConfig.text,e.appendChild(t);const o=document.createElement("div");o.classList.add("item-container");for(let e of smConfig.items){if("separator"==e.type){const e=document.createElement("div");e.classList.add("w96-ui-inset-separator"),o.appendChild(e);continue}const t=document.createElement("div");t.classList.add("item");const n=document.createElement("div");n.classList.add("icon"),Theme.getIconUrl(e.icon,"24x24").then((e=>{n&&(n.style.backgroundImage=`url(${e})`)})),t.appendChild(n);const i=document.createElement("div");i.classList.add("text"),i.textContent=e.name,t.appendChild(i),e.command&&t.addEventListener("click",(()=>{startClose();const t=ArgParser.parse(e.command),o=t[0];t.shift(),execCmd(o,t)})),"dir-menu"==e.type&&null!=e.path?(t.classList.add("sub"),t.addEventListener("mouseenter",(async o=>{if(t.classList.contains("active"))return;document.querySelectorAll(".shell36-start-menu .active").forEach((e=>e.classList.remove("active"))),t.classList.add("active"),document.querySelectorAll(".wcontext-menu").forEach((e=>e.remove()));const n=t.getBoundingClientRect(),i=await folder2ContextMenu(e.path,null!=e.dirEntryIcon?e.dirEntryIcon:void 0);if(!isStartOpen)return;document.querySelectorAll(".wcontext-menu").forEach((e=>e.remove()));new ContextMenu(i).renderMenu(n.right,n.top)}))):t.addEventListener("mouseenter",(async e=>{document.querySelectorAll(".shell36-start-menu .active").forEach((e=>e.classList.remove("active"))),document.querySelectorAll(".wcontext-menu").forEach((e=>e.remove()))})),o.appendChild(t)}document.querySelectorAll(".w96-menubar>.root-item.selected").forEach((e=>e.classList.remove("selected"))),e.appendChild(o),gfxEl.appendChild(e),isStartOpen=!0,w96.evt.shell.emit("start-opened",e)}function startClose(){const e=document.querySelector(".shell36-start-menu");e&&e.remove();const t=document.querySelector(".start_button.sb-active");t&&t.classList.remove("sb-active"),isStartOpen=!1,w96.evt.shell.emit("start-closed")}function startToggle(){startIsOpen()?startClose():startOpen()}function startIsOpen(){return isStartOpen}const StartMenu={open:startOpen,close:startClose,toggle:startToggle,isOpen:startIsOpen};let errorNI,taskbar,fsView,iconDesktop,clockInt=0;function initializeErrorNotifyIcon(){window.onerror=async function(e){Flags.has("exclaim_exceptions")&&MsgBoxSimple.error("JavaScript Runtime Error",`An exception has occured during the current session of Windows 96.<br><br>\n            <div style="border-style: inset; border-width: 1px; height: 30px; overflow: auto;" class="w96-panel">\n            Exception: ${e}\n            </div>`,"OK").setSize(320,156),null==errorNI&&(errorNI=new NotifyIcon({iconUrl:await Theme.getIconUrl("status/error","16x16")}),Taskbar.registerNotifyIcon(errorNI)),errorNI.onclick=function(){MsgBoxSimple.error("JavaScript Runtime Error",`An exception has occured during the current session of Windows 96.<br><br>\n            <div style="border-style: inset; border-width: 1px; height: 30px; overflow: auto;" class="w96-panel">\n            Exception: ${escapeHtml(new String(e))}\n            </div>`,"OK").setSize(320,156)},w96.sys.log.log("Exception Caught: "+new String(e),"System","error")}}function chkTimeDigit(e){return e<10?"0"+e:e}function initializeClock(){if(0!==clockInt)return;const e=()=>{const e=new Date,t=taskbar.querySelector(".notify-time");if(WindowSystem.getConfig().features.use12hTime){var o=e.getHours(),n=o>12?o-12:o;t.innerHTML=`${0===n?12:n}:${chkTimeDigit(e.getMinutes())} &nbsp;${o>=12?"PM":"AM"}`}else t.innerText=`${chkTimeDigit(e.getHours())}:${chkTimeDigit(e.getMinutes())}`};clockInt=setInterval(e,1e3),e()}function setupTaskbar(){taskbar=document.createElement("div"),taskbar.classList.add("user-taskbar","slideInUp");const e=document.createElement("div");e.classList.add("taskbar-notify");const t=document.createElement("span");t.classList.add("notify-time","notify-item"),t.innerText="00:00",e.appendChild(t),taskbar.appendChild(e);const o=document.createElement("div");o.classList.add("taskbar-tasks"),taskbar.appendChild(o);const n=document.createElement("div");n.classList.add("separator"),taskbar.appendChild(n);const i=document.createElement("button");i.classList.add("start_button","w96-button"),i.addEventListener("click",(()=>{StartMenu.toggle(),StartMenu.isOpen()?i.classList.add("sb-active"):i.classList.remove("sb-active")})),taskbar.appendChild(i)}async function showNewShortcutDialog(e){let t;const o=new StandardWindow({title:"New Shortcut",initialHeight:115,initialWidth:320,resizable:!1,controlBoxStyle:"WS_CBX_CLOSE",body:`\n        <div class="p1">\n            <button class="w96-button icon-box" style="background-image: url(${await Theme.getIconUrl("mime/unknown")})"></button>\n        </div>\n        <div class="p2">\n            <div class="field"><span>Name</span><input class="w96-textbox name"></div>\n            <div class="field"><span>Command</span><input class="w96-textbox cmd"></div>\n            <button class="w96-button cancel">Cancel</button><button class="w96-button create">Create</button>\n        </div>`,bodyClass:"dlg-newshortcut",center:!0}),n=o.getBodyContainer(),i=n.querySelector("button.icon-box");i.setAttribute("img","W:/"+await Theme.getIconUrl("mime/unknown")),n.querySelector("button.cancel").addEventListener("click",(()=>o.close())),n.querySelector("button.create").addEventListener("click",(async()=>{const t=n.querySelector(".w96-textbox.name").value,s=n.querySelector(".w96-textbox.cmd").value;null!=t&&""!=t.trim()&&null!=s&&""!=s.trim()||MsgBoxSimple.error("Invalid shortcut","Cannot create shortcut, missing data.","OK"),n.querySelector("button.create").disabled=!0,await FS.writestr(`${e}/${t}.link`,JSON.stringify({icon:i.getAttribute("img"),action:s})),w96.evt.ui.emit("reload-desktop"),o.close()})),i.addEventListener("click",(()=>{var e;new OpenFileDialog(null!==(e=Theme.registeredThemes[Theme.currentTheme].iconTheme)&&void 0!==e?e:"C:/",[".png",".PNG",".gif",".GIF",".jpg",".JPG"],(async e=>{if(null==e)return;const o=await FS.toBlob(e);null!=t&&URL.revokeObjectURL(t);const n=URL.createObjectURL(o);i.style.backgroundImage=`url(${n})`,t=n,i.setAttribute("img",e)})).show()})),o.show(),await o.wait(),URL.revokeObjectURL(t)}let iconRegistry=[],_ui_delete_busy=!1;const specialIcons=[{name:"Computer",path:"c:/user/desktop",icon:"devices/computer",id:"computer"},{name:"Documents",path:"c:/user/desktop",icon:"places/documents",id:"documents"},{name:"Recycle Bin",path:"c:/user/desktop",icon:"places/trash-full",id:"trash"}];function updateIconPosition(e,t){const o=iconRegistry.find((t=>t.name==e));o&&iconRegistry.splice(iconRegistry.indexOf(o),1),iconRegistry.push({name:e,pos:t});try{FS.writestr("c:/system/config/deskicn.json",JSON.stringify(iconRegistry))}catch(e){console.log(e)}}async function setupIconDesktop(){fsView=new FSView("c:/user/desktop",!1),await fsView.init();try{await FS.exists("c:/system/config/deskicn.json")&&(iconRegistry=JSON.parse(await FS.readstr("c:/system/config/deskicn.json",iconRegistry)))}catch(e){console.error(e)}fsView.options.enableNavigation=!1,fsView.options.showHiddenFiles=!1,fsView.options.metaLookup=!1,fsView.options.alignMode="desktop",fsView.options.specialIcons=specialIcons,fsView.options.iconMovement="free",fsView.options.storedIconPositions=iconRegistry;const e=fsView.getElement();e.classList.add("user-desktop"),e.style.height=`calc(100% - ${Theme.uiVars.taskbarHeight})`}async function uiDelete(){const e=fsView.getElement(),t=[...e.querySelectorAll(".shell-icon.selected")].map((e=>e.getAttribute("path")));if(!(t.length<1)){for(let e of t)if("C:/user/desktop"!==FSUtil.getParentPath(e))return;if(!_ui_delete_busy){_ui_delete_busy=!0;try{await execCmd("recyclui",t)}catch(e){console.error(e)}e.focus(),_ui_delete_busy=!1,w96.evt.ui.emit("reload-desktop")}}}function assignDesktopEvents(){const e=fsView.getElement(),t=()=>w96.evt.ui.emit("reload-desktop");fsView.onclipboard=t,fsView.ondropfinish=t,fsView.onrefreshneeded=t,fsView.onicondrop=(e,t)=>{if("free"!=fsView.options.iconMovement)return;let o;if("string"==typeof e)o=FSUtil.normalizeDriveLetter(e);else{o="2"==e.getAttribute("ent")?FSUtil.normalizeDriveLetter("c:/dummy/"+e.querySelector(".icon-text").textContent):FSUtil.normalizeDriveLetter(e.getAttribute("path"))}updateIconPosition(FSUtil.fname(o),t)},e.addEventListener("contextmenu",(t=>{if(!t.target&&!t.target.classList)return;document.querySelectorAll(".wcontext-menu").forEach((e=>e.remove()));let o=!1,n=t.target;for(;n.id!=gfxEl.id;)if(n=n.parentNode,n.classList.contains("shell-icon")){o=!0;break}let i=[];if(o){const o=e.querySelectorAll(".shell-icon.selected");if(o.length<1)return;if(1==o.length){const e=o[0],n=e.getAttribute("ent"),s=e.getAttribute("path");switch(i=[{type:"normal",label:"Open",onclick:()=>{e.ondblclick(t)}},{type:"normal",label:"Open with...",class:"openwith",onclick:()=>{execCmd("openwith",[s])}},{type:"normal",label:"Download",class:"download",onclick:()=>{"1"!=n?FSUtil.downloadFile(s):MsgBoxSimple.error("Error","Not implemented","OK")}},{type:"separator"},{type:"normal",label:"Cut",class:"cut",onclick:async()=>{fsView.performClipboard("cut")}},{type:"normal",label:"Copy",class:"copy",onclick:async()=>{fsView.performClipboard("copy")}},{type:"separator"},{type:"normal",label:"Make Link",class:"mklink",onclick:async()=>{const e={action:s},t=FSUtil.fname(s);let o=`c:/user/desktop/Link to ${t}.link`;t.endsWith(".link")?(o=`c:/user/desktop/Copy of ${t}`,await FS.cpfile(s,o)):await FS.writestr(o,JSON.stringify(e)),w96.evt.ui.emit("reload-desktop")}},{type:"normal",label:"Rename",class:"rename",onclick:async()=>{MsgBoxSimple.prompt("Rename","Enter the new name of the entry.",FSUtil.fname(s),(async e=>{null!=e&&(await FS.rename(s,e),w96.evt.ui.emit("reload-desktop"))}))}},{type:"normal",label:"Delete",class:"delete",onclick:async()=>{uiDelete()}},{type:"separator"},{type:"normal",label:"Properties",class:"prop",onclick:()=>{execCmd("explorer",["--prop",s])}}],n){case"2":i=[{type:"normal",label:"Open",onclick:()=>{e.ondblclick(t)}}];break;case"1":i=i.filter((e=>"openwith"!=e.class&&"download"!=e.class))}}}else fsView.deselectAllIcons(),i=[{type:"normal",label:"New File",onclick:()=>{MsgBoxSimple.prompt("Create File","Enter the name of the file to create.","New File.txt",(async e=>{if(null==e)return;const t="c:/user/desktop/"+e;await FS.exists(t)?MsgBoxSimple.warning("File Creation Failure","The path specified already exists.","OK"):(await FS.touch(t),w96.evt.ui.emit("reload-desktop"))}))}},{type:"normal",label:"New Directory",onclick:()=>{MsgBoxSimple.prompt("Create Directory","Enter the name of the directory to create.","New Folder",(async e=>{if(null==e)return;const t="c:/user/desktop/"+e;await FS.exists(t)?MsgBoxSimple.warning("Directory Creation Failure","The path specified already exists.","OK"):(await FS.mkdir(t),w96.evt.ui.emit("reload-desktop"))}))}},{type:"normal",label:"New Shortcut",onclick:()=>{showNewShortcutDialog("c:/user/desktop")}},{type:"separator"},{type:"normal",label:"Refresh",onclick:()=>{w96.evt.ui.emit("reload-desktop")}},{type:"separator"},{type:"normal",label:"Paste",cls:"paste",disabled:!0,onclick:()=>{fsView.performClipboard("paste")}},{type:"separator"},{type:"normal",label:"Properties",onclick:()=>{execCmd("ctrl",["--cpl","laf"])}}],w96.wmem.clipboard&&w96.wmem.clipboard.items.length>0&&(i.find((e=>"paste"==e.cls)).disabled=!1);new ContextMenu(i).renderMenu(t.x,t.y)})),e.addEventListener("keydown",(t=>{document.activeElement===e&&"Delete"==t.key&&(t.preventDefault(),t.stopPropagation(),uiDelete())})),e.addEventListener("mousedown",(t=>{e.focus(),WindowSystem.deactivateAllWindows()})),gfxEl.addEventListener("click",(e=>{const t=e.target;if(e.target&&t.classList&&!t.classList.contains("oc-event-exempt")&&!t.classList.contains("start_button")){for(var o=e.target;o&&o.id!=gfxEl.id;)if((o=o.parentNode)&&o.classList.contains("oc-event-exempt"))return;isStartOpen&&StartMenu.close()}})),document.addEventListener("keydown",(e=>{("F5"==e.key||e.ctrlKey&&"r"==e.key)&&(e.preventDefault(),w96.wmem._refreshConfirm||(w96.wmem._refreshConfirm=!0,DialogCreator.confirm("Are you sure you want to reboot? Any unsaved data is lost!",{title:"System",icon:"warning"},(e=>{e&&w96.sys.reboot(),w96.wmem._refreshConfirm=!1}),"warning")))})),document.body.onclick=e=>{try{if(!e.target||!e.target.classList&&e.target.classList.contains("root-item"))return}catch(e){}document.querySelectorAll(".wcontext-menu").forEach((e=>e.remove())),document.querySelectorAll(".w96-menubar>.root-item.selected").forEach((e=>e.classList.remove("selected")))}}class ShellApplication extends WApplication{constructor(){super(),this.desktopConfiguration={...DESKTOP_CONFIG_DEFAULT},this.state={iconPositions:[],reloading:!1}}async constructDOM(){setupTaskbar(),await setupIconDesktop(),gfxEl.appendChild(fsView.getElement()),gfxEl.appendChild(taskbar)}async loadConfiguration(){if(await FS.exists("c:/user/desktop")||await FS.mkdir("c:/user/desktop"),klog.println_styled("[desktop] Initializing desktop shell...","color: orchid"),klog.println_styled("[desktop] Reading desktop configuration file at c:/system/config/desktop.json"),await FS.exists("c:/system/config/desktop.json"))try{this.desktopConfiguration=JSON.parse(await FS.readstr("c:/system/config/desktop.json"))}catch(e){klog.warn("An invalid configuration file was loaded, sticking with default until user repairs configuration file.")}else klog.println_styled(">> No valid desktop configuration found, creating one...","color: yellow"),await FS.mkdir("c:/system/config"),await FS.writestr("c:/system/config/desktop.json",JSON.stringify(this.desktopConfiguration)),klog.println("[desktop] Wrote default configuration file successfully.");smConfig=SCM.get("Software/Shell36/StartMenu"),null==smConfig&&(smConfig={...START_MENU_CONFIG},await SCM.setAndSync("Software/Shell36/StartMenu",smConfig))}async applyConfiguration(){const e=fsView.getElement(),t=this.desktopConfiguration;if("iframe"!==t.background.type){const e=document.querySelector(".ui-bg-iframe");e&&e.remove()}switch(t.background.type){default:klog.warn("Background type '"+t.background.type+"' is not recognized, switching to fallback..."),t.background.type="css",t.background.bg="black",e.style.background=t.background.bg;break;case"css":e.style.background=t.background.bg;break;case"url":e.style.background=`url(${t.background.bg})`;break;case"local":if(await FS.exists(t.background.bg))try{e.style.backgroundImage=`url(${URL.createObjectURL(await FS.toBlob(t.background.bg))})`,e.style.backgroundRepeat="no-repeat",e.style.backgroundSize="cover"}catch(t){e.style.background="black"}else klog.warn("Cannot find local resource "+t.background.bg+", switching to fallback."),t.background=DESKTOP_CONFIG_DEFAULT.background,await FS.writestr("c:/system/config/desktop.json",JSON.stringify(this.desktopConfiguration));break;case"iframe":e.style.background="transparent";let o=document.querySelector(".ui-bg-iframe");o||(o=function(){const e=document.createElement("iframe");return e.classList.add("ui-bg-iframe"),gfxEl.appendChild(e),e}()),o.src=t.background.bg}}async reloadDesktop(){if(!this.state.reloading){if(this.state.reloading=!0,await FS.exists("c:/user/desktop")||await FS.mkdir("c:/user/desktop"),await FS.exists("C:/trash")){const e=await FS.readdir("C:/trash");e.forEach(((e,t,o)=>{"C:/trash/.meta"==e&&o.splice(t,1)}));for(let t of specialIcons)"trash"==t.id&&(e.length>0?t.icon="places/trash-full":t.icon="places/trash")}await fsView.navigate("c:/user/desktop",(()=>{const e=fsView.getElement().querySelectorAll(".shell-icon");for(let t of e)t.ondblclick=()=>{const e=t.getAttribute("ident");if(e)switch(e){case"computer":execCmd("explorer",["computer://"]);break;case"trash":execCmd("explorer",["c:/trash"]);break;case"documents":execCmd("explorer",["c:/user/documents"])}else execFile(t.getAttribute("path"))}}),!0),this.state.reloading=!1}}async main(e){await super.main(e),console.group("shell36"),console.log("Loading desktop configuration..."),await this.loadConfiguration(),console.log("Constructing DOM..."),await this.constructDOM(),assignDesktopEvents(),w96.evt.ui.on("reload-desktop",(()=>this.reloadDesktop())),Taskbar.assign(taskbar),WindowSystem.setWindowContainer(gfxEl),console.log("Initializing clock..."),initializeClock(),initializeErrorNotifyIcon(),await this.applyConfiguration(),console.log("Loading desktop..."),await this.reloadDesktop(),MobileDeviceConfiguration.isMobileModeEnabled()&&(await MobileDeviceConfiguration.applyPatches(),null==SCM.get("Software/Shell36/CE")&&await SCM.setAndSync("Software/Shell36/CE",!0),SCM.get("Software/Shell36/CE")&&await Loader.loadStyleAsync("/system/resource/stylesheets/ce.css"));let t=({path:e})=>{if(this.state.reloading)return;const t=FSUtil.normalizeDriveLetter(e);(t.startsWith("C:/user/desktop")||t.startsWith("C:/user/desktop"))&&this.reloadDesktop()};w96.evt.fs.on("dir-create",t),w96.evt.fs.on("dir-remove",t),w96.evt.fs.on("touch",t),w96.evt.fs.on("file-write-string",t),w96.evt.fs.on("file-write-binary",t),w96.evt.fs.on("rm",t),console.groupEnd(),w96.evt.shell.on("config-modify",(async e=>{if(!e||"object"!=typeof e)throw new Error("Nothing to modify!");this.desktopConfiguration={...this.desktopConfiguration,...e},await FS.writestr("c:/system/config/desktop.json",JSON.stringify(this.desktopConfiguration)),await this.applyConfiguration()})),w96.evt.shell.on("start-open",(()=>StartMenu.open())),w96.evt.shell.on("start-close",(()=>StartMenu.close())),await w96.shell.imde.init(),current.boxedEnv.shellCompleteCb(),w96.evt.sys.once("init-complete",(async()=>{await FS.exists("C:/system/startup")||await FS.mkdir("C:/system/startup");for(let e of await FS.readdir("C:/system/startup"))try{execFile(e)}catch(e){console.error(`Startup Failure: ${e}`)}})),await new Promise((e=>{this._resolve=e}))}async ontermination(){await super.ontermination(),console.log("Shutting down shell..."),"function"==typeof this._resolve&&(this._resolve(),this._resolve=null),taskbar.remove(),fsView.uiComponent.remove()}}

return await WApplication.execAsync(new ShellApplication(), this.boxedEnv.args, this);