Service Packs and How to Package Them
A service pack (or SP) is a group of updates, hot fixes and/or enhancements to an application or an OS which was delivered by the company as a single installable package. A lot of companies, such as Microsoft, usually release a service pack when the total number of individual patches released to a given program reaches a definite limit. Installing a service pack is less prone to error and easier to install on a large number of computers individually, even more so when updating multiple computers over a network.
Service Packs fix bugs in the application or may bring in new feature for the application. Service Packs are generally numbered as SP1, SP2, SP3, etc.
Generally Service packs ask for reboot after the installation, but this can be suppressed for the users when you are planning to deploy it over the network to lot of users.
Windows XP SP3
Now telling you something about Windows XP SP3, this is and will be the final version of service pack for Windows XP. Before you install Windows XP SP3, it is required to install Windows XP SP1 and recommended to install Windows XP SP2 (though this is not necessary).
Windows XP SP3 can be applied on Professional edition, Home edition, Media Centre edition and Tablet PC edition.
There are a few minor feature additions in Windows XP SP3. These include:
- Product Key-less install option. Like Windows Vista, Windows XP with SP3 installs can progress without entering a product key during setup.
- Network Access Protection compatibility. NAP helps you to shield your network resources better by enforcing compliance with system health requirements. With this feature Windows XP SP3 machines will be able to interact with the NAP feature in Windows Server 2008. RTM version of Windows Vista has this feature embedded in it too.
- Kernel Mode Cryptographic Module. It has a new kernel module that helps to encapsulate several different cryptographic algorithms.
- "Black hole" router detection algorithm. Another feature of Windows Vista which has been brought to Windows XP SP3 is the ability to ignore network routers which have the problem of dropping some particular type of network packets.
How to Package Windows XP SP3
Windows XP SP3 is an exe file which can be downloaded from the following site
http://www.microsoft.com/downloads/details.aspx?Fa...
It is not recommended to ever capture this exe to create an MSI package.
There are a few reasons to support this.
First, it is not recommended because it is extremely difficult to capture all the changes made in the operating system, by installing the service pack, through capturing tools.
Secondly, most of the files updated in the Operating system through service packs are Windows Protected File.
This comes from the concept of Windows File Protection (WFP). There is a folder in Windows called DllCache at the location %SystemFolder%\DllCache.
This folder contains all the important files of the Operating System and these files are protected. If you try to delete or if any important file gets deleted from System32 folder and it is a protected file then within 3 seconds that file is copied back to System32 folder from DllCache folder. Windows file protection is important from the Operating System point of view because this will help to preserve the system from crashing in case of deletion of important system files.
So for this reason if you capture such files in your package and try to replace them, they will automatically get overridden again from DllCache folder.
So for these reasons the service packs should not be repackaged. Instead we can use the command line options provided with the service pack to install them in an unattended and a silent way.
We can wrap the Windows XP SP3 exe file in MSI and install the same. We cannot uninstall this Service Pack. If you have to uninstall the Service Pack then you need to uninstall the whole application (The Windows XP OS) in this case and then reinstall the application without the Service Pack. There is no other way for it. Windows hot fixes too should not be repackaged and should be wrapped in the same ways as described.
There are 3 ways described below in which you can wrap and install the Windows XP SP3 or for that matter you can wrap any other exe too in the same manner. There maybe more methods to wrap the exe but I am describing these three.
Here are the 3 ways to wrap exe
1)By using Custom Action: Execute Program from Installed File
For this method you need to first add the downloaded SP3 exe to some location in your WSI. For example you can copy it to C:\Windows\Temp
This is shown in the below illustration:
As you can see the .exe is added to the Temp Folder. Now our aim is to install this patch. For this you need to go to MSI Scrip section -> All Custom Actions
On Left hand side double click on the Action: Execute program from Installed Files.
A Window will open in which you can fill in the details:
First on the detail tab:
Custom Action Name: ( As per your company standards ) Example: Install_SP3
Command Line Arguments: This depends on your requirements, but to keep it silent installation and preventing it to restart the machine, I have given the command line arguments as: /quiet /passive /norestart /o
Executable File: To add the executable file click on the Browse button. A Window will open with the executable file in the Windows Temp folder.
Select the file and click OK.
Next, Go to Location Tab and uncheck the No Sequence check box.
In the Sequence select Normal Execute Immediate / Deferred
Place the Custom Action just above Install Finalize.
Give the condition in the below box as: NOT Installed AND NOT PATCH
The condition mentioned above in Case sensitive.
We are using this Condition so that this Custom Action works only during installation and not at repair. There is no need to run it at repair because this is Service Pack and no ordinary MSI.
Now in the properties tab, select In Script Option as Deferred Execution, System Context and Processing as Synchronous, Ignore exit code. This is shown in the attached image:
If you want you can fill in the Description tab, else it is not required.
The reason for keeping it in Synchronous is that it will wait for the patch to execute and then will finish the installation of the MSI.
There is no need to worry about deleting the exe file added in Windows Temp folder after the installation of the package. Also there is no need to worry if it is deleted as there will be no self heal because there is no advertised shortcut in the package, nor is the file required after the package is installed.
Now you can compile your MSI after making the custom changes in the WSI as per your company standards.
This is one way of wrapping the exe.
2)By using Custom Action: Execute Program from Installation
For using this method, there is no need to add the downloaded Service Pack file to the file section in your package. However you will need to put in some dummy file or registry to create at least one component in your package.
We need to follow the following steps:
First, you need to go to MSI Script Section. On the left column double click on the Action: Execute Program from Installation. A window will open where you can fill in the details.
Details tab:
Custom Action Name: INSTALL_SP3
Command Line Arguments: /quiet /passive /norestart /o
Executable File: Click on Browse and select the file from your machine as shown in the below figure.
Location Tab:
In Location Tab, uncheck the No Sequence button and in Sequence select Normal Execute Immediate / Deferred.>br
Place the Custom Action just before Install Finalize as shown in the below figure.
Give the Condition as NOT Installed AND NOT PATCH
In the Properties Tab, select In Script Option as Deferred Execution, System Context and Processing as Synchronous, Ignore exit code as shown in the below figure:
After adding this Custom Action, if you go to the binary table then you will see that the SP3 exe is added to the binary table.
Now you can do all other customizations in your package according to your company standards and compile the package.
3)By using VB Script: You can also use VB Script to install the patch
For this method you need to first add the downloaded SP3 exe to some location in your WSI. For example you can copy it to C:\Windows\Temp
This is shown in the below image:
As you can see the .exe is added to the Temp Folder. Now our aim is to install this patch. For this you need to go to MSI Scrip section -> All Custom Actions
On Left hand side double click on the Action: Call VBScript from Embedded code.
In the Details section you have to add your VBScript which will install your service pack. You can use the following VBScript in your package:
Set objShell = CreateObject("WScript.Shell")
Set objFso = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
If objFso.FileExists("%WINDOWS%\Temp\XPSP2_en.exe") Then
strInstall = "%WINDOWS%\Temp \XPSP2_en.exe /quiet /passive /norestart /o "
Return = ObjShell.Run(strInstall, 0, True)
End If
You should use environment variables instead of hard coded paths as per the best practices.
Location Tab:
In Location Tab, uncheck the No Sequence button and in Sequence select Normal Execute Immediate / Deferred.
Place the Custom Action just before Install Finalize as shown in the below figure.
Give the Condition as NOT Installed AND NOT PATCH.
In the Properties Tab, select In Script Option as Deferred Execution, System Context and Processing as Synchronous, Ignore exit code as shown in the below figure:
Now you can do all other customizations in your package according to your company standards and compile the package.
By using VBScript in embedded code, you get an ICE error. If you do not want that ICE Error, then you should use Execute VBScript from Installation Custom Action and embed that VBScript in Binary table.















Comments
Windows Updates
If Windows Update is turned off on a XP machine and then SP3 is installed there is prompt during start-up before the log-on prompt for the user to turn on or off Windows Updates.
Do you know of any switches during the installation that will remove this prompt?
Humm
Our machines here are currently on SP2 and they have a Local Group Policy to disable Windows update. After install SP3, the policy didn't change to my knowledge. I used the following to install and make Post changes so not to change our environment much:
To install simple batch file
echo Sp3 scripted Started %time% >> c:\sclog.txt
C:\WINDOWS\system32\eventcreate /t information /id 1 /so PCIM_UPGRADER /l application /d "SP3 has started" >nul 2>&1
echo Stopping SAV %time% >> c:\sclog.txt
NET STOP "Symantec Antivirus"
echo Started sp3 exe %time% >> c:\sclog.txt
%DEST_PATH%\WINDOWSXP-KB936929-SP3-X86-ENU.EXE /quiet /norestart /overwriteoem /nobackup
echo disabled wscsvc >> c:\sclog.txt
sc config "wscsvc" start= disabled >> c:\sclog.txt
echo disabled sharedaccess >> c:\sclog.txt
sc config "SharedAccess" start= disabled >> c:\sclog.txt
echo Add Login task %time% >> c:\sclog.txt
c:\windows\system32\Schtasks /create /RU "NT AUTHORITY\SYSTEM" /TR "cmd /c C:\DTS\SOFTWARE\SP3\services.cmd" /TN Mojo /SC ONLOGON
C:\WINDOWS\system32\eventcreate /t information /id 2 /so PCIM_UPGRADER /l application /d "SP3 has ended" >nul 2>&1
echo Sp3 script completed %time% >> c:\sclog.txt
service.cmd (this runs after first login after SP3 has been installed)
@echo off
echo Mojo Started %time% >> sclog.txt
C:\WINDOWS\system32\eventcreate /t information /id 1 /so Mojo /l application /d "Mojo has started" >nul 2>&1
echo Stopping Dot3svc >> c:\sclog.txt
net stop "Dot3svc" >> c:\sclog.txt
echo Stopping EapHost >> c:\sclog.txt
net stop "EapHost" >> c:\sclog.txt
echo disable dot3svc >> c:\sclog.txt
sc config "Dot3svc" start= disabled >> c:\sclog.txt
echo disable EapHost >> c:\sclog.txt
sc config "EapHost" start= disabled >> c:\sclog.txt
echo disable napagent >> c:\sclog.txt
sc config "napagent" start= disabled >> c:\sclog.txt
C:\WINDOWS\system32\eventcreate /t information /id 2 /so Mojo /l application /d "Mojo has ended" >nul 2>&1
echo y|c:\windows\system32\Schtasks /delete /TN Mojo /F >nul
echo Mojo Ended %time% >> sclog.txt
Since we are starting our sp3 deployment this week I will TRIPLE check the WU is turned off.
Lee Wilburn
Suzlon Wind Energy
If your question has been resolved, please click "Mark as Solution"! Thank you. Hope it helps!
Nope no Change!
If you setup Policy to disable Windows Update, even after updating to sp3 this policy will remain. So I would suggest verify you local policy and/or GPO settings.
Lee Wilburn
Suzlon Wind Energy
If your question has been resolved, please click "Mark as Solution"! Thank you. Hope it helps!
Would you like to reply?
Login or Register to post your comment.