Jump to content

Dynamically include a file to a compiled script


ramadash
 Share

Recommended Posts

Let's say I have script 1 and script 2.

Script 1 hold's alot of common functions

Script 2 is an include of a function that use Script 1 common library

So my problem is here; on a non-compiled script using #include is perfect, does exactly what I want. But if I want to release a compiled program, and give the user the ability to edit 1 function in script 2 wich get's called at a time by script 1, I dont think fileinstall will work.

FileInstall might work but the docs are kinda confusing, and I don't see how I would include a file after a copy.

Well basicalyl I just want an include from a copiled script to act like includes when running directly from the source.

I hope you guys understand what I need because im having a hard time explaining it. Any help would be appreciated.

Link to comment
Share on other sites

The includes are included into the main script when compiled. Compiling the script and then using Exe2Aut will show you this behaviour.

If this is your "MainScript.au3"...

#include "MyInclude.au3"

MsgBox(0, 'title', 'I come from the MainScript file')
oÝ÷ ÚØ^^*.r©W¢¶+pY[{­)íç(¥y×âébëaÆ®¶­s`¤gVæ2ô×6uW6W" ×6t&÷Âb33·FFÆRb33²Âb33´6öÖRg&öÒFR×æ6ÇVFRfÆRb33²¤VæDgVæ0 ¤×6t&÷Âb33·FFÆRb33²Âb33´6öÖRg&öÒFRÖå67&BfÆRb33²

The included code is with the main script so your idea of needing the includes after compiling to execute is false. Just compile and see for yourself.

:P

Link to comment
Share on other sites

its not a false idea its espetially because of this behavior, a file cant be included after compile, wich is needed in my case to change functions. I know it there but i dont want to include it on-compile but each time the compiled script get's launched.

Link to comment
Share on other sites

If I can understand you correctly, then you want to FileInstall and execute a 2nd file (not an include) with STDOutRead and cammandline parameters to run the function on the 2nd script and return the result?

The only other way to change the function code is to recompile the source. Even with beta plugin concept, you cannot changed it without recompiling the plugin source.

Including an au3 file like a plugin to a compiled script is not available, AFAIK.

Otherwise I have no idea of what your trying to do.

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