1:
2: path = WScript.Arguments(0)
3: root = WScript.Arguments(1)
4:
5: gacpath = "D:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe"
6:
7: If WScript.Arguments.Count = 3 Then
8: gacpath = WScript.Arguments(2)
9: End If
10:
11: WScript.Echo WScript.Arguments.Count
12: WScript.Echo "Parsing LibraryManifest: " & path
13:
14: Set xml = CreateObject("MSXML2.DOMDocument") 15: With xml
16: .async = False
17: .validateOnParse = False
18: .preserveWhiteSpace = True
19: .resolveExternals = False
20: End With
21: result = xml.load(path)
22:
23: Set moduleNodes = xml.selectNodes("//LibraryManifest/Module") 24:
25: If Not moduleNodes Is Nothing Then
26:
27: For Each moduleNode in moduleNodes
28:
29: Set assemblyNodes = moduleNode.selectNodes("Assembly") 30:
31: For Each assemblyNode in assemblyNodes
32:
33: For Each attribute in assemblyNode.Attributes
34:
35: If attribute.Name = "Name" Then
36:
37: file = root & "\" & attribute.Text
38:
39: 'WScript.Echo "file: " & file
40:
41: Set shell = CreateObject("WScript.Shell") 42: gacutil = gacpath & " -uf " & attribute.Text
43: Set out = shell.Exec(gacutil)
44:
45: Do While Not out.StdOut.AtEndOfStream
46: WScript.Echo out.StdOut.ReadLine()
47: Loop
48:
49: Set shell = CreateObject("WScript.Shell") 50: gacutil = gacpath & " -if " & file
51:
52: Set out = shell.Exec(gacutil)
53:
54: Do While Not out.StdOut.AtEndOfStream
55: WScript.Echo out.StdOut.ReadLine()
56: Loop
57:
58: Set shell = Nothing
59: Set out = Nothing
60:
61: End If
62: Next
63: Next
64: Next
65: End If
66: