1 | #Include <Web.au3> |
---|
2 | |
---|
3 | ;If Not FileExists(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Autoit v3\", "InstallDir") &"\Aut2Exe\Aut2exe.exe") Then |
---|
4 | ; _StartWebApp("Error") |
---|
5 | ; echo("error! Compiler not found at "& RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Autoit v3\", "InstallDir") &"\Aut2Exe\Aut2exe.exe") |
---|
6 | ;EndIf |
---|
7 | |
---|
8 | $srcfile = @Scriptdir &"\script\tmpfile.au3" |
---|
9 | Local $sAut2exeA = @ProgramFilesDir & "\AutoIt3\Aut2Exe\Aut2exeA.exe" |
---|
10 | If Not FileExists($srcfile) Then |
---|
11 | fileopen( $srcfile, 10 ) |
---|
12 | FileWrite($srcfile, ";Beginning code"&@CRLF) |
---|
13 | EndIf |
---|
14 | fileopen( $srcfile, 10 ) |
---|
15 | _StartWebApp() |
---|
16 | |
---|
17 | If _Post("code") Then |
---|
18 | echo('<br>Step 1 of 3') |
---|
19 | Do |
---|
20 | FileWrite($srcfile, _Post("code")) |
---|
21 | Until FileExists($srcfile) |
---|
22 | ;Run(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Autoit v3\", "InstallDir") &'\Aut2Exe\Aut2exe.exe /in "'& $srcfile&'"') |
---|
23 | echo('<br>Step 2 of 3') |
---|
24 | $infile = $srcfile |
---|
25 | $outfile = @scriptdir & '\script\tmpfile.exe' |
---|
26 | $param = '/in "' & $infile & '" /out "' & $outfile & '"' |
---|
27 | echo('<br>Step 3 of 3') |
---|
28 | ShellExecute($sAut2exeA, $param) |
---|
29 | echo('<BR>Compiling') |
---|
30 | Do |
---|
31 | echo('.') |
---|
32 | sleep(1000) |
---|
33 | Until FileExists(@Scriptdir &"\script\tmpfile.exe") |
---|
34 | sleep(1000) |
---|
35 | echo("<BR>Download file here: <a href=/script/tmpfile.exe>Click Here</a>") |
---|
36 | EndIf |
---|
37 | |
---|
38 | echo("<form action="&$_SCRIPT_NAME&" method=POST>") |
---|
39 | echo("<textarea name=code width=400 height=400></textarea><br>") |
---|
40 | echo("<input type=submit>") |
---|