-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLTICopyScripts.wsf
executable file
·115 lines (77 loc) · 3.66 KB
/
LTICopyScripts.wsf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<job id="LTICopyScripts">
<script language="VBScript" src="ZTIUtility.vbs"/>
<script language="VBScript">
' // ***************************************************************************
' //
' // Copyright (c) Microsoft Corporation. All rights reserved.
' //
' // Microsoft Deployment Toolkit Solution Accelerator
' //
' // File: LTICopyScripts.wsf
' //
' // Version: 6.3.8330.1000
' //
' // Purpose: Copy the LTI/ZTI scripts to the local drive.
' //
' // Usage: cscript.exe [//nologo] LTICopyScripts.wsf [/debug:true]
' //
' // ***************************************************************************
Option Explicit
RunNewInstance
'//----------------------------------------------------------------------------
'// Main Class
'//----------------------------------------------------------------------------
Class LTICopyScripts
'//----------------------------------------------------------------------------
'// Class instance variable declarations
'//----------------------------------------------------------------------------
Public ScriptsToCopy
Public SourcePath
Public TargetPath
'//----------------------------------------------------------------------------
'// Constructor to initialize needed global objects
'//----------------------------------------------------------------------------
Private Sub Class_Initialize
' Create a list of scripts to copy.
ScriptsToCopy = Array("LiteTouch.wsf", "ZTIUtility.vbs", "ZTIGather.wsf", "ZTIGather.xml", _
"Wizard.hta", "Credentials_ENU.xml", "Credentials_scripts.vbs", "WizUtility.vbs", "Wizard.css", _
"Wizard.ico", "BackButton.jpg", "plusicon.gif", "minusico.gif", "DeployWiz_Definition_ENU.xml", _
"DeployWiz_Initialization.vbs", "DeployWiz_Validation.vbs", "Summary_Definition_ENU.xml", _
"Summary_scripts.vbs", "LTICleanup.wsf", "LTIGetFolder.wsf", "ZTINICConfig.wsf", _
"ZTINICUtility.vbs","ZTIBCDUTILITY.VBS", "ZTIDataAccess.vbs", "LTISuspend.wsf", _
"ZTIDiskUtility.vbs", "ZTIRunCommandHidden.wsf", "header-image.png", "NavBar.png", "Computer.png", _
"SetupComplete.cmd", "SetupRollback.cmd", "ZTISetupRollback.wsf", "LTITriggerUpgradeFailure.wsf", "LTIBootstrap.vbs")
SourcePath = oUtility.ScriptDir & "\"
TargetPath = oUtility.LocalRootPath & "\Scripts\"
End Sub
'//----------------------------------------------------------------------------
'// Main routine
'//----------------------------------------------------------------------------
Function Main
Dim sTarget
Dim sSource
Dim sFile
oLogging.CreateEntry "--------- Script Start ---------", LogTypeInfo
'//----------------------------------------------------------------------------
'// Copy the necessary scripts to bootstrap the process; the rest will come
'// from the deployment Share.
'//----------------------------------------------------------------------------
oUtility.VerifyPathExists oUtility.LocalRootPath & "\Scripts"
For each sFile in ScriptsToCopy
sTarget = TargetPath & sFile
sSource = SourcePath & sFile
If oFSO.FileExists(sTarget) then
oLogging.CreateEntry "File " & sTarget & " already exists in Target", LogTypeInfo
ElseIf not oFSO.FileExists(sSource) then
oLogging.CreateEntry "File " & sSource & " does not exist in Source.", LogTypeInfo
Else
oLogging.CreateEntry "Copying file " & sSource & " to " & sTarget, LogTypeInfo
oFSO.CopyFile sSource, sTarget, true
TestAndLog SUCCESS, "Copy " & sSource & " to " & sTarget
End if
Next
Main = SUCCESS
End Function
End class
</script>
</job>