Saltar al contenido
Categoría: Sin categorizar
2011-10-25

Forma rápida de crear un instalador de SQL Server 2008 R2 con SP1 integrado (Slipstream)

Con la funcionalidad Slipstream podemos integrar los Service Pack o Cumulative Updates al instalador de SQL Server, con esto ahorramos mucho tiempo, sobre todo cuando hay que hacer múltiples instalaciones. La guía que he creado es una modificación de How to slipstream SQL Server 2008 R2 and a SQL Server 2008 R2 Service Pack 1 (SP1), a la que añado un fichero .bat que nos ahorra mucho tiempo. Esta guía es para la versión en Inglés de SQL Server 2008 R2.

Estos son los pasos a seguir: 1. Copiar los archivos de instalación de SQL Server 2008 R2 a C:\SQLServer2008R2_SP1 2. Descargar Microsoft® SQL Server® 2008 R2 Service Pack 1, es necesario descargar todas las arquitecturas y copiarlas a C:\

  • SQLServer2008R2SP1-KB2528583-IA64-ENU.exe
  • SQLServer2008R2SP1-KB2528583-x64-ENU.exe
  • SQLServer2008R2SP1-KB2528583-x86-ENU.exe

3. Crear un fichero .bat con el siguiente contenido y copiarlo a C:\

@ECHO OFF

::File Verification
IF NOT EXIST "C:\SQLServer2008R2_SP1\" GOTO ERROR
IF NOT EXIST "C:\SQLServer2008R2SP1-KB2528583-x86-ENU.exe" GOTO ERROR
IF NOT EXIST "C:\SQLServer2008R2SP1-KB2528583-x64-ENU.exe" GOTO ERROR
IF NOT EXIST "C:\SQLServer2008R2SP1-KB2528583-IA64-ENU.exe" GOTO ERROR

::Extract each of the SQL Server 2008 R2 SP1 packages to C:\SQLServer2008R2_SP1\SP
ECHO Extracting SP files to C:\SQLServer2008R2_SP1\SP...
start /wait C:\SQLServer2008R2SP1-KB2528583-x86-ENU.exe /x:C:\SQLServer2008R2_SP1\SP
ECHO Extract of SQLServer2008R2SP1-KB2528583-x86-ENU.exe Completed
start /wait C:\SQLServer2008R2SP1-KB2528583-x64-ENU.exe /x:C:\SQLServer2008R2_SP1\SP
ECHO Extract of SQLServer2008R2SP1-KB2528583-x64-ENU.exe Completed
start /wait C:\SQLServer2008R2SP1-KB2528583-IA64-ENU.exe /x:C:\SQLServer2008R2_SP1\SP
ECHO Extract of SQLServer2008R2SP1-KB2528583-IA64-ENU.exe Completed
ECHO.

::Copy Setup.exe from the SP extracted location to the original source media location
ECHO Copying Setup.exe to C:\SQLServer2008R2_SP1
start /wait robocopy C:\SQLServer2008R2_SP1\SP C:\SQLServer2008R2_SP1 Setup.exe
ECHO Setup.exe copied
ECHO.

::Copy all files, not the folders, except the Microsoft.SQL.Chainer.PackageData.dll, in C:\SQLServer2008R2_SP1\SP\<architecture> to C:\SQLServer2008R2_SP1\<architecture> to update the original files
ECHO Copying files to C:\SQLServer2008R2_SP1\
start /wait robocopy C:\SQLServer2008R2_SP1\SP\x86 C:\SQLServer2008R2_SP1\x86 /XF Microsoft.SQL.Chainer.PackageData.dll
ECHO Files from C:\SQLServer2008R2_SP1\SP\x86 copied
start /wait robocopy C:\SQLServer2008R2_SP1\SP\x64 C:\SQLServer2008R2_SP1\x64 /XF Microsoft.SQL.Chainer.PackageData.dll
ECHO Files from C:\SQLServer2008R2_SP1\SP\x64 copied
start /wait robocopy C:\SQLServer2008R2_SP1\SP\ia64 C:\SQLServer2008R2_SP1\ia64 /XF Microsoft.SQL.Chainer.PackageData.dll
ECHO Files from C:\SQLServer2008R2_SP1\SP\ia64 copied
ECHO.

::Create or modify DefaultSetup.ini
IF NOT EXIST "C:\SQLServer2008R2_SP1\x86\DefaultSetup.ini" GOTO CREATEINI
ECHO Modifying DefaultSetup.ini
TYPE C:\SQLServer2008R2_SP1\x86\DefaultSetup.ini > C:\SQLServer2008R2_SP1\x86\Temp_DefaultSetup.ini
ECHO PCUSOURCE=".\SP" >> C:\SQLServer2008R2_SP1\x86\Temp_DefaultSetup.ini
DEL C:\SQLServer2008R2_SP1\x86\DefaultSetup.ini
REN C:\SQLServer2008R2_SP1\x86\Temp_DefaultSetup.ini DefaultSetup.ini
ECHO.
GOTO COPYINI
:CREATEINI
ECHO Creating or modifying DefaultSetup.ini
ECHO ;SQLSERVER2008 R2 Configuration File > C:\SQLServer2008R2_SP1\x86\DefaultSetup.ini
ECHO [SQLSERVER2008] >> C:\SQLServer2008R2_SP1\x86\DefaultSetup.ini
ECHO PCUSOURCE=".\SP" >> C:\SQLServer2008R2_SP1\x86\DefaultSetup.ini
ECHO.
:COPYINI

::Copy DefaultSetup.ini from x86 to x64 and ia64 folders
ECHO Copying DefaultSetup.ini from x86 to x64 and ia64 folders
start /wait robocopy C:\SQLServer2008R2_SP1\x86 C:\SQLServer2008R2_SP1\x64 DefaultSetup.ini
start /wait robocopy C:\SQLServer2008R2_SP1\x86 C:\SQLServer2008R2_SP1\ia64 DefaultSetup.ini
ECHO.

ECHO ==============================================================================
ECHO OPERATION COMPLETED
ECHO Use C:\SQLServer2008R2_SP1\Setup.exe to install SQL Server 2008 R2 + SP1
ECHO ==============================================================================
ECHO.
GOTO FIN

:ERROR
ECHO ==============================================================================
ECHO FILE VERIFICATION FAIL, PLEASE CHECK THE FOLLOWING:
ECHO THE DIRECTORY C:\SQLServer2008R2_SP1\ EXISTS
ECHO SQLServer2008R2SP1-KB2528583-x86-ENU.exe FILE IS LOCATED IN C:\
ECHO SQLServer2008R2SP1-KB2528583-x64-ENU.exe FILE IS LOCATED IN C:\
ECHO SQLServer2008R2SP1-KB2528583-IA64-ENU.exe FILE IS LOCATED IN C:\
ECHO ==============================================================================
ECHO.

:FIN
PAUSE

4. Ejecutar el fichero .bat como administrador 5. Utilizar C:\SQLServer2008R2_SP1\Setup.exe para realizar la instalación. 6. Se puede comprobar que la instalación contiene SlipStream en la pantalla Ready to Install: 

[:en] With the Slipstream funcionality we can integrate Service Pack or Cumulative Updates to the SQL Server installer, this save much time, specially when you need to do multiple installations. This guide is a modification of How to slipstream SQL Server 2008 R2 and a SQL Server 2008 R2 Service Pack 1 (SP1), to which I add a .bat file to save time. This guide is for the English version of SQL Server 2008 R2.

Here are the steps: 1. Copy all the installations files of SQL Server 2008 R2 to C:\SQLServer2008R2_SP1 2. Download Microsoft® SQL Server® 2008 R2 Service Pack 1, you need to download all the architectures and copy them to C:\

  • SQLServer2008R2SP1-KB2528583-IA64-ENU.exe
  • SQLServer2008R2SP1-KB2528583-x64-ENU.exe
  • SQLServer2008R2SP1-KB2528583-x86-ENU.exe

3. Create a .bat file with this content and copy it to C:\

@ECHO OFF


::File Verification
IF NOT EXIST "C:\SQLServer2008R2_SP1\" GOTO ERROR
IF NOT EXIST "C:\SQLServer2008R2SP1-KB2528583-x86-ENU.exe" GOTO ERROR
IF NOT EXIST "C:\SQLServer2008R2SP1-KB2528583-x64-ENU.exe" GOTO ERROR
IF NOT EXIST "C:\SQLServer2008R2SP1-KB2528583-IA64-ENU.exe" GOTO ERROR::Extract each of the SQL Server 2008 R2 SP1 packages to C:\SQLServer2008R2_SP1\SP
ECHO Extracting SP files to C:\SQLServer2008R2_SP1\SP...
start /wait C:\SQLServer2008R2SP1-KB2528583-x86-ENU.exe /x:C:\SQLServer2008R2_SP1\SP
ECHO Extract of SQLServer2008R2SP1-KB2528583-x86-ENU.exe Completed
start /wait C:\SQLServer2008R2SP1-KB2528583-x64-ENU.exe /x:C:\SQLServer2008R2_SP1\SP
ECHO Extract of SQLServer2008R2SP1-KB2528583-x64-ENU.exe Completed
start /wait C:\SQLServer2008R2SP1-KB2528583-IA64-ENU.exe /x:C:\SQLServer2008R2_SP1\SP
ECHO Extract of SQLServer2008R2SP1-KB2528583-IA64-ENU.exe Completed
ECHO.

::Copy Setup.exe from the SP extracted location to the original source media location
ECHO Copying Setup.exe to C:\SQLServer2008R2_SP1
start /wait robocopy C:\SQLServer2008R2_SP1\SP C:\SQLServer2008R2_SP1 Setup.exe
ECHO Setup.exe copied
ECHO.

::Copy all files, not the folders, except the Microsoft.SQL.Chainer.PackageData.dll, in C:\SQLServer2008R2_SP1\SP\<architecture> to C:\SQLServer2008R2_SP1\<architecture> to update the original files
ECHO Copying files to C:\SQLServer2008R2_SP1\
start /wait robocopy C:\SQLServer2008R2_SP1\SP\x86 C:\SQLServer2008R2_SP1\x86 /XF Microsoft.SQL.Chainer.PackageData.dll
ECHO Files from C:\SQLServer2008R2_SP1\SP\x86 copied
start /wait robocopy C:\SQLServer2008R2_SP1\SP\x64 C:\SQLServer2008R2_SP1\x64 /XF Microsoft.SQL.Chainer.PackageData.dll
ECHO Files from C:\SQLServer2008R2_SP1\SP\x64 copied
start /wait robocopy C:\SQLServer2008R2_SP1\SP\ia64 C:\SQLServer2008R2_SP1\ia64 /XF Microsoft.SQL.Chainer.PackageData.dll
ECHO Files from C:\SQLServer2008R2_SP1\SP\ia64 copied
ECHO.

::Create or modify DefaultSetup.ini
IF NOT EXIST "C:\SQLServer2008R2_SP1\x86\DefaultSetup.ini" GOTO CREATEINI
ECHO Modifying DefaultSetup.ini
TYPE C:\SQLServer2008R2_SP1\x86\DefaultSetup.ini > C:\SQLServer2008R2_SP1\x86\Temp_DefaultSetup.ini
ECHO PCUSOURCE=".\SP" >> C:\SQLServer2008R2_SP1\x86\Temp_DefaultSetup.ini
DEL C:\SQLServer2008R2_SP1\x86\DefaultSetup.ini
REN C:\SQLServer2008R2_SP1\x86\Temp_DefaultSetup.ini DefaultSetup.ini
ECHO.
GOTO COPYINI
:CREATEINI
ECHO Creating or modifying DefaultSetup.ini
ECHO ;SQLSERVER2008 R2 Configuration File > C:\SQLServer2008R2_SP1\x86\DefaultSetup.ini
ECHO [SQLSERVER2008] >> C:\SQLServer2008R2_SP1\x86\DefaultSetup.ini
ECHO PCUSOURCE=".\SP" >> C:\SQLServer2008R2_SP1\x86\DefaultSetup.ini
ECHO.
:COPYINI

::Copy DefaultSetup.ini from x86 to x64 and ia64 folders
ECHO Copying DefaultSetup.ini from x86 to x64 and ia64 folders
start /wait robocopy C:\SQLServer2008R2_SP1\x86 C:\SQLServer2008R2_SP1\x64 DefaultSetup.ini
start /wait robocopy C:\SQLServer2008R2_SP1\x86 C:\SQLServer2008R2_SP1\ia64 DefaultSetup.ini
ECHO.

ECHO ==============================================================================
ECHO OPERATION COMPLETED
ECHO Use C:\SQLServer2008R2_SP1\Setup.exe to install SQL Server 2008 R2 + SP1
ECHO ==============================================================================
ECHO.
GOTO FIN

:ERROR
ECHO ==============================================================================
ECHO FILE VERIFICATION FAIL, PLEASE CHECK THE FOLLOWING:
ECHO THE DIRECTORY C:\SQLServer2008R2_SP1\ EXISTS
ECHO SQLServer2008R2SP1-KB2528583-x86-ENU.exe FILE IS LOCATED IN C:\
ECHO SQLServer2008R2SP1-KB2528583-x64-ENU.exe FILE IS LOCATED IN C:\
ECHO SQLServer2008R2SP1-KB2528583-IA64-ENU.exe FILE IS LOCATED IN C:\
ECHO ==============================================================================
ECHO.

:FIN
PAUSE

4. Run the .bat file as administrator.

5. Use C:\SQLServer2008R2_SP1\Setup.exe to start the installation. 6. You can check that the installation contains SlipStream in the Ready to Install screen: 

Complete este formulario para recibir la guía de Windows Server en Azure
*Obligatorio
Complete este formulario para recibir la guía de Windows Server en Azure
Gracias por rellenar el formulario [name]. ¡Aquí tienes tu eBook Gratis!
Complete este formulario para recibir 4 best practices to implement a comprehensive Zero Trust security approach
*Obligatorio
Complete este formulario para recibir 4 best practices to implement a comprehensive Zero Trust security approach
Gracias por rellenar el formulario [name]. ¡Aquí tienes tu eBook Gratis!
Complete este formulario para recibir Cloud Migration Essentials
*Obligatorio
Complete este formulario para recibir Cloud Migration Essentials
Gracias por rellenar el formulario [name]. ¡Aquí tienes tu eBook Gratis!
Complete este formulario para recibir Cloud security Advice for Nonprofit Leaders
*Obligatorio
Complete este formulario para recibir Cloud security Advice for Nonprofit Leaders
Gracias por rellenar el formulario [name]. ¡Aquí tienes tu eBook Gratis!
Complete este formulario para recibir Prevent data leaks with Microsoft 365 Business Premium
*Obligatorio
Complete este formulario para recibir Prevent data leaks with Microsoft 365 Business Premium
Gracias por rellenar el formulario [name]. ¡Aquí tienes tu eBook Gratis!
Complete this form to recieve the guide of Windows Server on Azure
*Required
Complete this form to recieve the guide of Windows Server on Azure
Thank you for filling out the form [name]. Here's your Free eBook!
Complete this form to recieve 4 best practices to implement a comprehensive Zero Trust security approach
*Required
Complete this form to recieve 4 best practices to implement a comprehensive Zero Trust security approach
Thank you for filling out the form [name]. Here's your Free eBook!
Complete this form to recieve Cloud Migration Essentials
*Required
Complete this form to recieve Cloud Migration Essentials
Thank you for filling out the form [name]. Here's your Free eBook!
Complete this form to recieve Cloud security Advice for Nonprofit Leaders
*Required
Complete este formulario para recibir Cloud security Advice for Nonprofit Leaders
Thank you for filling out the form [name]. Here's your Free eBook!
Complete this form to recieve Prevent data leaks with Microsoft 365 Business Premium
*Obligatorio
Complete this form to recieve Prevent data leaks with Microsoft 365 Business Premium
Thank you for filling out the form [name]. Here's your Free eBook!
Complete this form to recieve Cloud Migration Simplified Ebook.
*Obligatorio
Complete this form to recieve Prevent data leaks with Microsoft 365 Business Premium
Thank you for filling out the form [name]. Here's your Free eBook!