Jump to content

...exe builder


Recommended Posts

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 by rofllolomg
Link to comment
Share on other sites

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 by Ruud_Sas
Link to comment
Share on other sites

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 by sandin
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...