asdfmovie99e

How to create a new executable file with a script.

19 posts in this topic

Hey everyone :)

I want my script to create a new executable file.

Is that possible?

Share this post


Link to post
Share on other sites



This section in the help file will tell you how to compile a script.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

i think u didnt understand me right :D

i know how to compile but i want my compiled exetuable file to create a new exe.

Edited by asdfmovie99e

Share this post


Link to post
Share on other sites

You can run Aut2Exe from your compiled executable.

Where is the source of the new exe located? Does it already exist in the filesystem or do you want to create the source file from your compiled executable?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

the source isnt in the fielsystem

i want to create it from the compiled exe

Edited by asdfmovie99e

Share this post


Link to post
Share on other sites

Write the source from your script to a temporary file, run Aut2Exe passing this temporary file as a a parameter and then delete the source file.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

asdfmovie99e,

I posted an example of how to do this here - the files needed to compile have changed a bit, but the basic principle is still the same. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

but i want the script to automatically compile it into an exe. i dont want to use the program aut2exe

Share this post


Link to post
Share on other sites

Can you please describe why you want to avoid Aut2Exe?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

but i want the script to automatically compile it into an exe. i dont want to use the program aut2exe

You can't. It's as simple as that. You have to use Aut2Exe to compile an AutoIt script into an executable, there is no way around it.

NOTE: By the way, if you use the pragma option #pragma compile(AutoItExecuteAllowed, true) you won't need to compile your new script on the target computer, you can use your original compiled script to run your script directly without compiling it first.

Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

I guess you can do it by creating a copy of your main exe, and changing its resource, as the AutoIt scripts code are stored in the executable's resource.

Check your compiled exe with a resource editor, you may get what I'm saying ;)

Share this post


Link to post
Share on other sites

You can use the FileInstall option to include all the necessary elements you want to use on a system that does not have an AutoIt install, but just consider what the size and requirements of that would be. You would be basically creating a version of AutoIt wherever your program was installed to. Think about any required #Include files, etc, etc.

BrewManNH and Melba23 gave you viable options, for a more targeted approach.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

Any way to achieve this in memory? For example:

1. Script check for updates
2. source is loaded into variable.

3. updates are applied.

4. RunBinary Aut2Exec with memory-modified source to be compiled.
5. execute new compiled script

6. MailBox old compile to indicate update success.

7. old shuts down, and new deletes old.

Ooh, could also test various execution methods used in script prior to update to determine if updating internal
interpreter will crash a working script. kinda like a kernel upgrade.


What is what? What is what.

Share this post


Link to post
Share on other sites

Because I have always preferred using memory to work with data. See back in the day when i used to use batch files, i dreamed of having them be exe's...but very few free software would allow me to simply convert them, most just extract them to a temp location. Which is extremely ineffective to me. I eventually ran into AutoIt by simply wanting to convert a decimal number to a char. I also found that back in the days of my compaq armada 133MHz and 64MB ram XD...ram drive was faster than anything.

Further more I like the idea of virtual files that act like any other file, but are only pointers to memory locations. That I can read and modify on the fly in memory as programs are reading the file-side of the data.

When it boils down, I dont like junk files, or temp files. Even if there is no way around it. And the idea of a self modifying program seems extremely useful in spite of malicious intent. Like MacOS X's .app packages, all in one, modular. It's elegant imo.


What is what? What is what.

Share this post


Link to post
Share on other sites

You want all in memory virtual auto-magically modifying programs and looking at AutoIt3 to make that happen...  funny :)


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

lol, not entirely. Even autoit has its limits, but so far it has helped me to understand Arduino coding, C, Assembly, and Cpp.
I find it's too 'high level' at times, but for quick and simple things to moderately complex things it's perfect.


What is what? What is what.

Share this post


Link to post
Share on other sites

On a more realistic note, Im looking to use Aut2Exe to either compile a script from memory and output a exe file, or output to memory.


What is what? What is what.

Share this post


Link to post
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