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" ?>
<Package
xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
Name="DisplayName" Culture="Culture" LicenseAgreement="eula.txt"
>
<PackageFiles CopyAllPackageFiles="false">
<PackageFile Name="sqlexpr.exe" HomeSite="SqlExprExe"
PublicKey="3082010A0282010100CF38F7E1A4275EF8F0CCAACEFB3ADE3B6231460546BBF5B6051
AD3B3ACC29F0F4C670828C44310F53B75797F6A91F4D633C861BFFA9190007AF0791D5D6870F690B
29877B5031D2F9B9D9B75892F4A01417C9E7CCB87439BF49674999E98C1CF40575816F6C0D59216E
52485718F9949ED557C65C91F380023C53EAB11D6296CC69EA0705B7DD537D4677720C306CE85F84
E3480A035C41C53320157EFB128BD6C01E3AD40BC80A90949DB36E337F41D49AA2AA76BD019D3CC8
E9DD686467A134AD64519A553B3E2782F2E35976B4CC6E81AB0D3D1249069ABCEFC696E3E4CFB024
162DC07985D7E5CA74C27316B564CE198D8E0D11D718D3D2AC07F714DFFCF0203010001" />
<PackageFile Name="eula.txt" />
</PackageFiles>
<Commands Reboot="Defer">
<Command PackageFile="sqlexpr.exe"
Arguments="-q /norebootchk /qn reboot=ReallySuppress addlocal=all
instancename=SQLEXPRESS sapwd=sssaaa999 securitymode=SQL
SCCCHECKLEVEL=IncompatibleComponents:1 SQLAUTOSTART=1"
EstimatedInstalledBytes="225000000" EstimatedInstallSeconds="420">
<InstallConditions>
<BypassIf Property="SQLExpressInstalled" Compare="ValueEqualTo" Value="0" />
<BypassIf Property="VersionNT" Compare="VersionGreaterThanOrEqualTo"
Value="5.1" />
<FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false"
String="AdminRequired" />
<FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatform" />
<FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.0.4"
String="InvalidPlatform2K" />
</InstallConditions>
<ExitCodes>
<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"
String="GeneralFailure" />
</ExitCodes>
</Command>
</Commands>
<!-- Strings, removed from listing -->
</Package>
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'