What Does a Standard "Installation" actually do?

MrGreggles picture MrGreggles · Oct 27, 2009 · Viewed 7k times · Source

I'm just a hobbyist programmer more or less and have grown up coding-wise in the .NET ClickOnce world.

When one "installs" a program, what actually happens?!

Also: Some little apps/tools just run from the exe. Why do most programs need a fancy installation process? What are the advantages, disadvantages, pros & cons? Is installation usually necessary or more like standard practice?

Apologies for the extra questions. I'm just hoping for a plain-English more-or-less layman's explanation of the key factors.

Answer

Greg Hewgill picture Greg Hewgill · Oct 27, 2009

You're really looking at a lot of legacy reasons all rolled into what has become standard practice in the Windows world.

First, some contrast, because it isn't always this way. An "application" in Mac OS X is simply a directory with a certain structure inside it, named with a .app extension. Installing an application is as simple as dragging it (just the app icon) to your Applications folder, and uninstalling involves dragging it to the trash. That's it, no fancy installer is (usually) necessary.

On Windows, application are typically built from independent components which need to be "registered". This involves the installer program writing some bits and pieces to the Windows registry, to tell Windows where to find the components. Yes, the application probably should know where to find them (since they're all installed in the same place), but years of legacy and different ways of hooking up components has got us where we are today.

Typically, an installation program on Windows:

  • copies files
  • registers components
  • sets security permissions (if appropriate)
  • adds icons to the Start menu and/or desktop
  • writes more stuff to the registry to tell Windows to add the program to "Add and Remove Programs"