What's going on with increasing exe filesize?

Post your Gambas programming questions here.
Post Reply
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

What's going on with increasing exe filesize?

Post by BruceSteers »

So here's me scenario...
That GForm app i've made i didn't want/need the cumbersome .gambas on the end of it so i rename it to just GForm.

Then...
When i recompile the GForm.gambas exe while the GForm exe exists in the folder my new exe becomes larger ???
When i say larger it got up to 26mb , just the Gambas exe alone. wtf !!

If I delete the renamed GForm file and compile again the new GForm.gambas exe suddenly drops to just under 400k

It's like the contents of the folder are being added to the compiled exe or something?

Very strange behaviour..
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: What's going on with increasing exe filesize?

Post by BruceSteers »

Answering my own question here.

Just read this in the Gambas beginers guide...

"The Gambas
archiver transforms the entire project directory structure into a standalone
executable."

Now i did not know that , better clear everything out of the folder that's not code i guess :-\
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: What's going on with increasing exe filesize?

Post by BruceSteers »

Cleared all the images, help files, scripts out of the folder and just left the GForm code

Now the executable filesize has gone from 600k to 22.1k

Wow.

There's a lesson for us all

So each time i renamed the exe to just GForm the next compilation would add the GForm exe to the GForm.gambas exe

adding the exe that's had exe's already added to it to the new exe over and over again :-\
If at first you don't succeed , try doing something differently.
BruceS
User avatar
sjsepan
Posts: 68
Joined: Saturday 12th October 2019 10:11pm
Location: Leeper, PA, USA
Contact:

Re: What's going on with increasing exe filesize?

Post by sjsepan »

Good to know! Thanks,
SteveS
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: What's going on with increasing exe filesize?

Post by BruceSteers »

You're welcome :)
I agree , it was good to know and worth sharing i thought for those who didn't know,
I wish i'd known it before.

It certainly has a plus side though.
i've now realised i can make my app show some help texts using some text files i've put in the source folder , now after the app is compiled the text files don't need to exist with the Executable , they are built in and load using just the filenames with no path prefix.
:)
If at first you don't succeed , try doing something differently.
BruceS
Post Reply