tags:

views:

265

answers:

1

I am deploying a package which sets up an instance of SQL Server 2008 and an IIS virtual dir. It makes sense that a user might want to install multiple instances of this program on the same system.

I know that I can use GetPreviousData() in uninstall to get the last installed instance, and uninstall that one. However, it seems like the rest of the installations would just get lost.

For example, say a user specified instance names "Site1, Site2, Site3" and then uninstalled. Sites1 and Site2 would probably get orphaned, and Site3 would be correctly uninstalled.

Is there anyway to augment that? For example, can I ask the user what site to uninstall during uninstall, or am I going to have to make this a two-stage system?

+1  A: 

There are basically two ways to install your package:

  • with a different name and AppId for each installation.
  • with all installations sharing the same name and AppId.

In the first case the user gets an icon for each instance in the Software applet, so they can all be uninstalled individually. In that case all common components would have to be kept until the last instance is removed, use of the sharedfile flag would help with this.

In the second case management of instances is different from installing or uninstalling the whole package. I would therefore probably simply create a tool to manage instances of the package, and execute this during during installation and uninstallation. Using Pascal scripting it is possible to execute an external application, and skip further installation or deinstallation steps depending on the result code of the executed program.

Actually, for all but the first installation and last uninstallation the work would be done solely by this tool.

The management tool could even have its own icon in the program group, so that instances could be added, modified or deleted without using the Software control applet.

mghie
That's basically what I thought. I can't generate multiple installers because the site names chosen by the users can be anything they want, and are chosen at install time. Not build time. I had wanted to avoid a per-instance config tool, but that may not be possible.
Christopher
Well, if you have only one installer, then using the installer as the primary / only way to manage multiple instances seems wrong to me. You will of course need some way to manage and store the information about the registered instances. This is not what GetPreviousData() et al is intended for. It probably could be done using Inno Setup, but why? The scripting engine is a valuable tool, but it is no replacement for a general purpose programming language. Use the best tool for a job and all that.
mghie