[MDT 2012] Ajout d'un menu Drivers dans le wizard d'installation

Ajout d'un menu Drivers dans le wizard d'installation [MDT 2012] - VB/VBA/VBS - Programmation

Marsh Posté le 14-08-2012 à 08:49:27    

Bonjour à tous :)  
Je vous explique rapidement mon problème: J'aimerai pouvoir gérer plus facilement mes drivers dans mon système de déploiement utilisant MDT 2012.
J'ai trouver une solution qui semble bien sur internet consistant à ajouter un menu "drivers" dans le wizard de déploiement. Seul hic, je n'arrive pas à faire marcher le code (Erreur à la ligne 187 du wizard.hta) .
 
Qui correspond à çà:
 

Code :
  1. For each refItem in oReference.SelectSingleNode("//Wizard/Pane" ).ChildNodes
  2.   item.AppendChild refItem.CloneNode(true)
  3.  Next


 
La page d'origine est : http://mschumacherr.tumblr.com/pos [...] roblem-new
 
Après divers essai, j'ai essayer de corriger quelques trucs dans le code (des espaces en plus ou en moins etc) mais je ne suis absolument pas programmeur et la je cale  :kaola: .
 
Voila ou j'en suis:  
 
DeployWiz_Definition_ENU.xml
 

Code :
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!--
  3. ' // ***************************************************************************
  4. ' //  
  5. ' // Copyright (c) Microsoft Corporation.  All rights reserved.
  6. ' //  
  7. ' // Microsoft Deployment Toolkit Solution Accelerator
  8. ' //
  9. ' // File:      DeployWiz_Definition_ENU.wsf
  10. ' //  
  11. ' // Version:   6.0.2223.0
  12. ' //  
  13. ' // Purpose:   Main Client Deployment Wizard Defintion File
  14. ' //  
  15. ' // ***************************************************************************
  16. -->
  17. <Wizard>
  18. <Global>
  19.  <CustomStatement><![CDATA[ document.title =  "Windows Deployment Wizard" ]]> </CustomStatement>
  20.  <Initialization>DeployWiz_Initialization.vbs</Initialization>
  21.  <Validation>DeployWiz_Validation.vbs</Validation>
  22. </Global>
  23. <!-- ************************************************************** -->
  24. <!-- ************************************************************** -->
  25. <Pane id="SelectTaskSequence" reference="DeployWiz_SelectTS.xml">
  26.  <Condition><![CDATA[UCASE(Property("SkipTaskSequence" ))<>"YES" ]]></Condition>
  27. </Pane>
  28. <Pane id="ComputerName" reference="DeployWiz_ComputerName.xml">
  29.  <Condition><![CDATA[UCase(Property("SkipDomainMembership" ))<>"YES" or UCase(Property("SkipComputerName" ))<>"YES"]]></Condition>
  30.  <Condition><![CDATA[Property("DeploymentType" )<>"REPLACE" and Property("DeploymentType" )<>"CUSTOM" and Property("DeploymentType" ) <> "StateRestore" ]]></Condition>
  31. </Pane>
  32. <Pane id="UserData" reference="DeployWiz_UserData.xml">
  33.  <Condition><![CDATA[ (Property("DeploymentType" ) = "REFRESH" or Property("DeploymentType" ) = "REPLACE" ) and UCase(Property("SkipUserData" ))<>"YES" and Property("DeploymentType" ) <> "StateRestore"]]></Condition>
  34.  <Condition><![CDATA[ Instr(1, oEnvironment.Item("ImageFlags" ), "SERVER", 1) = 0  ]]></Condition>
  35.  <Condition><![CDATA[ ucase(oEnvironment.Item("IsServerOS" )) <> "TRUE" ]]></Condition>
  36.  <Condition><![CDATA[ FindTaskSequenceStep("//step[@name='Capture User State']", "ZTIUserState.wsf" ) ]]></Condition>
  37. </Pane>
  38. <Pane id="UserDataRestore" reference="DeployWiz_UserDataRestore.xml">
  39.  <Condition><![CDATA[ UCase(Property("SkipUserData" ))<>"YES" and (Property("DeploymentType" )="NEWCOMPUTER" or Property("DeploymentType" ) = "StateRestore" ) and Property("DeploymentType" )<>"CUSTOM" ]]></Condition>
  40.  <Condition><![CDATA[ Instr(1, oEnvironment.Item("ImageFlags" ), "SERVER", 1) = 0  ]]></Condition>
  41.  <Condition><![CDATA[ ucase(oEnvironment.Item("IsServerOS" )) <> "TRUE" ]]></Condition>
  42.  <Condition><![CDATA[ FindTaskSequenceStep("//step[@name='Restore User State']", "ZTIUserState.wsf" ) ]]></Condition>
  43. </Pane>
  44. <Pane id="ComputerBackup" reference="DeployWiz_ComputerBackup.xml">
  45.  <Condition><![CDATA[ Property("DeploymentType" ) <> "NEWCOMPUTER" and Property("DeploymentType" ) <> "CUSTOM" and Property("DeploymentType" ) <> "STATERESTORE" and (Property("DeploymentType" ) = "REFRESH" or Property("DeploymentType" ) = "REPLACE" ) and UCase(Property("SkipComputerBackup" ))<>"YES"]]></Condition>
  46. </Pane>
  47. <Pane id="ProductKey" reference="DeployWiz_ProductKeyVista.xml">
  48.  <Condition><![CDATA[ UCASE(Property("SkipProductKey" ))<>"YES" and Property("DeploymentType" )<>"REPLACE" and Property("DeploymentType" )<>"CUSTOM" and Property("DeploymentType" )<>"StateRestore" ]]></Condition>
  49. </Pane>
  50. <Pane id="SelectLanguagePack" reference="DeployWiz_LanguagePack.xml">
  51.  <Condition><![CDATA[ ucase(Property("SkipPackageDisplay" )) <> "YES" and Property("DeploymentType" )<>"REPLACE" and Property("DeploymentType" )<>"CUSTOM" and Left(Property("ImageBuild" ), 1) = "6" ]]> </Condition>
  52.  <Condition><![CDATA[ FindTaskSequenceStep("//step[@type='BDD_InstallUpdatesOffline' and @name='Apply Patches']", "ZTIPatches.wsf" )  ]]> </Condition>
  53.  <Condition><![CDATA[ CanDisplayPackageDialogBox  ]]> </Condition>
  54. </Pane>
  55. <Pane id="SelectLanguageUI" reference="DeployWiz_LanguageUI.xml">
  56.  <Condition><![CDATA[ UCase(Property("SkipLocaleSelection" )) <> "YES" or UCase(Property("SkipTimeZone" ))<>"YES" ]]> </Condition>
  57.  <Condition><![CDATA[ Property("DeploymentType" )<>"REPLACE" and Property("DeploymentType" )<>"CUSTOM" and Property("DeploymentType" ) <> "StateRestore" ]]> </Condition>
  58. </Pane>
  59. <Pane id="ApplicationSelection" reference="DeployWiz_Applications.xml">
  60.  <Condition><![CDATA[ UCase(Property("DeploymentType" ))<>"REPLACE" ]]></Condition>
  61.  <Condition><![CDATA[ UCase(Property("SkipApplications" ))<>"YES" ]]></Condition>
  62.  <Condition><![CDATA[ IsThereAtLeastOneApplicationPresent ]]></Condition>
  63. </Pane>
  64. <Pane id="AdministratorPassword" reference="DeployWiz_AdminPassword.xml">
  65.  <Condition><![CDATA[ UCase(Property("SkipAdminPassword" ))<>"YES" and UCase(Property("DeploymentType" ))<>"REPLACE" and UCase(Property("TaskSequenceTemplate" )) <> "LTIOEM.XML"]]></Condition>
  66. </Pane>
  67. <Pane id="AdministratorAccounts" reference="DeployWiz_AdminAccounts.xml">
  68.  <Condition><![CDATA[ UCase(Property("SkipAdminAccounts" )) = "NO" and UCase(Property("DeploymentType" ))<>"REPLACE" and Property("DeploymentType" )<>"CUSTOM" and Property("JoinDomain" ) <> "" ]]></Condition>
  69. </Pane>
  70. <Pane id="CaptureImage" reference="DeployWiz_CaptureImage.xml">
  71.  <Condition><![CDATA[ Ucase(Property("SkipCapture" ))<>"YES" and Property("DeploymentType" ) <> "REFRESH" and Property("JoinDomain" ) = "" and Property("DeploymentType" ) <> "REPLACE"]]></Condition>
  72.  <Condition><![CDATA[ FindTaskSequenceStep("//step[@name='Create WIM']", "ZTIBackup.wsf" ) ]]></Condition>
  73. </Pane>
  74. <Pane id="BitLocker" reference="DeployWiz_BitLocker.xml">
  75.  <Condition><![CDATA[ Property("DeploymentType" )<>"REPLACE" and Property("DeploymentType" )<>"CUSTOM" and UCase(Property("SkipBitLocker" )) <> "YES" and UCase(Property("DoCapture" )) <> "YES" and UCase(Property("DoCapture" )) <> "PREPARE" ]]></Condition>
  76.  <Condition><![CDATA[ Left(Property("ImageBuild" ), 1) = "6" and oUtility.IsHighEndSKUEx( oEnvironment.Item("ImageFlags" ) ) ]]></Condition>
  77. </Pane>
  78. <Pane id="Credentials" reference="DeployWiz_Credentials.xml">
  79.  <Condition><![CDATA[ ((UserID_isDirty = TRUE or Property("UserID" )="" ) or (Property("UserPassword" )="" ) or (Property("UserDomain" ) = Property("OSDComputerName" ))) and Property("DeploymentMethod" ) <> "MEDIA"]]></Condition>
  80. </Pane>
  81. <Pane id="Ready" reference="DeployWiz_Ready.xml">
  82.  <Condition><![CDATA[ ucase(Property("SkipSummary" )) <> "YES"]]></Condition>
  83. </Pane>
  84. <Pane id="Drivers" reference="DeployWiz_Drivers.xml">
  85.  <Condition><![CDATA[ FindTaskSequenceStep("//step[@type='BDD_InjectDrivers' and @name='Inject Drivers']", "ZTIDrivers.wsf" ) ]]></Condition>
  86.     </Pane>
  87. </Wizard>


 
DeployWiz_Drivers.xml
 

Code :
  1. <?xml version=”1.0” encoding=”utf-8” ?>
  2. <!—
  3. // ***************************************************************************
  4. //  
  5. // Copyright (c) Microsoft Corporation.  All rights reserved.
  6. //  
  7. // Microsoft Deployment Toolkit Solution Accelerator
  8. //
  9. // File:      DeployWiz_Drivers.xml
  10. //  
  11. // Version:   1.0.0.0
  12. //  
  13. // Purpose:   Main Client Deployment Wizard Defintion File
  14. //  
  15. // ***************************************************************************
  16. —>
  17. <Wizard>
  18. <Global>
  19. <CustomScript>DeployWiz_Initialization.vbs</CustomScript>
  20.     <CustomScript>DeployWiz_Drivers.vbs</CustomScript>
  21. </Global>
  22.        <Pane id=”Drivers” title=”Drivers”>
  23.                 <Body>
  24.                 <![CDATA[
  25.                   <H1>Inject Drivers</H1>
  26.                   <p>Select a profile:</br>
  27.                     <select id=”DriverSelectionProfile” NAME=DriverSelectionProfile language=vbscript onchange=”SetDriverProfile”>
  28.                     </select>
  29.                   </p>
  30.                   ]]>
  31. </Body>
  32.        <Initialization><![CDATA[OutputProfileList]]></Initialization>
  33.             </Pane>
  34. </Wizard>


 
DeployWiz_Drivers.vbs
 

Code :
  1. // ***************************************************************************
  2. //
  3. // Copyright (c) Microsoft Corporation.  All rights reserved.
  4. //
  5. // Microsoft Deployment Toolkit Solution Accelerator
  6. //
  7. // File:      DeployWiz_Drivers.vbs
  8. //
  9. // Version:   1.0.0.0
  10. //
  11. // Purpose:   Deployment Wizard driver initialization routines
  12. //
  13. // ***************************************************************************
  14. Option Explicit
  15. ’ Function for creating a drop own list of driver selection profiles
  16.   Function OutputProfileList
  17.     Dim sFile
  18.     Dim sPath
  19.     Dim sProfileList
  20.     Dim sHTMLcode
  21.     Dim sOption
  22.     Dim x
  23. ’ Find the path to Profiles.xml
  24.      oUtility.FindFile “SelectionProfiles.xml”, sPath
  25.   ’ Load values from Profiles.xml
  26.     Set sFile = CreateObject(“Msxml2.DOMDocument”)
  27.     sFile.load sPath
  28.     Set sProfileList = sFile.getElementsByTagName(“Name”)
  29. ’ Output Profile names as options
  30.     If sProfileList.length > 0 then
  31.       For each x in sProfileList
  32.           Set sOption = document.createElement(“OPTION”)
  33.           sOption.text = x.Text
  34.           sOption.Value = x.Text
  35.           document.getElementByID(“DriverSelectionProfile”).Add(sOption)
  36.        Next
  37.     Else
  38.        oLogging.CreateEntry “No Profiles.xml file was found, so no additonal DriverProfileSelect pane initialization is required.”, LogTypeInfo
  39.     End If
  40. End Function
  41. ‘Function to set the DriverGroup variable
  42. Function SetDriverProfile
  43.     oEnvironment.Item(“DriverSelectionProfile”) = document.getElementByID(“DriverSelectionProfile”).Value
  44. End Function


 
 
Au secours :p

Reply

Marsh Posté le 14-08-2012 à 08:49:27   

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed