0

I have been programming for a few years, and I still don't understand how an EXE installer can sometimes be so much smaller than the program that it installs.

I can understand that using high-level classes will translate into a lot of machine code (meaning that the source files will be smaller than the machine code they create), but can that really account for the occasionally massive discrepancy?

What could code do to generate disproportionately more information than there is source code? It obviously isn't just a bunch of for-loops writing the same phrase repeatedly into a number of files. How can a small program create meaningful information in a disproportionate ratio to the amount of code running it?

2
  • 3
    They are compressed exe's, they unpack during installation.
    – Moab
    Oct 13, 2020 at 0:02
  • 1
    @Moab is correct. In addition, EXE files more and more go to their home website to get the rest of the install. So they are, in effect, just stubs.
    – John
    Oct 13, 2020 at 0:34

2 Answers 2

3

@Mj535 is right. Basically they work in some specific ways:

  • Some .exe installers also are online installers. After running them they connect to the internet and download the files, and after downloading them install the files. A good example is Visual Studio installer. These installers are the smallest.

  • Some are offline installers, which contain the files compressed and extracts the files from itself while installing. So you see Copying Files stage while installing programs from offline installer.

  • MSI installers compress files into CAB files inside it.

2

Basically, it works two ways:

An EXE has compressed files and decompresses them on the launch of it, or an EXE goes to a specific server link and downloads the files to your computer.

If you were making an EXE, an optimal choice would be to compress huge files and download the smaller ones from a server. This makes for a fast time for the user.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .