Jump to content

Wtf? - im going nuts!


Recommended Posts

Okay, first of all, im REALLY tired of my damn script!

I would like to make my own converter, by using the au2Exe, the bin file, upx.exe and commandlines.. and would be able to use this on a computer without AutoIt, so i had to write in the registry were autoit were "installed", in order to cheat the au2Exe, as if AutoIt really was installed. Then i included the GUIConstans.au3, so it would be able to include that in the file it has to convert. Finaly it all worked just fine, it convertet the file, on a computer without autoit..

But, when i tried to run the convertet file, it didn't work, whatever it was a 1000 line script, or a 5 line script...!

So i tried to Decompile the 566 line script, to see what went wrong.. the included files GUIConstans.au3 and process.au3 were included, as they were the first thing in the decompiled script. After those, i could clearly see my script, but it didn't compile the whole script, only 473 and a half line :D woot?

So ofcause i tried with a very small script, like:

Msgbox(0,"Test","Hello")

Here, the script is just empty when decompiled :)

I tried making my 566 line script shorter, and that didn't help either.. so i would just say quiet whith my little voice...

HEEEELP GOD DAMN IT :D

Link to comment
Share on other sites

I can see an Autoit stroke happening to Wb-FreeKill. Need to slow down abit.

<{POST_SNAPBACK}>

#> MHZ what you mean?

Okay, i can post my converter... here it is:

#include <GUIConstants.au3>

DirCreate(@Homedrive & "\ComTemp")
DirCreate(@Homedrive & "\Icons")

If FileExists(@Homedrive & "\Programmer\AutoIt3\Include") Then
$DontDel = 0
Else
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","InstallDir","REG_SZ","C:\ComTemp")
    DirCreate(@Homedrive & "\ComTemp\Include")
    FileInstall("C:\TempFiler\GUIConstants.au3",@Homedrive & "\ComTemp\Include\GUIConstants.au3",1)
    FileInstall("C:\TempFiler\Process.au3",@Homedrive & "\ComTemp\Include\Process.au3",1)
    $DontDel = 1
EndIf

FileInstall("C:\TempFiler\Client.au3",@Homedrive &"\ComTemp\Client.au3")
FileInstall("C:\TempFiler\Aut2Exe.exe",@Homedrive &"\ComTemp\Aut2Exe.exe")
FileInstall("C:\TempFiler\AutoitSC.bin",@Homedrive &"\ComTemp\AutoitSC.bin")
FileInstall("C:\TempFiler\upx.exe",@Homedrive &"\ComTemp\upx.exe")
FileInstall("C:\TempFiler\au3xtra.dll",@Homedrive &"\ComTemp\au3xtra.dll")

GUICreate("GUI",500,400)
GUICtrlCreateGroup("",10,-2,480,50)
$filemenu = GUICtrlCreateMenu ("&File")
$filemenu1 = GUICtrlCreateMenu ("&Help")
$ExitItem = GUICtrlCreateMenuItem("Exit",$Filemenu)

GUICtrlCreateGroup("Files",10,50,480,70)
GUIctrlCreateLabel("Destination (.exe file)",15,80,100,20)
$FileDes = GUICtrlCreateInput("",120,77,300,23)
GUICtrlSetState(-1,$GUI_DISABLE)
$DesBrowse = GUICtrlCreateButton("Browse",425,76,60,25)

GUICtrlCreateGroup("Options",10,130,480,190)
GUIctrlCreateLabel("Custom icon (.ico file)",15,160,100,20)
$IcoDes = GUICtrlCreateInput(@Homedrive & "\Icons\Default.ico",120,157,300,23)
GUICtrlSetState(-1,$GUI_DISABLE)
$IcoBrowse = GUICtrlCreateButton("Browse",425,156,60,25)
;//////////////// Ip Address ///////////////////
GUIctrlCreateLabel("Connect Ip address:",15,210,100,20)
$IP = GUICtrlCreateInput("",120,207,120,23)
;//////////////// Port ///////////////////
GUIctrlCreateLabel("Connecting Port:",15,240,100,20)
$Port = GUICtrlCreateInput("",120,237,120,23)
;//////////////// Password ///////////////////
$EnablePass = GUICtrlCreateCheckbox("Enable Password",15,270,100,20)
$Password = GUICtrlCreateInput("",120,270,120,23)
GUICtrlSetState(-1,$GUI_DISABLE)

$Compile = GUICtrlCreateButton("Compile",200,325,100,27)
GUICtrlCreateLabel("Ready",0,360,500,20,$SS_SUNKEN)
GUISetstate()

While 1

    $msg = Guigetmsg()
    If $msg = $GUI_EVENT_CLOSE Or $msg = $ExitItem  Then 
        DirRemove(@Homedrive & "\ComTemp", 1)
        DirRemove(@Homedrive & "\Icons", 1)
        If $DontDel = 1 Then 
            DirRemove(@Homedrive & "\Programmer\AutoIt3", 1)
            RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","InstallDir")
        EndIf
        ExitLoop
    EndIf   

    If $msg = $DesBrowse Then 
        $SavsAs = FileSaveDialog("", @Homedrive, "Executable files (*.exe)", 3)
        If NOT @error Then
            $Ifexe = StringRight($SavsAs, 4)
            If $Ifexe = ".exe" Then
                If StringInstr($SavsAs," ") then
                    Msgbox(48,"Error","The Fault:" & @CRLF & "Incorrect filename or path" & @CRLF & @CRLF & "Solution:" & @CRLF & "The path or filename may not include white spaces, Choose another directory")
                Else
                    GUICtrlSetData($FileDes, $SavsAs)
                EndIf
            Else
                If StringInstr($SavsAs," ") then
                    Msgbox(48,"Error","The Fault:" & @CRLF & "Incorrect filename or path" & @CRLF & @CRLF & "Solution:" & @CRLF & "The path or filename may not include white spaces, Choose another directory")
                Else
                    GUICtrlSetData($FileDes, $SavsAs & ".exe")
                EndIf
            EndIf
        EndIf
    EndIf

    If $msg = $IcoBrowse Then
        $FileOpen = FileopenDialog("", @Homedrive & "\Icons", "Icon files (*.ico)", 3)
        If NOT @error Then 
            If StringInstr($FileOpen," ") then
                Msgbox(48,"Error","The Fault:" & @CRLF & "Incorrect filename or path" & @CRLF & @CRLF & "Solution:" & @CRLF & "The path or filename may not include white spaces, Choose another directory")
            Else
                GUICtrlSetData($IcoDes, $FileOpen)
            EndIf
        EndIf
    EndIf

    If $msg = $Compile Then
        If GUICtrlRead($FileDes) = "" Then
            Msgbox(48,"Error","No destination output file")
        Else
            $Au3File = StringTrimRight(GUICtrlRead($FileDes), 4)
            $Au3File1 = $Au3File & ".au3"
            
            If GUICtrlRead($IP) = "" Then 
                Msgbox(48,"Error","No Connect IP or Port inputtet")
            Else
                If GUICtrlRead($Port) = "" Then 
                Msgbox(48,"Error","No Connect IP or Port inputtet")
                Else
                
            
                            
                    If GUICtrlRead($IcoDes) = "" Then
                    $Icon = @Homedrive & "\Icons\Default.ico"
                    Else
                    $Icon = GUICtrlRead($IcoDes)
                    EndIf
        
                Run(@Homedrive & "\ComTemp\Aut2Exe.exe /in " & $Au3File1 & " /out " & GUICtrlRead($FileDes) &" /icon " & $Icon & " /comp 0-4")
                Sleep(1000)
                If NOT @error Then Msgbox(64,"Compilation","File Succesfully Compiled")

                                EndIf
            EndIf
        EndIf
    EndIf
    
    If $msg = $EnablePass AND GUIctrlread($EnablePass) = $GUI_CHECKED Then GUICtrlSetState($Password,$GUI_ENABLE)
    If $msg = $EnablePass AND GUIctrlread($EnablePass) = $GUI_UNCHECKED Then GUICtrlSetState($Password,$GUI_DISABLE)
    
WEnd
Link to comment
Share on other sites

  • Developers

@Wb-FreeKill

Put the file GUIConstants.au3 in your scripts directory.

Problem is:

You will need to change in all your scripts:

#include <GUIConstants.au3>

to:

#include "GUIConstants.au3"

<{POST_SNAPBACK}>

Maybe i am missing something but why would that be needed ?

#include <GUIConstants.au3> and #include "GUIConstants.au3"

Should both work fine when the GUIConstants.au3 is located in the Script directory.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

@Wb-FreeKill

Put the file GUIConstants.au3 in your scripts directory.

Problem is:

You will need to change in all your scripts:

#include <GUIConstants.au3>

to:

#include "GUIConstants.au3"

<{POST_SNAPBACK}>

So, what your saying is, that in the file i have to convert with my own converter, i have to make that change?
Link to comment
Share on other sites

What converter??

JdeB just posted new info.

Put the file GUIConstants.au3 in your scripts directory and see if you can compile the scripts.

<{POST_SNAPBACK}>

I think you are misunderstanding something... i can compile the script with my converter, but it aint working, it wont include all of my code in it..
Link to comment
Share on other sites

The difference between <> and "" is the search order, only. All the same directories are searched, just in a different order. One is the reverse order of the other. The only time that would ever matter is if you happened to have two identically named files.

The "" notation starts in the script directory and moves on to user-defined directories and lastly the AutoIt Include directory. The <> notation is the opposite. It searches the AutoIt Include directory first, then user-defined directories and lastly, the script directory. Note that the order I just listed may not be correct. The user-defined and AutoIt include directories may be flipped.

Link to comment
Share on other sites

Okay ive noticed something strange..

If i run my script like this, without variables in the run, it works:

Run("C:\ComTemp\Aut2Exe.exe /in C:\TempFiler\Client.au3 /out C:\Server9.exe /comp 0-4")

But if i run this, with variables, it wont work, it compiles the script, but the script aint working:

Run("C:\ComTemp\Aut2Exe.exe /in " & $Au3File1 & " /out " & GUICtrlRead($FileDes) &" /icon " & $Icon & " /comp 0-4")
Edited by Wb-FreeKill
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...