File Size For Project With Only One Button Is Too Big

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
vizualDevelop
Posts: 22
Joined: Wed Jan 20, 2021 12:36 am

File Size For Project With Only One Button Is Too Big

Post by vizualDevelop » Wed Jan 20, 2021 12:59 am

I am just starting to learn LiveCode so I followed a tutorial, dragged a button, added three lines of code in MouseUp. That´s it.
Exported as Windows standalone.
Size of the executable is 16 MB.

Why is the file size so big?
Are there any settings to reduce the file size? I mean, what will happen when my project becomes more complex...?
I have some experience with other programming language and environment and I know Window executables are quite large but... for a single button?
I am using LiveCode Indy in Windows 10, 64 bits.

When exported as 32 bits standalone size is 14 MB.

thanks a lot.

PS: I want to share my file but forum does not allow tho share URL link!

David R.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: File Size For Project With Only One Button Is Too Big

Post by dunbarx » Wed Jan 20, 2021 1:06 am

I am on a Mac, and the basic standAlone I maintain is 39MB. The Windows version is 17MB.

Remember that the entire engine needs to ride inside the executable to run the standalone. The actual stacks that make up the package are about 2.7MB.

Craig

kdjanz
Posts: 300
Joined: Fri Dec 09, 2011 12:12 pm

Re: File Size For Project With Only One Button Is Too Big

Post by kdjanz » Wed Jan 20, 2021 1:11 am

The file size is that big because the Livecode engine is embedded in the stand alone. The minimum size is that 16 MB, but it will only grow very slowly as the code increases. If you had lots of graphics or videos inside the app, it will grow quickly again. But the actual code and vector based UI elements are small, so they will have little effect on size.

If you look at other apps, you will see that 16 MB is still pretty modest these days...

You have to make 10 posts on the forum before you have graphics posting and attachment privileges. Keep posting and asking questions and you could be up to full status tomorrow. 8-) There are a lot of one or two message spammers that seem to be attracted here.

Welcome!

Kelly

vizualDevelop
Posts: 22
Joined: Wed Jan 20, 2021 12:36 am

Re: File Size For Project With Only One Button Is Too Big

Post by vizualDevelop » Wed Jan 20, 2021 1:17 am

dunbarx wrote:
Wed Jan 20, 2021 1:06 am
I am on a Mac, and the basic standAlone I maintain is 39MB. The Windows version is 17MB.

Remember that the entire engine needs to ride inside the executable to run the standalone. The actual stacks that make up the package are about 2MB.

Craig
thanks Craig, good to know that the actual stacks are small.

vizualDevelop
Posts: 22
Joined: Wed Jan 20, 2021 12:36 am

Re: File Size For Project With Only One Button Is Too Big

Post by vizualDevelop » Wed Jan 20, 2021 1:22 am

kdjanz wrote:
Wed Jan 20, 2021 1:11 am
The file size is that big because the Livecode engine is embedded in the stand alone. The minimum size is that 16 MB, but it will only grow very slowly as the code increases. If you had lots of graphics or videos inside the app, it will grow quickly again. But the actual code and vector based UI elements are small, so they will have little effect on size.

If you look at other apps, you will see that 16 MB is still pretty modest these days...

You have to make 10 posts on the forum before you have graphics posting and attachment privileges. Keep posting and asking questions and you could be up to full status tomorrow. 8-) There are a lot of one or two message spammers that seem to be attracted here.

Welcome!

Kelly
Thanks Kelly!
I am working on a project that will use simple vector graphics (rectangles, circles) and I might use images to be loaded as requested.
It will connect to database.
I know that 16 MB is modest compared to other Window apps (even comparing to what Craig reported in Mac standalone) but I prefer small files whenever possible.
Anyway LiveCode seems a fantastic alternative for my needs.

David R.

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: File Size For Project With Only One Button Is Too Big

Post by bogs » Wed Jan 20, 2021 10:13 am

There are a few things you can do to keep the final size as small as possible (in this case with the newest IDEs, roughly around the 17 to 30 or so MB size depending on platform) .

One thing you can do is make either a generic or specific launcher stack, and develop the main part of the program as just plain stacks. As an example, this is how the IDE is made up (for the most part), as you can see below -
aPic_IDE-1.png
GREAT SCOTT!
The 3 parts your likely to see most often (The menubar, tools and project browser palettes) which have more than a few objects on them, come in at pretty paltry sizes, as shown below -
aPic_IDE-2.png
A brick from here, a stud from there...
Please note that a number of the parts that comprise the IDE have been changed from standard stacks to script only stacks, however, the savings in size is not that far different, if it exists at all. The menubar folder, for instance, currently totals 106 items @ 409.4 kb in size total. In the previous IDE where it was just a stack with substacks, its size was 657.6 kb.

Finally, you can point that launcher either at a local file or a hosted one, should you so decide. If you update your program, you don't need to reship the executable again, just the parts that make it up which are quite small. If you host the files and the app calls the server for them, the end user sees no difference between out of date and up to date.

How does this compare to a program using one of the languages you can make the exe smaller in? I'll use the one I'm most familiar with, Free Pascal + Lazarus (think Delphi 7) which is cross platform much like Lc, and Real Basic which is probably the closest competitor Lc has at the moment.

Your simple test,
Lazarus + FPC - a stack and button with no code can be stripped when compiled to produce a 5.8 MB exe. If you decide to update it, you have to deliver that size at minimum each and every time.

RealBasic / Xojo - the exe is small (1.5 MB) but requires libs to run. All told, when tested it totaled 39 MB total for a stack, button, and no code.

Something to think about.
Image

vizualDevelop
Posts: 22
Joined: Wed Jan 20, 2021 12:36 am

Re: File Size For Project With Only One Button Is Too Big

Post by vizualDevelop » Mon Jan 25, 2021 4:47 pm

bogs,
yes, definitely something to think about!

I am just starting to learn Livecode but I believe I understand what you say about making several stacks to make it easy to update and keep size small.

I will try it, thanks a lot.

David R.

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: File Size For Project With Only One Button Is Too Big

Post by bogs » Mon Jan 25, 2021 5:02 pm

This lesson should give you a good idea of how it works - https://lessons.livecode.com/m/4071/l/1 ... pplication
Image

vizualDevelop
Posts: 22
Joined: Wed Jan 20, 2021 12:36 am

Re: File Size For Project With Only One Button Is Too Big

Post by vizualDevelop » Mon Jan 25, 2021 6:48 pm

bogs wrote:
Mon Jan 25, 2021 5:02 pm
This lesson should give you a good idea of how it works - https://lessons.livecode.com/m/4071/l/1 ... pplication
Nice.
So the concept of having a standalone "launcher" that only calls for the Main App is very good and I believe it can be applied like this:
- The .exe file (launcher) can appear as a shortcut file in desktop PC. That way the .exe itself is very lightweight and keeps the livecode MainApp from being visible.

David R.

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: File Size For Project With Only One Button Is Too Big

Post by bogs » Mon Jan 25, 2021 7:08 pm

You can actually see just how fast it works even when calling a stack from over the net from inside the IDE, thanks to FourthWorld.

If you go to the Development menu and drop down to Plugins, you'll see a selection called "GoRevNet". In this example, the launcher would be the actual IDE itself, the plugin is just a stack which calls another stack to show up from a server which populates the plugin.

If you want a real treat, click on the various buttons. He did a nice job with the movements ;)
Image

vizualDevelop
Posts: 22
Joined: Wed Jan 20, 2021 12:36 am

Re: File Size For Project With Only One Button Is Too Big

Post by vizualDevelop » Mon Jan 25, 2021 7:47 pm

Great to know FourthWorld has us covered!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: File Size For Project With Only One Button Is Too Big

Post by FourthWorld » Tue Feb 02, 2021 6:57 pm

bogs wrote:
Mon Jan 25, 2021 7:08 pm
You can actually see just how fast it works even when calling a stack from over the net from inside the IDE, thanks to FourthWorld.

If you go to the Development menu and drop down to Plugins, you'll see a selection called "GoRevNet". In this example, the launcher would be the actual IDE itself, the plugin is just a stack which calls another stack to show up from a server which populates the plugin.

If you want a real treat, click on the various buttons. He did a nice job with the movements ;)
Thanks for the kind words, Bogs.

In recent version the name of the plugin has been changed to "GoLiveNet", though the functionality as a living demo of a downloadable mashup of network services remains its mission.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: File Size For Project With Only One Button Is Too Big

Post by bogs » Tue Feb 02, 2021 7:41 pm

FourthWorld wrote:
Tue Feb 02, 2021 6:57 pm
In recent version the name of the plugin has been changed to "GoLiveNet"
LOL! I'm glad you popped in to say so, seeing as I almost never am in the newer versions, and didn't know heh :oops:
Image

Post Reply