PDA

View Full Version : How to write a condition for required software to be installed on the machine



norziha
09-28-2011, 01:02 AM
Hi all,

Anybody know how to create the condition if my application required Microsft SQL server 2008 R2 Express and IIS 7.0 to be installed on the machine before user can install it.

On the installation requirements there are specify the software required by the installation but the SQL Server 2008 R2 Express and IIS is not listed.

Does anybody can help me?
Thanks.

phill_mn
10-06-2011, 02:42 PM
IIS 7.0 is a 'feature' which is part of the operating system. Features are enabled (installed) or disabled using DISM.exe on Vista or later. (IIS 7.5 is on Win 7/2008 R2). So there is not a separate setup package that could be added to your setup. Look up information on Component Based Servicing. You may see some examples using pkgmgr.exe which will also work on Vista, but pkgmgr has been deprecated in favior of dism.exe on Win7 or later. dism.exe can take the names of 'features' to enable on the command line or you can use an unattended XML file to list the 'features' to be enabled.

A problem that I continue to struggle with when using the unattended file is how to get the correct value for the package version required in the unattended file. Most of the information that I have found suggesting using the CBS registry key or the version of a system file is just wrong, in that it might work for one version of the OS but when Microsoft pushes out a SP that method of getting the version breaks. I am currently working on trying to solve this problem by calling dism.exe to get all packages, pipe that to a file, and then grep the file to find the correct version for the installed package. This version string is applied to a XML file change prior to calling dism.exe again to install IIS. If anyone knows of a more reliable API to get the package version I would love to hear it!

I don't have any advice on SQL Server.
Phill