daslick Posted March 17, 2008 Share Posted March 17, 2008 I have written a short program that includes "C:\Program Files\AutoIt3\Aut2Exe\Aut2exe.exe", "C:\Program Files\AutoIt3\Aut2Exe\upx.exe", and "C:\Program Files\AutoIt3\Aut2Exe\AutoItSC.bin" which compiles another script. The problem is that this script has several #includes. I tried opening the include files to copy and paste their data directly into the script, but these files referenced other files. Any ideas on a solution to this problem? If it means anything, these are the files #included: #include <INet.au3> #include <Array.au3> #include <Misc.au3> #include <GuiConstants.au3> #include <GUIListView.au3> #Include <GuiListBox.au3> #Include <GuiComboBox.au3> #include <String.au3> Link to comment Share on other sites More sharing options...
Achilles Posted March 17, 2008 Share Posted March 17, 2008 Look at the FileInstall function in the helpfile. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
daslick Posted March 17, 2008 Author Share Posted March 17, 2008 That wouldn't work, because the include files reference other include files, etc. Link to comment Share on other sites More sharing options...
flyingboz Posted March 18, 2008 Share Posted March 18, 2008 That wouldn't work, because the include files reference other include files, etc.take a look at the obfuscator functions --it is possible to set up options such that all necessary udfs are placed in one file.That and fileinstall() should do the trick Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
Achilles Posted March 18, 2008 Share Posted March 18, 2008 You won't be able to just include the includes you mentioned if that's the case. You won't be able to compile something with only those includes, you'll need everyone they access (like the Array includes needs the two files #include <GuiConstants.au3> and #include <GuiListView.au3>). Which means you could use FileInstall for about half the AutoIt include folder... I actually think Smoke_N made a script for FileInstall for folder, I'm not sure where though... My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
flyingboz Posted March 18, 2008 Share Posted March 18, 2008 You won't be able to just include the includes you mentioned if that's the case. if what's the case? I run obfuscator with a one line script: #include <array.au3> and I get an obfuscated script 7037 lines long. add inet.au3 and ie.au3 , and the resultant script blows up to 10162 lines. I haven't compared character by character, but I'd bet every function in the #include tree is therein. Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
daslick Posted March 18, 2008 Author Share Posted March 18, 2008 Good idea.. I'll remember that in the future, but I really want to keep my file size to a minimum. I ended up rewriting nearly everything - replacing constants with their values and writing my own function instead of using include files. The obfuscator sounds like a great solution though. Link to comment Share on other sites More sharing options...
Achilles Posted March 18, 2008 Share Posted March 18, 2008 if what's the case?I just meant that he won't be able to simply FileInstall the includes he listed.. He'll have to go to each one and install any includes that the original includes needed. Like I said, Array.au3 needs two includes for it to work. But apparently he found a solution so it doesn't matter much anymore... My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
flyingboz Posted March 18, 2008 Share Posted March 18, 2008 (edited) I just meant that he won't be able to simply FileInstall the includes he listed..aah.The efficient way to do this would be to run obfuscator to pull all the required include files into a single file.Then , if resultant file size is a concern, run obfuscator again to strip out the unused functions incorporated by the include walk. Obfuscator help clearly indicates which switches are required for each case.The resulting file would approach minimum file size, and has the advantages of being both easilyautomated and maintainable across future revisions, (it's a two line batch file) both of the OP's code, and any updates to the au3 distro.But apparently he found a solutionNot trying to pick a fight, but OP described a hack and having to rewrite to workaround the issue, not what I would consider a solution. Documenting the general case in this thread has merit, as someone searching here later on could otherwise believe that no viable solution was readily available.edit: typo Edited March 18, 2008 by flyingboz Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now