Can I modify package.xml file in SQL bootstrapper to install a named SQL server instance
I want to use the SqlExpress2008 Bootstrapper for a new installation on Windows7, I do not want to use the default SQLEXPRESS Instance.
I have attempted to edit the package.xml file located in: C:\Program Files\Microsoft
SDKs\Windows\v7.0A\Bootstrapper\Packages\SqlExpress2008\en\package.xml
and updated the command argument instancename=CUSTOMINSTANCE
<Command PackageFile="SQLEXPR32_x86_ENU.EXE"
Arguments='/q /hideconsole /action=Install /features=SQL /instancename="CUSTOMINSTANCE" /enableranu=1 /sqlsvcaccount="NT Authority\Network Service" /AddCurrentUserAsSqlAdmin /skiprules=RebootRequiredCheck'
EstimatedInstalledBytes="225000000"
EstimatedInstallSeconds="420">
But unfortunately it still creates the default SQLEXPRESS not CUSTOMINSTANCE
The wix tag is as follows:
<sql:SqlDatabase
Id="SqlDatabaseCore"
ConfirmOverwrite="yes"
ContinueOnError="no"
CreateOnInstall="yes"
CreateOnReinstall="no"
CreateOnUninstall="no"
Database="MyDatabase"
DropOnInstall="no"
DropOnReinstall="no"
DropOnUninstall="no"
Instance="[SQLINSTANCE]"
Server="[SQLSERVER]">
<sql:SqlFileSpec
Id="SqlFileSpecCore"
Filename="[CommonAppDataFolder]MyCompany\Database\MyDatabase.mdf"
Name="MyDatabase" />
<sql:SqlLogFileSpec
Id="SqlLogFileSpecCore"
Filename="[CommonAppDataFolder]MyCompany\Database\MyDatabase.ldf"
Name="MyDatabaseLog" />
<Property Id开发者_C百科='SQLSERVER'>.</Property>
<Property Id='SQLINSTANCE'>CUSTOMINSTANCE</Property>
Is this the standard way to accomplish this?
I don't know about a standard but we passed the new instancename to the SQLExpress setup executable on the command line. First, decompress the SQLEXPRADV_x86_ENU.exe file into a temp directory,
string workingDir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
string pathToSQLSetupTempDirectory = workingDir + Path.DirectorySeparatorChar + "sqlsetup";
if (!System.IO.Directory.Exists(pathToSQLSetupTempDirectory))
{
System.IO.Directory.CreateDirectory(pathToSQLSetupTempDirectory);
}
string path = Path.GetFullPath(workingDir + Path.DirectorySeparatorChar + "SQLEXPRADV_x86_ENU.exe");
string args = "/Q /X:" + pathToSQLSetupTempDirectory;
Then, construct the command line parameters and run the extracted setup.exe file. To prevent installation of the management tools, add "/Features=SQL" to the command line arguments:
path = pathToSQLSetupTempDirectory + Path.DirectorySeparatorChar + "Setup.exe";
args = "/QUIET /Action=Install /Features=SQL,Tools /InstanceName=" + instanceName +
" /SECURITYMODE=SQL /TCPENABLED=1 /SAPWD=" + sqlSAPswd + " /SQLSYSADMINACCOUNTS=\"Builtin\\Administrators\" /SQLSVCACCOUNT=\"NT AUTHORITY\\NETWORK SERVICE\"";
http://msdn.microsoft.com/en-us/library/ms144259.aspx has more about the supported arguments.
Yes this is the correct way to do that, just make sure that you change the instance name in all occurrence (x86 parameters and x64 parameters)
精彩评论