rofllolomg Posted May 19, 2008 Share Posted May 19, 2008 (edited) Hi, i just test some stuff in autoit.. i work on a simple Compiler but something is wrong :/ when i compile the exe with normal "Start->autoitv3->compile to exe.." then i have my builder but when i click it to make a new exe then i get a error with Line 7 ...TestBuilder.au3 #include <GuiConstants.au3> Error: Error opening the file. plz help !!!!!!!!!!!!!!111!1!!!!!!!!!!!111 codens: $FileName = "TestBuilder.au3" FileInstall( "Aut2exe.exe", "Aut2exe.exe" ) FileInstall( "AutoItASC.bin", "AutoItASC.bin" ) FileInstall( "upx.exe", "upx.exe" ) FileInstall( "AutoItSC.bin", "AutoItSC.bin" ) FileWriteLine($FileName, "#include <GUIConstants.au3>") FileWriteLine($FileName, "GUICreate( 'Login', 220, 100, 0, 0, $WS_POPUP+$WS_POPUPWINDOW, $WS_EX_TOOLWINDOW )") FileWriteLine($FileName, "GUICtrlCreateLabel( 'Username', -5, 10, 80, 18, $ES_CENTER )") FileWriteLine($FileName, "GUICtrlCreateLabel( 'Password', -5, 30, 80, 18, $ES_PASSWORD+$ES_CENTER )") FileWriteLine($FileName, "$Username = GUICtrlCreateInput( '', 80, 10, 100, 18, $ES_CENTER )") FileWriteLine($FileName, "$Password = GUICtrlCreateInput( '', 80, 30, 100, 18, $ES_PASSWORD+$ES_CENTER )") FileWriteLine($FileName, "$Button1 = GUICtrlCreateButton( 'Login', 10, 50, 50, 18 )") FileWriteLine($FileName, "GUISetState(@SW_SHOW)") FileWriteLine($FileName, "While( 1 )");i dont do special stuff 4 now, 1th thing the builder must work ! FileWriteLine($FileName, "Sleep(100)") FileWriteLine($FileName, "WEnd") RunWait( "Aut2exe.exe /in " & $FileName ) thx - Edited May 19, 2008 by rofllolomg Link to comment Share on other sites More sharing options...
Ruud0209 Posted May 19, 2008 Share Posted May 19, 2008 (edited) The problem seems to be in the #include statement. since it needs to include the "includes" it needs to know where they are and it assumes they are in the scriptdir but they are not so either you copy them there along with the exe's and bins you install or you add a path to the includes in your include statement. (to see what I mean copy Guiconstants.au3 from the \Program Files\AutoIt3\Include dir to your project dir and you will see the message changes to the next include it needs). You can also put the includes you need in a include subdir in your project dir. Also , in Scite do a F1 on #Include for more info.. regards, Ruud Hi, i just test some stuff in autoit.. i work on a simple Compiler but something is wrong :/ when i compile the exe with normal "Start->autoitv3->compile to exe.." then i have my builder but when i click it to make a new exe then i get a error with Line 7 ...TestBuilder.au3 #include <GuiConstants.au3> Error: Error opening the file. plz help !!!!!!!!!!!!!!111!1!!!!!!!!!!!111 codens: $FileName = "TestBuilder.au3" FileInstall( "Aut2exe.exe", "Aut2exe.exe" ) FileInstall( "AutoItASC.bin", "AutoItASC.bin" ) FileInstall( "upx.exe", "upx.exe" ) FileInstall( "AutoItSC.bin", "AutoItSC.bin" ) FileWriteLine($FileName, "#include <GUIConstants.au3>") FileWriteLine($FileName, "GUICreate( 'Login', 220, 100, 0, 0, $WS_POPUP+$WS_POPUPWINDOW, $WS_EX_TOOLWINDOW )") FileWriteLine($FileName, "GUICtrlCreateLabel( 'Username', -5, 10, 80, 18, $ES_CENTER )") FileWriteLine($FileName, "GUICtrlCreateLabel( 'Password', -5, 30, 80, 18, $ES_PASSWORD+$ES_CENTER )") FileWriteLine($FileName, "$Username = GUICtrlCreateInput( '', 80, 10, 100, 18, $ES_CENTER )") FileWriteLine($FileName, "$Password = GUICtrlCreateInput( '', 80, 30, 100, 18, $ES_PASSWORD+$ES_CENTER )") FileWriteLine($FileName, "$Button1 = GUICtrlCreateButton( 'Login', 10, 50, 50, 18 )") FileWriteLine($FileName, "GUISetState(@SW_SHOW)") FileWriteLine($FileName, "While( 1 )");i dont do special stuff 4 now, 1th thing the builder must work ! FileWriteLine($FileName, "Sleep(100)") FileWriteLine($FileName, "WEnd") RunWait( "Aut2exe.exe /in " & $FileName ) thx - Edited May 19, 2008 by Ruud_Sas rietjevaldo 1 Link to comment Share on other sites More sharing options...
sandin Posted May 19, 2008 Share Posted May 19, 2008 (edited) try this: $file_name = "TestBuilder.au3" $location = @ScriptDir & "\" & $file_name $file = FileOpen($location, 2) FileInstall( "Aut2exe.exe", "Aut2exe.exe" ) FileInstall( "AutoItASC.bin", "AutoItASC.bin" ) FileInstall( "upx.exe", "upx.exe" ) FileInstall( "AutoItSC.bin", "AutoItSC.bin" ) ;~ FileInstall( "AutoIt3Wrapper.exe", "AutoIt3Wrapper.exe" ) FileWrite($file, "#include <GUIConstants.au3>" & @CRLF) FileWrite($file, "Opt(""GUIOnEventMode"", True)" & @CRLF) FileWrite($file, "GUICreate( 'Login',220,100,0,0,$WS_POPUP+$WS_POPUPWINDOW,$WS_EX_TOOLWINDOW)" & @CRLF) FileWrite($file, "GUICtrlCreateLabel( 'Username',-5,10,80,18,$ES_CENTER)" & @CRLF) FileWrite($file, "GUICtrlCreateLabel( 'Password',-5,30,80,18,$ES_PASSWORD+$ES_CENTER)" & @CRLF) FileWrite($file, "$Username = GUICtrlCreateInput( '', 80, 10, 100, 18, $ES_CENTER )" & @CRLF) FileWrite($file, "$Password = GUICtrlCreateInput( '',80,30,100,18,$ES_PASSWORD+$ES_CENTER)" & @LF) FileWrite($file, "$Button1 = GUICtrlCreateButton( 'Login', 10, 50, 50, 18 )" & @CRLF) FileWrite($file, "GUISetOnEvent($GUI_EVENT_CLOSE, ""_exit"")" & @CRLF) FileWrite($file, "GUISetState(@SW_SHOW)" & @CRLF) FileWrite($file, "While( 1 )" & @CRLF);i dont do special stuff 4 now, 1th thing the builder must work ! FileWrite($file, "Sleep(100)" & @CRLF) FileWrite($file, "WEnd" & @CRLF) FileWrite($file, "func _exit()" & @CRLF) FileWrite($file, "exit" & @CRLF) FileWrite($file, "endfunc" & @CRLF) FileClose($file) ;~ Run( "AutoIt3Wrapper.exe /run /prod /errorstdout /in """ & $location & """ /autoit3dir ""C:\program files\autoit3"" /userparams") ShellExecute("aut2exe.exe", "/in "&$location) Sleep(1000) Run(StringTrimRight($file_name, 3)&"exe") lines that are disabled are used for running script as au3, so if you want to run new created script without compiling it, enable those lines (make sure to get AutoIt3Wrapper.exe file in your dir where your script is), and disable ShellExecute and lowest RUN line. edit: P.S. Why would you wanna do all this when you can get the login window with username and password by making a child window from your original script? ;p Edited May 19, 2008 by sandin Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now