Jump to content
Sign in to follow this  
MichaelDotNet

Possible to export functions?

Recommended Posts

MichaelDotNet

I've done some searching around the forums before posting this, but I couldn't find an answer. Is it possible to export functions from a compiled AutoIT script? In other words, create a dll that exposes different functions?

Share this post


Link to post
Share on other sites
DW1

possible?... can be...

Frowned upon.. definitely, just write the author and ask for the function... or write your own. If a script is using a custom function that isn't available on the forum, then they probably don't want you to have it.

It would not be creating a DLL though... did I misunderstand the question? are you trying to decompile a DLL that is FileInstalled into the exe, or are you just trying to steal the functions from the compiled exe?

Share this post


Link to post
Share on other sites
SmOke_N

Why?


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
MichaelDotNet

possible?... can be...

Frowned upon.. definitely, just write the author and ask for the function... or write your own. If a script is using a custom function that isn't available on the forum, then they probably don't want you to have it.

It would not be creating a DLL though... did I misunderstand the question? are you trying to decompile a DLL that is FileInstalled into the exe, or are you just trying to steal the functions from the compiled exe?

I think you misunderstand.

I want to be able to have two AutoIT scripts, call them Script.exe and Library.dll, I want to be able to have Script.exe dynamically call functions in Library.dll. The trick is that both the exe and the dll are AutoIT scripts I wrote.

The idea is to have unchanging functionality in the exe while the much smaller library dll can be updated quickly and easily.

Share this post


Link to post
Share on other sites
SmOke_N

I think you misunderstand.

I want to be able to have two AutoIT scripts, call them Script.exe and Library.dll, I want to be able to have Script.exe dynamically call functions in Library.dll. The trick is that both the exe and the dll are AutoIT scripts I wrote.

The idea is to have unchanging functionality in the exe while the much smaller library dll can be updated quickly and easily.

It's rather useless the way it would have to be done when you can just include all those functions from within that AutoIt script anyway.

There is an AutoItX dll for the standard AutoIt functions.

You can use Command Line Parameters for anything else if you must use an .a3x or aut.exe for the job.

You could also launch other a3x or aut scripts/executables with /AutoIt3ExecuteScript.

So what you are asking...

Yes it's possible.

But, it won't be a dll.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
MichaelDotNet

You wrote the DLL in autoit??? You say that Library.dll is an autoit script.

I would like it to be... that's my question, is that possible :)

Share this post


Link to post
Share on other sites
MichaelDotNet

It's rather useless the way it would have to be done when you can just include all those functions from within that AutoIt script anyway.

There is an AutoItX dll for the standard AutoIt functions.

You can use Command Line Parameters for anything else if you must use an .a3x or aut.exe for the job.

You could also launch other a3x or aut scripts/executables with /AutoIt3ExecuteScript.

So what you are asking...

Yes it's possible.

But, it won't be a dll.

True, but then I have to maintain one huge monolithic script, I much rather put all the unchanging code in the exe and not have to worry about maintaining it or updating it. Any time I wanted to change or add functionality I could send out a small dll update without having to worry about breaking anything else.

Honestly I'd much rather use a different language for this, it's not really what AutoIT was designed for, I'm not using any of the automation functionality. But my current spec says using AutoIT..

Edited by MichaelDotNet

Share this post


Link to post
Share on other sites
Jos

True, but then I have to maintain one huge monolithic script, I much rather put all the unchanging code in the exe and not have to worry about maintaining it or updating it. Any time I wanted to change or add functionality I could send out a small dll update without having to worry about breaking anything else.

Honestly I'd much rather use a different language for this, it's not really what AutoIT was designed for, I'm not using any of the automation functionality. But my current spec says using AutoIT..

whats wrong with putting these "standard" functions into a file and using #Include<myStandardFunc.au3> ?

Jos


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

Share this post


Link to post
Share on other sites
MichaelDotNet

whats wrong with putting these "standard" functions into a file and using #Include<myStandardFunc.au3> ?

Jos

The includes are only processed at compile time, once the file is compiled and distributed any changes or additions to that file will not be reflected in the exe.

Share this post


Link to post
Share on other sites
SmOke_N

The includes are only processed at compile time, once the file is compiled and distributed any changes or additions to that file will not be reflected in the exe.

Make an .a3x file as your DLL, and use AutoIt3ExecuteScript + command line params for the functions + Call + Params. More work than it's worth if you know how to program in other languages.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
MichaelDotNet

Make an .a3x file as your DLL, and use AutoIt3ExecuteScript + command line params for the functions + Call + Params. More work than it's worth if you know how to program in other languages.

That's sort of what I figured anyway... I don't suppose there's anyway to utilize the autoit stub that the compiled exe would include?

Share this post


Link to post
Share on other sites
SmOke_N

That's sort of what I figured anyway... I don't suppose there's anyway to utilize the autoit stub that the compiled exe would include?

Yes, I've said it now 3 times.

/AutoIt3ExecuteScript


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
MichaelDotNet

Yes, I've said it now 3 times.

/AutoIt3ExecuteScript

Seems fair, considering I had to explain myself about that many times :)

I apologize, I did not realize you were referring to a switch that could be used with the hypothetical script.exe.

Share this post


Link to post
Share on other sites
SmOke_N

Seems fair, considering I had to explain myself about that many times ;)

I apologize, I did not realize you were referring to a switch that could be used with the hypothetical script.exe.

No worries, and :) @ being fair.

I remember making a sort of a3x/dll type once, but for the life of me I can't find it now. I don't think I ever finished as I thought it was just easier to include the code, or compile a script to .a3x and just run it with /AutoIt3ExecuteScript.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
ptrex

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.