QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: FilipeEstima on April 25, 2019, 01:14:56 pm
-
Where should I add an instruction that will, upon finishing the executable compilation, automatically UPX it?
-
It sounds like you will need to make a shell or powershell script for that: https://www.rootusers.com/how-to-zipunzip-files-in-windows-with-powershell/
You can use SHELL to compile a QB64 file and then work with powershell to archive it, or whatever.
Is this what you are trying to do?
Pete
-
I read somewhere in this forum that adding -o2 to internal\c\makeline.win.txt would make the compiled executables to run faster, due to better code optimization.
So this got me thinking. Maybe there is a place where I can add upx %.exe (or whatever) to automatically compress the compiled executable, every time. It is most likely doable, I just don't know exactly how or where to add code to do it.
-
UPX is an in-place executable compressor. It makes the EXE much smaller without significant overhead to load it. It would be nice if QB64 used -O2 and UPX by default.
It sounds like you will need to make a shell or powershell script for that: https://www.rootusers.com/how-to-zipunzip-files-in-windows-with-powershell/
You can use SHELL to compile a QB64 file and then work with powershell to archive it, or whatever.
Is this what you are trying to do?
Pete
The optimisation parameter -O2 is just for the compiler. You'll need to do the UPX compression after QB64 compiles the executable. I'm not sure if there's a data/config file you can edit for adding this post compile command. If not, you'd need to manually edit the QB64.bas file to do the UPX command, then recompile QB64.EXE.
I read somewhere in this forum that adding -o2 to internal\c\makeline.win.txt would make the compiled executables to run faster, due to better code optimization.
So this got me thinking. Maybe there is a place where I can add upx %.exe (or whatever) to automatically compress the compiled executable, every time. It is most likely doable, I just don't know exactly how or where to add code to do it.