22 November, 2008

Why windows software installs are slower than uninstalls

Put the other way, why are uninstalls faster than installs? Windows was built to just incinerate a directory when its deleted. That is, the directory, or files are just removed from the partition table if you pressed Shift+Del (which it seems, everyone these days is very used to!). When installing, the program has to

>Look up the target drive and check if enough space is available or not.

>Unpack the files onto some temporary location (Most probably C:\windows\Downloaded program installations)

> Extract and copy the files onto the desired location on your installation directory

This is the step that possibly takes up a lot of time because the transfer is happening from the hard disk onto the hard disk as opposed to the transfer happening from some other medium to the hard disk which is atleast, a bit faster. Since the source and the destination of the files are on the same disk, the transfer bus is fully used, and thus the OS seems to get stuck. During this process, if you try to , say play your music collection with winamp, your pc would get stuck because the OS (which is quite a heavy resource consumer), your copy process(also a heavy weight) and your music player are all contending for CPU time. As and when the CPU gets more tasks in its queue, the system starts to become slower, as each task has a degenerating effect on the system, leading to the popular deadlock problem of computer science. When your PC gets locked up, you have to remove all your processes from the CPU queue. The easiest way to do which is to RESTART your computer, which I assume, all of us,windows users do from time to time. :)

>Seek a suitable location in the registry

>Enter keys in the registry


>Delete the temporary files

>Possibly do other tasks such as configure the application for first run
This basically involves the installer entering some values into the applications configuration files to tell the application that the next time the application runs would be its first on this machine.