Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.6 KiB

  1. Dim m_ISWiProject
  2. dim ISMFile
  3. Dim sacomponents, sdxroot
  4. Set Shell = WScript.CreateObject("WScript.Shell")
  5. buildMsiDir = Shell.ExpandEnvironmentStrings("%SDXROOT%") & "\enduser\sakit\buildmsi"
  6. Set objConn = CreateObject("ADODB.Connection")
  7. objConn.open = "Driver={Microsoft Access Driver (*.mdb)};DBQ=filedrop.mdb;DefaultDir=" & buildMsiDir
  8. Set objRS = CreateObject("ADODB.Recordset")
  9. objRS.ActiveConnection = objConn
  10. objRS.CursorType = 3
  11. objRS.LockType = 2
  12. sacomponents = Shell.ExpandEnvironmentStrings("%_NTPOSTBLD%") & "\sacomponents"
  13. ISMFile = buildMsiDir & "\sakit.ism"
  14. wscript.echo "Building ISM file: " & ISMFile
  15. wscript.echo "SAComponent source: " & sacomponents
  16. set m_ISWiProject=CreateObject("ISWiAutomation.ISWiProject")
  17. m_ISWiProject.OpenProject ISMFile
  18. Dim pComponent
  19. on error resume next
  20. for Each pComponent in m_ISWiProject.ISWiComponents
  21. objRS.Source = "Select * from Table3 where Component='" & pComponent.Name & "'"
  22. objRS.Open
  23. If Not objRS.EOF Then
  24. WScript.Echo pComponent.Name & ":"
  25. End If
  26. while NOT objRS.EOF
  27. 'Component is listed in database and has an associated registry file
  28. Dim strRegFile
  29. strRegFile = sacomponents & "\" & objRS("OAKSrc") & "\" & objRS("FileName")
  30. WScript.Echo " " & strRegFile
  31. objRS.MoveNext
  32. pComponent.ImportRegFile strRegFile,True
  33. If Err.number<>0 then
  34. WScript.Echo "ERROR: Can not find the registry file for: " & pComponent.Name
  35. Err.Clear
  36. end if
  37. wend
  38. objRS.Close
  39. Next
  40. m_ISWiProject.SaveProject()