Nirav Mehta

Hi,

I am facing problem on Merge Module Install Condition.

there is no property to set Merge Module Install Condition.

In my installation i have put two selection box. 1. server 2. client

If user select server then only installer should install merge module.

But here merge module is also install for client.

I can put condition for other files and its works fine but I am facing problem in merge module

Need help please.

Thanks




Re: ClickOnce and Setup & Deployment Projects How to add Merge Module Install Condition ?

Ghaznavi

I don't think that there is a direct way to do this in VS 2005. But, you can do it by editing the MSI database at runtime or after building the MSI as post build event. You should create an invisible feature that will be installed conditionally. and place the merge module in it. I don't know if this is the simplest solution, but this is what i can think of.

Here is the information about the Installer database.

Let me know if this solves your problem.

Ghaznavi





Re: ClickOnce and Setup & Deployment Projects How to add Merge Module Install Condition ?

Nirav Mehta

Hi I am using VS 2005 to create .msi so from where I get installer database

Here is
step by step creation on .msi

1. launch Microsoft VS 2005
2. create new setup and diployment project.
3. in file system edior i have added all setup file.
4. select user interface editor
5 . add new checkboxs(A) page for select (1) server (2) Client.
6. Now right click on setup project
7. select add merge Module
8. select BDE_Pro.msm file.
9. In file system edior i have set propery value for Condition Client=1 and for server = 1 for respective files.
10. there is no condtion propery for merge module file.
11. then i build this setup and create .msi
12. Now install setup.. select server
13 It will install all server files and merge module.
14. And now if I select client setup it still install merge module. (because condition is not set)

15. I dont want to install merge module if user select client during installation.

Regards,






Re: ClickOnce and Setup & Deployment Projects How to add Merge Module Install Condition ?

Ghaznavi

Hi,

Unfortunately, the setup creation with VS 2005 does not have a feature based editor. When we talk about installer database, we are talking about the msi file itself. Windows Installer manages all setup information in msi file in the form of a relational database. Whatever properties you set for your setup using VS 2005, go into that database. Using the windows installer API you can manipulate the database and update any information you want.

By default, VS places all files under one (default) feature. Now, for your problem, you need to create a separate invisible (see Display column of Feature table) feature for the merge module in order to have a condition on it. To create your own feature, you have to update the installer database (msi) either at run time or as post-build event. If you want to do it at runtime, you have to write a custom action that opens the msi and update the database records before the installer kicks off the installation. (A custom action can be implemented in a dll, as an exe, or as VBScript or Jscript). If you want to do it at the build time, you should do the same thing as part of post-build event, but that would update the msi file itself rather than waiting for the runtime loading of database. I know this is a bit lengthy task, but this is the only solution i can think of (as per my limited knowledge) using VS 2005 so far.

Here are some useful links about this issue:

Let me know if this helps.

Regards,

Ghaznavi