If you have a web app merge module and an exe merge module included in the same setup-deployment project, the Context.Parameters["AssemblyPath"] value inside the custom action for each merge module gets messed up. Try creating a setup-deployment project that has a web project and an app project like this:
- Create a Web project
- Create a merge module for that web project
- Create a regular App project
- Create a merge module for that app
- Create a setup project that has both the above merge modules
- Create a project for custom installer.
- In the Commit() method override, access Context.Parameters["AssemblyPath"] and debug print out the value.
- Add this custom action project output to both your merge modules. Now do the install. You would expect different values to be printed depending on which merge module is calling this custom action. But they are the same ! Sometimes it is c:\inetpub\wwwroot and sometimes it is C:\MyAppDir...
The merge module files do end up in the right place though:
The Web project content goes to C:\Inetpub\wwwroot\
while the App project goes to 'module retargetable folder'.
You will also notice the customactions.dll included in each merge module will end up in the right places (c:\inetpub\wwwroot\ in once case and 'module retargetable folder' in the other').
But the debug print out of Context.Parameters["AssemblyPath"] will show the same value in BOTH cases (ie both merge modules). It will both be C:\Inetpub\wwwroot\CustomActions.dll
or <targetdir>
\CustomActions.dll. This is wrong !
The debug print should show
C:\Inetpub\wwwroot\CustomActions.dll when the debug print is coming from the web project based merge module and
<targetdir>
\CustomActions.dll when the debug print is coming from the app project based merge module.
Does anybody know why the value is not updated per merge module ? Is this a bug in Microsoft VS ?