12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
-
- <html><HTA:APPLICATION ID="windowselevate" icon="#"/>
- <script language="vbscript">
- document.title = "elxr control panel"
- self.ResizeTo 200,600
-
- Sub Window_Onload
- self.MoveTo (screen.availWidth - (document.body.clientWidth + 40)),10
- End Sub
-
- Set objShell = CreateObject("WScript.Shell")
- Set objENV = objShell.Environment("Process")
- dim NODE_ENV
- NODE_ENV = objENV("NODE_ENV")
- </script>
-
- <script language="javascript">
- // alert(NODE_ENV);
- //WINDOWSTATE="minimize" SHOWINTASKBAR="no" SYSMENU="no" CAPTION="no"
- // alert(windowselevate.commandLine)
- var args = windowselevate.commandLine.split('"').slice(3);
- // alert(args)
- var processedArgs = { _ : [] }
- for(var item in args){
- // alert(args[item].charAt(0))
- args[item] ? args[item].charAt(0) === '-' ? processedArgs[args[item].slice(2)] = args[item].split('=')[1] || true : processedArgs._.push(args[item]) : null
- }
- // args = args.forEach(function(item){ })
- // alert('processedArgs._ : ' + processedArgs._);
- // alert(processedArgs.runas);
-
- var namedArgs = [];
- // Object.keys(processedArgs).forEach( function(v){ v!='_' ? namedArgs.push('--'+v+'='+processedArgs[v]) : null; })
- var cargs = (processedArgs.debug ? '--inspect-brk' : '') + ' elxr ' + processedArgs._.join(' ') + ' ' + namedArgs.join(' ') + ' ' + ' --runas=true';
- var shell = new ActiveXObject('shell.application');
- shell.ShellExecute('node', cargs, '', 'runas', 1);
- var fso = new ActiveXObject('Scripting.FileSystemObject');
-
- window.onload = function() {
- document.body.style.backgroundColor = 'black';
- document.body.style.fontFamily = 'arial';
- var log = document.createElement('div');
- function l(msg){ log.innerHTML+= msg; };
- log.style.color = 'blue';
- log.id = 'log';
- document.body.appendChild(log);
- log.innerHTML='Please Wait';
- l('<Br/>Current config : ')
- l('<Br/>NODE_ENV = ' + NODE_ENV)
- l('<Br/>cmd = ' + processedArgs._[0])
- processedArgs._[1] === 'use' ? l('<Br/>using = ' + processedArgs._[2]) : null;
- l('<Br/><Br/>')
-
-
- var timer = function(){
- l('.');
- if(fso.FileExists("run.done")) close();
- else window.setTimeout(timer, 1000);
- };
- window.setTimeout(timer, 3000);
- };
-
- </script>
- </html>
|