squallA Posted March 3, 2007 Posted March 3, 2007 (edited) I have a GUI and some fuction, I think it's small. But when i compile it, program about 400 KB :| And i see other program coded by AutoIT, it outgrow mine multiple times but it's about 260KB ! Who can help me compress size of program ? Edited March 3, 2007 by squallA
Somerset Posted March 3, 2007 Posted March 3, 2007 I have a GUI and some fuction, I think it's small. But when i compile it, program about 400 KB :|And i see other program coded by AutoIT, it outgrow mine multiple times but it's about 260KB ! Who can help me compress size of program ?are you adding other files with your script?
MrCreatoR Posted March 3, 2007 Posted March 3, 2007 You can set the compression level from Aut2Exe.exe (Menu Compression - Highest). Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
Developers Jos Posted March 3, 2007 Developers Posted March 3, 2007 (edited) You can set the compression level from Aut2Exe.exe (Menu Compression - Highest).nah..Only works for FileInstall() ..LAst version sizes:When using UPX it should be approx 230KbWhen UPX is switched off it will be approx 440Kb Edited March 3, 2007 by JdeB 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.
gsb Posted March 4, 2007 Posted March 4, 2007 Do the include files add a lot. I see some that skip some includes and the equivalent constant numbers. But I tend to collect a lot of the includes at the top of my code, like: #include <GUIConstants.au3> #include <IE.au3> #include <File.au3> #Include "Misc.au3" #Include <Process.au3> #Include <Constants.au3> #include <INet.au3> #include <Array.au3> But I would not expect them to add much at all to the compiled exe, no? gsb "Did you ever stop to think? ...and forget to restart!"
Moderators SmOke_N Posted March 4, 2007 Moderators Posted March 4, 2007 Do the include files add a lot. I see some that skip some includes and the equivalent constant numbers. But I tend to collect a lot of the includes at the top of my code, like: #include <GUIConstants.au3> #include <IE.au3> #include <File.au3> #Include "Misc.au3" #Include <Process.au3> #Include <Constants.au3> #include <INet.au3> #include <Array.au3> But I would not expect them to add much at all to the compiled exe, no? gsbIf you'd like to get an idea of the size difference before and after... If you are using 3.2.2.0 then run the below script, if you are using a beta, change the directories of $Au2 and $Exe2$file = FileOpenDialog('pick', @ScriptDir, 'Au3 (*.au3)') If @error = -1 Then Exit $Au2 = '"' & @ProgramFilesDir & '\AutoIt3\Aut2Exe\Aut2Exe.exe"' $Exe2 = '"' & @ProgramFilesDir & '\AutoIt3\Extras\Exe2Aut\Exe2Aut.exe"' $newfile = _CompileDecompile($file, $Au2, $Exe2, 'bbbb') Dim $sStringMain = FileRead($file), $nSizeMain = FileGetSize($file) Dim $sStringNew = FileRead($newfile), $nSizeNew = FileGetSize($newfile) Dim $nMainLines = UBound(StringSplit(StringStripCR($sStringMain), @LF)) - 1 Dim $nNewLines = UBound(StringSplit(StringStripCR($sStringNew), @LF)) - 1 FileDelete($newfile) MsgBox(64, 'Info', '**** Current File ****' & @CRLF & _ 'Line Count = ' & $nMainLines & @CRLF & _ 'Kb size = ' & Round($nSizeMain / 1024, 2) & @CRLF & @CRLF & _ '**** After Includes ****' & @CRLF & _ 'Line Count = ' & $nNewLines & @CRLF & _ 'kb size = ' & Round($nSizeNew / 1024, 2)) Func _CompileDecompile($filename, $Au2Exe, $Exe2Aut, $pass = 'asdf') RunWait ($Au2Exe & ' /in "' & $filename & '" /out "' & $filename & '.exe" /pass "' & $pass & '"') RunWait($Exe2Aut & ' /in "' & $filename & '.exe" /out "' & $filename & '_Output.au3" /pass "' & $pass & '"') FileDelete($filename & '.exe') Return $filename & '_Output.au3' EndFunc 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.
gsb Posted March 4, 2007 Posted March 4, 2007 Point well taken!!Than you again SmOke_N.**** Current File ****Line Count = 308Kb size = 9.66**** After Includes ****Line Count = 8458kb size = 328.22gsb "Did you ever stop to think? ...and forget to restart!"
gsb Posted March 6, 2007 Posted March 6, 2007 I wanted to come back to this one. A new control, and I copied pieces of the include files I needed, so I have no includes in the .au3 file. The .au3 file is 5k and the .exe is 214k. Now I do include a 19K .ico file but it looks like close to 200k as a minimum for a .exe file, no? So I do not think that your measure as above is the last word on the subject; although enlightening. Thoughts? gsb "Did you ever stop to think? ...and forget to restart!"
Moderators SmOke_N Posted March 6, 2007 Moderators Posted March 6, 2007 I wanted to come back to this one.A new control, and I copied pieces of the include files I needed, so I have no includes in the .au3 file.The .au3 file is 5k and the .exe is 214k.Now I do include a 19K .ico file but it looks like close to 200k as a minimum for a .exe file, no?So I do not think that your measure as above is the last word on the subject; although enlightening.Thoughts?gsbYou are compiling with UPX if your .exe is that size. To get a real comparison of what you are doing, compile without compression. 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.
gsb Posted March 6, 2007 Posted March 6, 2007 Thanks for the hint. I will try that next. You are a great resource SmOke_N, ... thank you. I hope you do not get bored with my posts. gsb "Did you ever stop to think? ...and forget to restart!"
gsb Posted March 6, 2007 Posted March 6, 2007 Nope. I went to the compiler and 'unchecked' UPX which, by default I guess, was checked as you suspected. Then went an recompiled the script: It went to over 400K. I am simply not understanding enough about AutoIt yet I think. gsb "Did you ever stop to think? ...and forget to restart!"
MrCreatoR Posted March 6, 2007 Posted March 6, 2007 (edited) Then went an recompiled the script: It went to over 400K.If you compile your script (using UPX) without any files installed, you will see that not the file was inlarging your compiled script, this is the *.bin file do this (from Aut2Exe.exe folder). So this is not mether how many files you install, the minimum size of your program will be something around the 200-220 kb (depends on script size itself and AutoIt version) - therefore, the .ico file is only “take” 19 kb (or even less if you use UPX) from main size of your program (in your case). Edited March 6, 2007 by MsCreatoR Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
gsb Posted March 6, 2007 Posted March 6, 2007 Thank you MsCreatoR. And if I understand you correctly, my minimum sized compiled script should always be in the 200 - 220 k range and up, depending on my code. Correct? gsb "Did you ever stop to think? ...and forget to restart!"
MrCreatoR Posted March 6, 2007 Posted March 6, 2007 minimum sized compiled script should always be in the 200 - 220 k range and up, depending on my code. Correct?Yes, this is correct, but also depending on AutoIt futures versions, because on early versions (3.1.0 i think) it was around 170-180 kb for script Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
gsb Posted March 6, 2007 Posted March 6, 2007 Thank you. I better understand it now. gsb "Did you ever stop to think? ...and forget to restart!"
Cool1Net6 Posted March 9, 2007 Posted March 9, 2007 Just to add a little bit more info on file sizes... I made a 297-line program which .au3 was 9.07kb in size, and added a 3.49kb readme file, a 2.78kb jpg image, and a 2.18kb icon. With AutoIt Beta v3.2.1.1 installed over AutoIt v3.1.1.0, I was only able to cut down the file size to 185kb, and I tried all the tricks of using numbers instead of includes and cutting out only the functions I needed, etc. Hope this helps, if nothing but for general information. -Cool-
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