Jump to content

Compiling a script with a given variable


Recommended Posts

Posted Image

#include <GUIConstants.au3>


$Form2 = GUICreate("Dialog", 316, 111, 347, 263)
GUISetIcon("D:\003.ico")
$GroupBox1 = GUICtrlCreateGroup("", 8, 1, 297, 65)
$Text = GUICtrlCreateInput("Enter some text here...", 56, 24, 193, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("&Create", 113, 75, 75, 25, 0)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

There is a GUI interface to input the variable $ Text. After clicking on "Create", to create a new EXE file with a given variable $ Text:

$OP=FileOpen ( "textfile.txt", 1)
FileWriteLine ( $OP,  $Text)
FileClose ($OP)

As a result, we get an EXE file, after the implementation of which will create a text file with the entered text. Now it is "Enter some text here..."

How is it implemented?

Edited by Kolesnikoff
Link to comment
Share on other sites

To me this does not make any sense as described.:D

Do you want to modify the existing exe or create a new one? Do you want to write out a script and use aut2exe to create a new exe? Or do you want to skip au2exe and create a binary thing containing information from $text?

Maybe this old topic is what your after?

EDIT: Just checked the topic again and to my surprise the code is waked? Is this just my problem or is it common to the rest of you?

Edited by Uten
Link to comment
Share on other sites

Do you want to modify the existing exe or create a new one?

Create a new one

Do you want to write out a script and use aut2exe to create a new exe?

write out a script and use other script with GUI interface to create a new exe with this code:

$OP=FileOpen ( "textfile.txt", 1)

FileWriteLine ( $OP, $Text) //$Text is appropriated some text. Default is "Enter some text here..."

FileClose ($OP)

Edited by Kolesnikoff
Link to comment
Share on other sites

Just analyse the output you get in scite when compiling a script and then do the same from your application.

Your call in RunWait(...) should be something like this:

F:\portableapps\devtools\scite\..\autoit-v3.3.0.0\aut2exe\aut2exe.exe  /in "E:\DOCUME~1\UTENNA~1\LOCALS~1\Temp\newexe.au3" /out "F:\newexe.exe" /comp 2 /pack /Bin E:\DOCUME~1\UTENNA~1\LOCALS~1\Temp\AutoItSC.bin
Link to comment
Share on other sites

Why do you need a separate .exe for each input? It would be much easier to just create one .exe that accepts a command line argument. Then the GUI, can just create a shortcut with the specified text as the .exe command line argument.

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...