views:

283

answers:

4

To get an application installed on a new computer there seems to be two major approaches in current use:

  1. Separate installer: Create a separate installer package that creates all directories, files, registry entries required by your application (ie an MSI, InstallSheild etc) and then finally copies your application to the target computer.
  2. Self installer: Include all required installation steps in a component that is part of your application. Then use this component to check and create required settings each time the main application executable is run. ie Just run the application to install.

I've used a few applications that corrupt their settings over time, and most had a separate installer. Therefore the only fix was to to re-install, sometimes with settings and even data being lost (very frustrating).

Also during software projects I've worked on, the separate installer approach often dictated spreading application specific knowledge across both the installer package and the actual application. Then, when code/functionality changes were made, both the installer and app needed to be updated. It always felt a bit too brittle and prone to human error.

So I'm currently leaning toward the self installer approach because of a simpler more robust installation/setup, ie just run the app. This self installing approach I feel would also lend itself a more robust application.

Integration with in application settings (options) would also be much more clean, in many cases the same component could perform both installation and settings management.

On the negative, however, performing these extra checks/steps each time the app starts might negatively impact startup times, and OS integration might be a bit more work then using a standard installer.

So which approach to people recommend and why?

(I'm most interested in installation of desktop rich client applications at present.)

+2  A: 

I would recommend a separate installer that can do the following:

  • Install a new installation
  • Repair an existing installation
  • Remove an existing installation

The reason I recommend these options is because that is what I have come to expect for installers in Windows environments.

The reasons I recommend separating installation and application logic into two different applications area:

  • There may be conflicts between dependencies used used by the installer and application.
  • I want to be sure my team don't inadvertently use classes in the dependencies from the installer framework when developing the application.
bmatthews68
WHY do you recommend that?
Oddthinking
Because keeping it simple is really the way to go, I hate installers that asks me for a bunch of things I possibly couldn't know how to answer. Have you heard of a program called uTorren? I think every app out there should strive to be just that, mean and lean.
John Leidegren
@Oddthinking - Because thats the usual behavior for installers on Windows platforms.
bmatthews68
@John - I am worried about the scenario were we create an installer with a dependency on some third party library that I don't want used in the main application. I don't want to have to look over my team's shoulders to make sure they haven't used a class because just because it was there.
bmatthews68
OK, but just because it's usual behaviour does not mean it's the best for every situation. In my experience most the idea of an installer is not immedialtey understood by non-tech users. I've often been asked why a program can't just be copied from one computer to another. It's a valid question.
Ash
+7  A: 

There are pros and cons to both approaches:

  • Having an installer is the proper way to install necessary system components, like drivers, libraries, COM components and so on. Since many of these activities need elevated permissions the install may be performed by the administrator, while the application can be used by all users.

  • There may actually be requirements for a scriptable installation procedure in corporate environments.

  • Not having an installer opens the way to portable applications. If the program has everything in a directory, then this can simply be copied to a USB stick and be run on any system. This may of course not make sense for your particular kind of app, but that is for you to decide.

I'm not sure that the issue about corrupted settings is really important here. If settings are corrupted (why?) - how is the application to know what to do about it? OTOH the installer can of course also be written to not blindly overwrite any old settings. It all depends...

Edit: You write in your comment:

Even portable apps require certain configuration/settings, Isn't it better to have the main app check that settings are valid/exist on each startup, and only prompt the user when needed.

and again, it really depends on your needs. There are different types of configuration settings or preferences, and you have to decide individually:

  • Per-user configuration settings will be missing if the application is run for the first time by the current user. It can be helpful to show a message that it is missing, and how to create it. For example in FlameRobin (a database administration program for Firebird) we have a message that is shown when no registered servers and databases are found on program startup, and how to register them.

  • Per-user settings for UI behaviour will also be missing, but there are default values for them. The user will get the default behaviour of the application, and can later change things in the option dialog. Since it is best to minimize the number of such settings, and since the defaults should be what most users expect or what works best in the general case, there is also no need to bother the user at program startup.

  • Some configuration may be not per-user, but per-program. This is generally stored in a location where standard users have no write access, so checking for this and prompt the user to enter it is not really helpful. What could be done is to start an external program, asking the standard user for the account with sufficient privileges and its password.

mghie
I strongly support not having an installer, and allowing the application to be portable. Eclipse (www.eclipse.org) is the best examples I can think of. Very rich application, yet still portable.
Hosam Aly
Fair points regarding system components, but I'm really just interested in desktop rich client apps for now. Even portable apps require certain configuration/settings, Isn't it better to have the main app check that settings are valid/exist on each startup, and only prompt the user when needed.
Ash
+3  A: 

Going with a separate installer is the "better" way from my point of view. Making an application self-installing does not only add additional workload to the application itself, it also "works around" any installer system of the underlying operating system (like MSI on windows).

And if the application corrupt its settings over time it's broken and need to be fixed. How should corrupt settings be handled by the self-installer? Just overwrite it with the defaults? Users will get annoyed by that too, so having them to run a separate installer and choosing a "repair" option makes this at least more transparent.

bluebrother
I don't think it adds additonal workload overall though. It's just moving the effort. Corrupt/deleted/missing settings could simply be checked for by the self installer each time it is started. When found, the user is aksed to porovide a valid value or just accept a reasonable default.
Ash
A: 

Thanks for your feedback. I'm starting to think something along these lines would be a good compromise approach:

  • Choose the self installer approach by creating an installer component (class library) that is referenced by the main application.
  • This component is a core part of the application and is responsible for ensuring all configuration/settings exist and are valid.
  • The main app. executable, on each run, asks this component to check existance/validity of settings, and only prompt the user when required. This could be easily done in a user friendly manner by grouping all setting issues and presenting them in a single GUI (avoids a sequence of annoying dialogues).
  • For OS integration, the installer component (in the case of Windows) ensures an entry is added to the "Add Remove Programs" list for the application, as well as any other OS required conventions.
  • Within the application the standard options/settings screen is also provided by the installer component. This avoids duplicating settings management code.

I've asked this question because I've met many non-technical users who ask why they cannot simply copy an application from one computer to another, they can do this with their data (eg photos, documents etc). It's an extremely valid question, in particular for GUI oriented desktop applications.

Separate installers are certainly "the way it's been done" on Windows for many years. For drivers/system components, obviously they are often a necessity. But for desktop GUI style applications I don't believe they are the best in terms of simplicity and realiability for the user/customer.

Ash
The best self-installer I've used is WinZip. Copy the folder to a new box, it detects that and runs through a configuration wizard. Easy.If you decide to use a MSI for an app that requires drivers, COM, etc. it should still check its dependencies and alert the user early if something is missing.
devstuff
I didn't know Winzip did that, thanks, I'll try it out.
Ash
Your point about a simple xcopy install being best for users is taken. It does however also depend on the dev environment you are using. Delphi for example can produce a standalone executable. With MSVC++ 7 you can use static linking or deploy the runtime DLLs in the directory. For .NET apps or ...
mghie
the latest MSVC++ version you will need the runtime installed, and there you will *need* to perform some steps that are difficult to understand for the layman.
mghie
I'm working with .NET at present so yes, if the framework is the wrong version or not installed at all, theres not much can be done. However I am happy to include need for .NET Framework as part of system requirement information (similar to OS version etc). Good point though.
Ash