bpeikes

Is there anyway to detect a "silent" install from an installer class

i.e. Check to see if msiexec has been called with the /qn flag

How about getting any properties For example, I'd like to be able to create an installer, but allow our administrators change the way it gets installed, especially for silent installs.


Re: ClickOnce and Setup & Deployment Projects Silent installs?

Matt Smith MSFT

I don't think this is possible. The msiexec display type is not a Windows installer property.

Be careful when taking this approach. One of the basic principles of Windows Installer is that the final client layout will essentially be the same for all display types (quiet, passive, etc). If you decide to modify the layout base on display type, you create a dependency between the application logic and the installation.

1. This could complicate uninstall. You would still need to cleanup those components that were modified for the quiet install.

2. You may decide to change the app installation technology to something that has no concept of "quiet" install. How would your application deal with this






Re: ClickOnce and Setup & Deployment Projects Silent installs?

bpeikes

I want to have the ability for an administrator to create a template for answers to install questions, and then install using the template. Any ideas on how to accomplish this i.e. The "normal" installer prompts the user for information, but if run in "silent" mode, the installer would get input from a configuration file instead.

As for uninstall, it would not make a difference if the install was silent or not because all information about the install would be in the saved state files anyway.





Re: ClickOnce and Setup & Deployment Projects Silent installs?

Matt Smith MSFT

Here's a couple of options:

1. For the admin scenario, pass the values of the user text as parameters to msiexec.

or

2. If no values are passed in/entered (whether it be silent or not) a custom action could detect empty strings and read default values from an xml file that's included in the install.






Re: ClickOnce and Setup & Deployment Projects Silent installs?

bpeikes

For option 1., how do you pass in parameters to msiexec, and once you do, how do I access them from within my installer classes





Re: ClickOnce and Setup & Deployment Projects Silent installs?


Re: ClickOnce and Setup & Deployment Projects Silent installs?

PhilWilson

There's a UILevel property that gets set depending on whether an msiexec command line specified a silent option:

http://msdn2.microsoft.com/en-us/library/aa372096.aspx

You could use this to condition custom actions or maybe pass it via CustomActionData.

You can set properties on the command line:

msiexec /i <path to msi> /q MYPROPERTY=Something

In an installer class CustomActionData you'd pass something like:

/argmyprop=[MYPROPERTY]

to get the actual value in Context.Parameters.