Search code examples
installationcompressionexe

Installer vs. zip or executable exe?


In most of the games and programs you download, you just get the installer. Some .exe files can be ran straightly, though (it's probably cause they don't have much source files to extract, huh?).

I was wondering, what's the difference between an installer, that just extracts the files, and a zip (rar, iso..) file, that you could download ,just depending on your internet speed, in up to few seconds. And where does a, maybe 200mb, installer fetch the, let's say 5gb of, files, offline?

I've never heard about this, and I'm learning to program, so I'd appreciate if you could answer me properly.


Solution

  • What you're really asking is:

    How does an installer work?

    A bit of background.

    Apple }{, Jobs' gift to humanity.

    In the Before Times, man did not have such things as "installers." Software was run directly off of floppy disks (and none of that rigid 3.5" crap, I'm talking disks that flopped), like God intended.

    Then came the first home computers with persistent hard drives. For the first time, it made sense to copy a program off a disk and have it stick around.

    But programs still worked the way "portable" applications do today: you copied them as-is and ran them as-is.

    Then operating systems began to get more complicated.

    The Great Satan?

    Windows introduced this notion of a registry: a central location where program and operating system configuration could be stored. Software authors began using this registry. Its arcane architecture and user-hostile editing utility (the infamous regedit.exe) made it the perfect place to store shareware information -- how many days you have left on your trial, for example.

    This happened around the same time that programs began to be too large to fit -- uncompressed -- on a single floppy disk. A way was needed to split a program onto multiple disks. Since it wasn't very user-friendly to require the user to have e.g. a ZIP extractor installed (remember, this was before ubiquitous Internet), Windows programs began to be shipped with installers. You can think of these as basically portable versions of WinZIP whose sole purpose was to reassemble and extract a compressed file.

    auuuuughhhhhhh

    These days, installers serve a number of other purposes:

    • providing a convenient user interface
    • prompting the user to accept a click-through end-user license agreement (EULA)
    • prompting the user for CD keys (though this is being phased out for many systems in favor of digital distribution)
    • asking the user to register their software

    and so on. They may also serve as DRM vehicles, validating CDs and decrypting data to prevent villainous individuals (yarr) from brrreakin' ye olde DMCA.

    At their heart, they aren't any more complex than in the Windows 95 days -- a glorified unzip program.

    Sidenote: Where does the installer get 5GB of data from 200MB of archives if not the Internet?

    That's high, though there are plenty of ways you could get that compression ratio. Imagine a complex game whose world is defined in verbose XML -- that's readily compressible. You could even get that back in the old WinZIP days.