Jump to content

#include


Recommended Posts

Can other file other script files be used in the main script with #include when creating standalone executables? If so, what is the process for creating/compiling the executable and its child scripts so that they can run without AutoIt installed on the target computer?

Thanks in advance!

Link to post
Share on other sites
  • Developers

The file that you specify in the #include is "merged" together before execution or compilation. So no need to do anything else...

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 post
Share on other sites

It is both a limitation and a feature depending on how you look at it.

In order to make a stand alone exe, it needs to pull in and compile all parts of the script. So if you have #includes, and FileInstall() in your script, they will be compiled and compressed into the exe at time of compiling.

If you change the file that is #included or FileInstall() with a new version, you will need to recompile the exe in order to get it in.

If you want to have the Exe change how it is executed depending on a file, I would sugest you use the ini reading functions, and or read lines from a text file.

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to post
Share on other sites

It looked to me like FileInstall() would do the trick

If you want to avoid having Autoit installed on the executing machine, then your FileInstall() must not refer to an uncompiled script, but to its compiled EXE.

Also, these (compiled) child scripts can only be used by your main script as separate standalone utilities - you can't directly call functions in them as you might if you used an #include on their source. So you would have to use the $CmdLine[] to communicate with them.

HTH :whistle:

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...