Jump to content

Is It Possible To Zero (No) Compress Autoit Scripts?


Recommended Posts

I have a script with 250 MB of fileinstall data, when i compile it the file size reduces to 150 MB, even i select "Lowest" option on AutoIt3Wrapper. I don't want any compression, not "Lowest". reasons compression increases compiling time so much, i don't need compiling and when executable file is created, when i use thirdy party program like WinRAR, 7zip existing compression cause them worse compressing. Because compression softwares does not understand each others algoritm (not always but generally), one software mixes the data blocks and other cannot compress even it would able to. When you use extra compression metod it doesn't work, they overlap, even it may unexpectedly increase file size. It's always best to use only one and best one.

For example
First 7zip compression, then compiling script with highest compression option 250 MB -> 50 MB -> 51 MB
First compiling script with highest compression option, then 7zip compression 250 MB -> 150 MB -> 151 MB

If i use the lowest option, the result does not change when other program used. Because compression software cannot do anything anymore.

First 7zip compression, then compiling script with lowest compression option 250 MB -> 50 MB -> 51 MB
First compiling script with lowest compression option, then 7zip compression 250 MB -> 200 MB -> 201 MB

resim.png.9819eeed392bf8c71ea2a2974323a60b.png

Edited by Adele
Link to post
Share on other sites
  • Adele changed the title to Is It Possible To Zero (No) Compress Autoit Scripts?
Posted (edited)
3 minutes ago, Nine said:

Why ?  Your client is paying you on the size of the exe ?

No. I hope there will be more informative comments on the topic.

Edited by Adele
Link to post
Share on other sites

You can use ResourcesEx UDF instead of FileInstall().

There is _ResourceSaveToFile() and

#AutoIt3Wrapper_Res_File_Add=test_1.bin, rt_rcdata, TEST_BIN_1
 

EDIT:

You can even add precompiled resources (instead of #AutoIt3Wrapper_Res_File_Add)

So you can precompile your big files by rc.exe (resource compiler) from file.rc to file.res and

this compiled res file add to compiled AutoIt's exe by this (I used it for precompiled set of icons):

#AutoIt3Wrapper_useupx=n
#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, ikony.res ,,,
#AutoIt3Wrapper_run_after=upx.exe --best --compress-icons=0 "%out%"
 

Compilation of (big) resources to from RC to RES will be done only once, not at each compilation of AU3 source!

For your case look at these UPX options to exlude your big resource from UPX's compresion:

  --compress-resources=0  do not compress any resources at all
  --keep-resource=list    do not compress resources specified by list
 

Here is example with source of my precompiled icons ikony.rc:

201   ICON   "sort_asc.ico"
202   ICON   "sort_desc.ico"
203   ICON   "connect.ico"
204   ICON   "login.ico"
205   ICON   "download.ico"
206   ICON   "upload.ico"
207   ICON   "mkdir.ico"
208   ICON   "rmdir.ico"
209   ICON   "rename.ico"
210   ICON   "delete.ico"
211   ICON   "chmod.ico"
212   ICON   "none.ico"
213   ICON   "warning.ico"
214   ICON   "tl-smazat.ico"

 

EDIT2:

Here is link to my old topic where I posted attachment Resource compiler (RC52.zip)

 

Edited by Zedna
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...