views:

78

answers:

1

I have an application that will use a device in some cases (i.e. printer). Basically, in one office this printer will be used, and in another office this printer will never be used.

The functionality to use the printer is sitting in the application code, and the dll's that communicate with the printer are referenced in the code. So the dll's are part of the installation .msi package.

However, these dll's cannot be registered during the installation if the prerequisite (a bunch of drivers for the printer, provided by manufacturer as a single installation exe) is not installed. The installer for the drivers is about 50M size.

I do not want to include an extra 50M file in the installation package for the office that will never use the printer. What are the possible workarounds for the problem?

Ultimately, I would want an option to somehow skip registration of these dll's during the installation. But I do not know how to approach this.

I think I could have a conditional compilation in the code. But that would involve a significant amount of work to completely separate the code which talks to this type of printer from the rest of the application code.

Any possible solutions?

+2  A: 

Group the DLLs that are to be conditionally installed/registered a component. Then in your MSI's Component table, use the Condition column to depend on property to be set. In your MSI's locator tables, configure rows to look for the prerequisites and set the property.

You can learn more about this by reading:

http://msdn.microsoft.com/en-us/library/aa371564(VS.85).aspx

Ants
Can you please explain the "Group the DLLs into component" part a bit? Is it just placing them in a separate folder, or more than that?As for the rest, I'll give it a try after the weekend. Good that I already spent some time playing with Orca recently =).
Evgeny
Actually, did that already. Just looked up my dlls in 'Files', wrote down 'Component', went to 'Component' and set 'Condition' to 1=0.Works like a charm =)
Evgeny