What are the benfits of a standalone Windows .exe vs an installer?
I am trying to make an application as easy to deploy as possible for Windows and I am trying to choose between packaging the ap开发者_如何学Pythonplication as a .exe or using an installer. I was wondering if anyone had opinions on the relative merits of either way? My preference would be to use a .exe as it would be just click and run for a user.
You should only need an installer if you have lots of components that need to be installed in specific places, or components that need to be registered for them to work (eg COM components that need to be added to the registry). An installer can obviously also add shortcuts to your app in the start menu etc.
If your app can exist as a single .exe file that can be run from anywhere in the file system, then that would be a much simpler and cleaner solution for a lot of people.
Keep in mind though, that less technical users might expect an installer and won't understand that there are no links in the start menu.
I just prefer dealing with a standalone exe, much less hassle, if you can get away with it (i.e.: you don't depend on a lot of other stuff).
- It's more portable than an installer application. You can copy it from one machine to another machine, or to another folder, easily.
- If you reinstall the OS, it doesn't break the application.
- You can have the application itself check for existence of a desktop and/or start-menu shortcut and create them if desired (perhaps according to a preference). E.g.: Textpad does this.
I've only been doing Windows development a short time, but one issue you might run into is dependencies. If you depend on .NET 3.5, for example, what do you do if a user does not have .NET 3.5 installed on his box? In that case, an installer might work better.
In general, standalone executables are much easier to work with. They are easy to move, delete, run from a portable drive, etc due to a lack of external dependencies. If your app does not need registry settings or does not require certain libraries or helper utilities to be placed in system folders, then a standalone .exe
will fit your problem.
If you do need to modify the registry, install files in different locations, create subfolders, etc, then you will need an installer of some sort. If you provide an installer, make sure you provide an un-installer as well (and make sure that the uninstaller doesn't leave behind orphan registry entries or temporary files).
To solve your problem both ways, you can have a single-file executable that is installed via an installer. That way, you get the benefits of both approaches (not to mention that the installer would be very easy to write in this case). I have also seen some apps that are available for download either as an installer or as a bare executable (let the user choose their preferred delivery option).
If you don't have any dependencies, don't have to add/change data in the registry, don't have to clean after your application removal/update, then using just an .exe seems quite reasonable.
精彩评论