-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDeployWiz_Ready.vbs
executable file
·137 lines (109 loc) · 3.83 KB
/
DeployWiz_Ready.vbs
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
' // ***************************************************************************
' //
' // Copyright (c) Microsoft Corporation. All rights reserved.
' //
' // Microsoft Deployment Toolkit Solution Accelerator
' //
' // File: DeployWiz_Initialization.vbs
' //
' // Version: 6.3.8330.1000
' //
' // Purpose: Main Client Deployment Wizard Initialization routines
' //
' // ***************************************************************************
Option Explicit
'
' Will return a dictionary object containing all Friendly Names Given a GUID as string, this funtion will search all *.xml files in the deployroot for a match.
'
Function GetFriendlyNamesofGUIDs
Dim oFiles
Dim oFolder
Dim oXMLFile
Dim oXMLNode
Dim sName
Dim GuidList
Set GuidList = CreateObject("Scripting.Dictionary")
GuidList.CompareMode = vbTextCompare
Set oFolder = oFSO.GetFolder( oEnvironment.Item("DeployRoot") & "\control" )
If oFolder is nothing then
oLogging.CreateEntry oUtility.ScriptName & " Unable to find DeployRoot!", LogTypeError
Exit function
End if
For each oFiles in oFolder.Files
If UCase(right(oFIles.Name, 4)) = ".XML" then
Set oXMLFile = oUtility.CreateXMLDOMObjectEx( oFiles.Path )
If not oXMLFile is nothing then
for each oXMLNode in oXMLFile.selectNodes("//*/*[@guid]")
if not oXMLNode.selectSingleNode("./Name") is nothing then
sName = oUtility.SelectSingleNodeString(oXMLNode,"./Name")
if not oXMLNode.selectSingleNode("./Language") is nothing then
if oUtility.SelectSingleNodeString(oXMLNode,"./Language") <> "" then
sName = sName & " ( " & oUtility.SelectSingleNodeString(oXMLNode,"./Language") & " )"
end if
end if
if not oXMLNode.Attributes.getNamedItem("guid") is nothing then
if oXMLNode.Attributes.getNamedItem("guid").value <> "" and sName <> "" then
if not GuidList.Exists(oXMLNode.Attributes.getNamedItem("guid").value) then
GuidList.Add oXMLNode.Attributes.getNamedItem("guid").value, sName
end if
end if
end if
end if
next
End if
End if
Next
set GetFriendlyNamesofGUIDs = GuidList
End function
Function PrepareFinalScreen
Dim GuidList
Dim p, i, item, Buffer
set GuidList = GetFriendlyNamesofGUIDs
Dim re, Match
For each p in oProperties.Keys
If IsObject(oProperties(p)) or IsArray(oProperties(p)) then
i = 1
For each item in oProperties(p)
If Item <> "" then
oStrings.AddToList Buffer, p & i & " = """ & item & """", vbNewLine
i = i + 1
End if
next
ElseIf ucase(p) = "DEFAULTDESTINATIONDISK" then
' Skip...
ElseIf ucase(p) = "DEFAULTDESTINATIONPARTITION" then
' Skip...
ElseIf ucase(p) = "DEFAULTDESTINATIONISDIRTY" then
' Skip...
ElseIf ucase(p) = "KEYBOARDLOCALE_EDIT" then
' Skip...
ElseIf ucase(p) = "USERLOCALE_EDIT" then
' Skip...
ElseIf oProperties(p) = "" then
' Skip...
ElseIf Instr(1, p, "Password" , vbTextCompare ) <> 0 then
oStrings.AddToList Buffer, p & " = ""***********""", vbNewLine
else
oStrings.AddToList Buffer, p & " = """ & oProperties(p) & """", vbNewLine
end if
Next
'
' Given a text string containing GUID ID's of configuration entries on the deployment share
' This function will search/replace all GUID's within the text blob.
'
Set re = new regexp
re.IgnoreCase = True
re.Global = True
re.Pattern = "\{[A-F0-9]{8}\-[A-F0-9]{4}\-[A-F0-9]{4}\-[A-F0-9]{4}\-[A-F0-9]{12}\}"
On error resume next
Do while re.Test( Buffer )
For each Match in re.execute(Buffer)
Buffer = mid(Buffer,1,Match.FirstIndex) & _
GuidList.Item(Match.Value) & _
mid(Buffer,Match.FirstIndex+match.Length+1)
Exit for
Next
Loop
On error goto 0
optionalWindow1.InnerText = Buffer
End function