Bala,
When you say you would like to have App.msi install after your install, it makes me ask if you control this App.msi or if you are using someone else's installer. The reason I am wondering this is because if you're in control of the App.msi, I would recommend changing that into a merge module and adding the output of this merge module to your installer project. This would be the simplest plan of attack if you're the writer of the App.msi. However, if you just want to install someone else's msi after yours is finished, you're on the right track. Basically the reason your getting the MSI option dialog is because something isn't quite formatted correctly. My guess here is that your custom action isn't calling out correctly to the MSIEXEC.EXE and thus causing the help options dialog to pop up. Without your source code I cannot be sure on what specifically is wrong, I can only show you an example of how I got it to work. My solution is as follows:
First, let's look at the solution if you do control the App.msi, and can convert it into a merge module. Here are the steps to do that:
- Create the merge module. Basically you just take the stuff you were doing in the MSI and move it to the Merge Module, they are basically the same as far as how Visual Studio displays them to you.
- Create your MSI project.
- Add the output of your merge module into your MSI.
- Compile and install your MSI.
Now for the case that you don't control the App.msi, here is what you need to do:
- Create a class library project, name it whatever you'd like. This project will contain the logic for calling out to your external msi file.
- Add a new item to this project of type Installer Class, again name this class whatever you'd like.
- Delete the generated Class1.vb (.cs) file as it is not required.
- Create your WPF project (or add your existing WPF project).
- Create a Setup Project, again naming whatever you'd like.
- In the class project, right click on the installer class, and view the code.
- Add code to your class for Install and Commit (See Figure 1 Below):
- In the installer project, add the primary output from the WPF application, and the class library.
- Add your App.msi file to the installer project.
- Open up the custom actions, right click on the custom actions root node, and click on "Add Custom Action...".
- Navigate to the primary output from your wpf project, click OK.
- Add the primary output from the class library in the same way.
- Select the primary output from the class library under the install node, and view its properties.
- Under the CustomActionData field, type this:
/OtherMSIPath="[TARGETDIR]\App.msi"
- Verify that InstallerClass field is set to True.
- Build and Install your application.
Figure 1:
Public Overrides Sub Install(ByVal stateSaver As System.Collections.IDictionary)
MyBase.Install(stateSaver)
stateSaver.Add("OtherMSIPath", Context.Parameters("OtherMSIPath"))
End Sub
Public Overrides Sub Commit(ByVal savedState As System.Collections.IDictionary)
MyBase.Commit(savedState)
System.Diagnostics.Process.Start("MSIEXEC.EXE", "/i """ & savedState.Item("OtherMSIPath").ToString & """ /qb")
End Sub
I've added this to the source code for the sample answer to this question to Google Code for you to download. You can checkout this example here using a subversion client.
I hope this helps,
Thanks!