Sign in to follow this  
Followers 0
Guest trewdy

#include

5 posts in this topic

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!

Share this post


Link to post
Share on other sites



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


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

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.

Share this post


Link to post
Share on other sites

Thanks all. It looked to me like FileInstall() would do the trick. Just wanted to make sure before starting down that road with my script's structure.

Share this post


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:

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
Sign in to follow this  
Followers 0