In Windows Explorer, navigate to the following folder:
[drive]\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bootstrapper\Packages\
Within this folder you will see these subfolders:
There is one folder for each application for which the Bootstrapper has defined manifest files. When the final version of Visual Studio 2005 is released, there will be additional options.
Inside the SqlExpress folder we see the following:
Manifest files are XML files, and there are two types of manifests. Product manifests and Package manifests have similar elements and attributes, but Product manifests are for the non-localization-specific files of the application, and Package manifests are for the localization-specific files. It happens that dotnetfx.exe is non-language specific, because there is a separate language pack to handle that aspect. Therefore, dotnetfx.exe is in a dotnetfx folder directly within the Packages folder, and has a product.xml manifest file. Contents for the en folder are shown below:
The install file for SQL Server Express, sqlexpr.exe, is in the en folder (English folder) below the SqlExpress folder, since that file is language-specific and associated with a package.xml manifest file. Note that in the SqlExpress folder we have the SqlExpressChk.exe file, which is an application that checks to see if SqlExpress is already installed on the target machine. This application is non-language-specific and therefore has a product.xml manifest file. You may examine both, but we primarily want to look at sqlexpr.exe's package.xml file to see if we can modify the install to use SqlAuthentication with a known sa password, which needs to be a strong password.
Listing 1: Package.xml Manifest File for Sqlexpr.exe
<?xml version="1.0" encoding="utf-8" ?>
Name="DisplayName" Culture="Culture" LicenseAgreement="eula.txt"
<PackageFile Name="sqlexpr.exe" HomeSite="SqlExprExe"
<PackageFile Name="eula.txt" />
Arguments="-q /norebootchk /qn reboot=ReallySuppress addlocal=all
instancename=SQLEXPRESS sapwd=sssaaa999 securitymode=SQL
<BypassIf Property="SQLExpressInstalled" Compare="ValueEqualTo" Value="0" />
<BypassIf Property="VersionNT" Compare="VersionGreaterThanOrEqualTo"
<FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false"
<FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatform" />
<FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.0.4"
<ExitCode Value="0" Result="Success" />
<ExitCode Value="1641" Result="SuccessReboot" />
<ExitCode Value="3010" Result="SuccessReboot" />
<ExitCode Value="50037" Result="Fail" String="MissingMSXml" />
<ExitCode Value="50251" Result="Fail" String="MissingMSXml" />
<ExitCode Value="50198" Result="Fail" String="InsufficientHardware" />
<ExitCode Value="50236" Result="Fail" String="InsufficientHardware" />
<ExitCode Value="50222" Result="Fail" String="InvalidPlatformOSServicePacks" />
<ExitCode Value="70003" Result="Fail" String="InvalidPlatformOSServicePacks" />
<ExitCode Value="50247" Result="Fail" String="InvalidPaltformIE" />
<ExitCode Value="50248" Result="Fail" String="InvalidPaltformIE" />
<ExitCode Value="70004" Result="Fail" String="AnotherInstanceRunning" />
<ExitCode Value="70032" Result="Fail" String="BetaComponentsFailure" />
<ExitCode Value="70033" Result="Fail" String="InvalidPlatformArchitecture" />
<DefaultExitCode Result="Fail" FormatMessageFromSystem="true"
<!-- Strings, removed from listing -->
Within the Command element of the Commands element, there is an Arguments parameter. To this parameter I have added two arguments: sapwd=sssaaa999 (replace sssaaa999 with your password) and securitymode=SQL. The other arguments were already there. So it is as simple as that to add SqlAuthentication with a known password, except there are two gotchas that should be handled by the time the final version of Visual Studio 2005 is released. Note that there are two Command elements inside the Commands element. They are identical and both relate to sqlexpr.exe. I found that if I didn’t add the two new arguments into both, the bootstrapper read the second command without the additional arguments, and created a default install anyway. If the second one was deleted it probably would work fine as a solution to this gotcha. Then, after testing this, I created an install that did not finish, which gave me an error:
This app requires that your Windows be updated to: Microsoft.ReportViewer.Winforms
Until this problem is corrected in the final version of Visual Studio 2005, the workaround is to open the project's properties, select the Pubish tab, and click on the Application Files button. You will see two entries relating to ReportViewer that need their Publish Status changed to Include rather than the default status of Include(Auto).
Another thing of which to be aware is that if you turn versioning off (because you don't want a new version every time you publish), you may have to delete the five things that a publish puts on your website or other install server, to ensure your next publish takes over:
1) a folder named something like (for version one) 'myapp_1_0_0_0'
2) a file named 'setup.exe'
3) a file named 'publish.htm'
4) a file named 'myapp.application'
5) a file named 'myapp_1_0_0_0.application'