views:

199

answers:

2

I have 2 projects. I want to create ONE single MSI setup package that will install both of those projects.

In My Application Folder I have created 2 subfolders (Project A and Project B folder). So after the install, the project ouputs will be in Program Files\MyProduct\Project A Program Files\MyProduct\Project B

The problem I am having is that Project A and Project B references some common assemblies. But those common assemblies is only copied to Project A folder.

Is there a way to force the msi to copy the common assemblies to Project A and Project B folder ?

A: 

In your setup project I assume you have two folders, one for each project. Select the folder that is missing the .dll(s) and right-click it, hit Add->File... and choose the .dll that you want to force to be included with the project output.

Jacob Ewald
I thought of that but Is this the correct way? I would of like for the MSI to detect that the project output has been moved to some folder and that it will put the dependency directly. But it only does this for one of the project.With your solution, what dll am I suppose to use? I might be creating a setup in DEBUG or in RELEASE, I don't want to have to manually add the corresponding file bin\Debug or bin\Release each time. The common assemblies are also project libraries.
pdiddy
From my understanding of MSI, there's just a database of changes that need to be made on the target system and one of the tables in the database contains the list of files to install. There's probably logic in the UI of the Setup project that detects your common assemblies as already being included so it skips them when you add the second project. Forcing it to add the file the way I described should force another entry in that file table.
Jacob Ewald
+1  A: 

Building MSI installers from within Visual Studio, as part of the build process, isn't always the most flexible method. I personally use NSIS as it is extremely powerful but if you're looking to build MSI installers, I suggest you look at Wix.

I rarely let Visual Studio do things for me automatically - I like to be explicit when it comes to declaring which dlls are installed, and where.

Charlie Salts
Ditto that. The Visual Studio Setup project type is extremely limited. If you want to do something like this, you'll want to learn WiX or purchase a third party product like InstallShield. I looked at WiX briefly and found it was fairly complicated to learn (because the MSI standard is complicated).
Josh Kodroff
I also looked briefly at WiX. Well seems like to get more flexibility=complexity. But for now, my only option is Visual Studio Setup project
pdiddy
@pdiddy - You're right, flexibility does mean complexity. But you'll also create unnecessary complexity by using the wrong tool for the job.
Charlie Salts