-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDeployWiz_UserDataRestore.vbs
executable file
·84 lines (57 loc) · 2.77 KB
/
DeployWiz_UserDataRestore.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
' // ***************************************************************************
' //
' // 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
Function InitializeUserDataRestoreLocation
' If the user data location is AUTO or NETWORK, reset it to none for bare metal
If UCase(Property("UserDataLocation")) = "AUTO" or UCase(Property("UserDataLocation")) = "NETWORK" then
oProperties("UserDataLocation") = "NONE"
End if
' Make sure the right radio button is set
If UCase(Property("UserDataLocation")) = "NONE" OR Property("UserDataLocation") = "" then
UDRadio1.click
Else
StatePath.value = Property("UserDataLocation")
UDRadio2.click
End if
End Function
'''''''''''''''''''''''''''''''''''''
' Validate UserData Location
'
Function ValidateUserDataRestoreLocation
UDRadio2.Value = StatePath.Value
document.GetElementByID("StatePath").Disabled = not UDRadio2.Checked
document.GetElementByID("StatePathBrowse").Disabled = not UDRadio2.Checked
InvalidPath.style.display = "none"
ValidateUserDataRestoreLocation = TRUE
If UDRadio2.Checked and StatePath.value <> "" then
If Left(StatePath.value, 2) = "\\" and len(StatePath.value) > 6 and ubound(split(StatePath.value,"\")) >= 3 then
oUtility.ValidateConnection StatePath.value
End if
If (oFSO.FileExists(StatePath.value & "\USMT3.MIG" ) or oFSO.FileExists(StatePath.value & "\USMT.MIG" )) or ( oFSO.FileExists(StatePath.value & "\MIGSTATE.DAT" ) and _
oFSO.FileExists(StatePath.value & "\catalog.mig" ) ) then
' Just in case the user selects the USMT3 directory.
StatePath.value = StatePath.value & "\.."
End if
If not (oFSO.FolderExists(StatePath.value & "\USMT3" ) or oFSO.FolderExists(StatePath.value & "\USMT" )) then
ValidateUserDataRestoreLocation = FALSE
InvalidPath.style.display = "inline"
Elseif not (oFSO.FileExists(StatePath.value & "\USMT3\USMT3.MIG" ) or oFSO.FileExists(StatePath.value & "\USMT\USMT.MIG" )) and _
not (oFSO.FileExists(StatePath.value & "\USMT3\MIGSTATE.DAT" ) or oFSO.FileExists(StatePath.value & "\USMT\MIGSTATE.DAT" )) and _
not (oFSO.FileExists(StatePath.value & "\USMT3\catalog.mig" ) or oFSO.FileExists(StatePath.value & "\USMT\catalog.mig" )) then
ValidateUserDataRestoreLocation = FALSE
InvalidPath.style.display = "inline"
End if
End if
ValidateUserDataRestoreLocation = ValidateUserDataRestoreLocation and ParseAllWarningLabels
End Function