<job id="Install-MicrosoftVisualC2005Sp1x86">
<script language="VBScript" src="..\..\scripts\ZTIUtility.vbs"/>
<script language="VBScript"> 

'//----------------------------------------------------------------------------
'// Purpose: Used to install Microsoft Visual C++ 2005 SP1 Redistributable Package
'// Usage: cscript Install-MicrosoftVisualC2005Sp1x86 [/debug:true]
'// Version: 1.0 - 30 Dec 2011 - Johan Arwidmark
'//
'// This script is provided "AS IS" with no warranties, confers no rights and 
'// is not supported by the authors or Deployment Artist. 
'//
'//----------------------------------------------------------------------------

'//----------------------------------------------------------------------------
'// Global constant and variable declarations
'//---------------------------------------------------------------------------- 

Option Explicit 
Dim iRetVal 

'//----------------------------------------------------------------------------
'// End declarations
'//---------------------------------------------------------------------------- 

'//----------------------------------------------------------------------------
'// Main routine
'//---------------------------------------------------------------------------- 

On Error Resume Next
iRetVal = ZTIProcess
ProcessResults iRetVal
On Error Goto 0 

'//---------------------------------------------------------------------------
'//
'// Function: ZTIProcess()
'//
'// Input: None
'// 
'// Return: Success - 0
'// Failure - non-zero
'//
'// Purpose: Perform main ZTI processing
'// 
'//---------------------------------------------------------------------------

Function ZTIProcess() 

	Dim sSetupFile
	Dim sArguments
	
	sSetupFile = oUtility.ScriptDir & "\Source\adksetup.exe"
	sArguments = "/Features OptionId.DeploymentTools OptionId.WindowsPreinstallationEnvironment OptionId.UserStateMigrationTool OptionId.ImagingAndConfigurationDesigner  OptionId.VolumeActivationManagementTool /norestart /quiet /ceip off"

	oLogging.CreateEntry oUtility.ScriptName & ": Starting installation", LogTypeInfo
	
	If not oFSO.FileExists(sSetupFile) then
		oLogging.CreateEntry oUtility.ScriptName & ": " & sSetupFile & " was not found, unable to install", LogTypeError
		ZTIProcess = Failure
		Exit Function
	End if

	iRetVal = oUtility.RunWithHeartbeat("""" & sSetupFile & """ " & sArguments)
	
	if (iRetVal = 0) or (iRetVal = 3010) then
		ZTIProcess = Success 
	Else 
		ZTIProcess = Failure
	End If
	
	oLogging.CreateEntry oUtility.ScriptName & ": Return code from command = " & iRetVal, LogTypeInfo
	oLogging.CreateEntry oUtility.ScriptName & ": Finished installation", LogTypeInfo
	
End Function 

</script>
</job>