There are basically two ways to install an application in Windows. Let me call them the old way and the new way.
The old way
You need to manually perform the following steps:
Copy all required files to a location accessible by all users, such as C:\Program Files\YourApplication
(or \Program Files (x86)
, if it's a 32-bit application on 64-bit Windows).
Install and register all prerequisites (such a the .NET Framework).
Create start menu and/or desktop icons for all users by placing them in the appropriate location. For example, for Windows 7 this would be C:\ProgramData\Microsoft\Windows\Start Menu\Programs
and C:\Users\Public\Desktop
.
(Optional) Create an executable that reverses all the above steps (e.g. uninstall.exe
), copy it to your program files subdirectory and create an entry in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
that points to this unstallation exe. This will allow users to uninstall your application.
This is how it has been done for ages. Windows does not know which applications are installed, it just knows which applications can be uninstalled.
The new way
You provide an MSI file, which is basically a database containing information about your software and how it should be installed and let Windows Installer do all the work. Windows 2000 was the first operating system to include Windows Installer out-of-the-box.
Windows Installer does keep track of installed programs, which allows it to do useful stuff such as
- determining whether a patch fits the installed version,
- re-install missing files that have accidentally been removed,
- etc.
Note that the Windows Installer configuration data is not easily accessible, so you cannot just add a few registry entries to "register" your application with Windows Installer. If you want Windows Installer, you need an MSI file.
The MSI format is quite complex, however, which is why tools such as InstallShield, WiX, etc. have been developed. WiX, for example, is basically a XML -> MSI conversion tool. It's still very close to the MSI structure but simplifies a lot of things. (Yes, WiX is complex, but MSI even more so.)