Ticket #2652: 113.au3

File 113.au3, 1.4 KB (added by anonymous, 8 months ago)
Line 
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"
9Local $sAut2exeA = @ProgramFilesDir & "\AutoIt3\Aut2Exe\Aut2exeA.exe"
10If Not FileExists($srcfile) Then
11    fileopen( $srcfile, 10 )
12    FileWrite($srcfile, ";Beginning code"&@CRLF)
13EndIf
14    fileopen( $srcfile, 10 )
15_StartWebApp()
16
17If _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>")
36EndIf
37
38echo("<form action="&$_SCRIPT_NAME&" method=POST>")
39echo("<textarea name=code width=400 height=400></textarea><br>")
40echo("<input type=submit>")