Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2365 connectés 

  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  deploiement GPO flash player avec script

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

deploiement GPO flash player avec script

n°2278212
como10
Posté le 22-03-2016 à 16:25:24  profilanswer
 

Bonjour à tous,
 
Je viens solliciter vos lumières concernant les scripts. En effet je souhaites créer un script (En batch ou en vbscript ?) qui me permettra de déployer à travers une GPO ordinateur le plugin ainsi que l'activeX flash player. J'ai trouvé plusieurs script mais qui ne me convienne pas totalement. Je souhaiterais en effet que ce script n'installe flash uniquement que s'il n'est pas à jour.
Dans mon esprit ce script doit d'abord vérifier l'architecture du processeur 64 ou bit 32 (ce qui détermine les différents chemins ou placer certains fichiers). Ensuite vérifier la version du plugin et activeX installé (en allant vérifier dans la base de regsitre HKLM\software\windows\currentversion\uninstall\"version" ). Si la version actuelle du poste correspond a la version à installer alors on fini le script sinon on procède à la désinstallation de flash et réinstallation de la bonne version (.msi) et pour terminer on copie un fichier mms.cfg qui désactive la mise a jour auto de flash (chemin dépendant de l'architecture OS 32 ou 64).
Voila je pense avoir été clair. Je tiens aussi à préciser que je ne connais que très peu les langages en question. Je pense que le process est bon mais je ne connais pas les paramètres permettant de réaliser cela.
Donc je souhaiterais savoir lequel des deux langages (vbscript ou batch) est le plus approprié pour réaliser cela. Et ensuite quels sont les outils, objet ou sources permettant de réaliser cela ?
Merci d'avance pour votre aide

mood
Publicité
Posté le 22-03-2016 à 16:25:24  profilanswer
 

n°2278245
como10
Posté le 23-03-2016 à 11:23:18  profilanswer
 

Après diverses recherches sur le net j'ai trouvé un script (ci dessous) en .vbs que je voudrais adapter à ma situation.
J'ai rajouté une constante InstallFlashVersion = "21.0.0.197"
et je pense que dans la partie uninstall il faudrait que je rajoute une condition qui vérifie dans la base de registre si la version installé est la même que celle indiquée dans la constante
La clé de registre varie selon l'architecture 64 ou 32.
Je pense que cela devrait se situer dans la partie "uninstalloldflash" si la version est égale à "InstallFlashVersion" alors on passe à "GlobalVariableCleanup()" sinon on continue la désinstallation de la version flash et puis on continue.
Si vous avez des suggestions concernant la syntaxe pour réaliser cela ou d'autres idées
 

Code :
  1. '*******************************************************************************
  2. '     Program: InstallFlash.vbs
  3. '      Author: Mick Pletcher
  4. '        Date: 11 April 2012
  5. '    Modified:
  6. '
  7. '   Publisher: Adobe
  8. '     Program: Flash
  9. '     Version: 21.x
  10. ' Description: Adobe Flash Installation
  11. '                          1) Define Relative Installation Path
  12. '      2) Determine Architecture
  13. '      3) Create Logs Folder
  14. '      4) Uninstall all old versions of Flash
  15. '      5) Install Flash
  16. '      6) Copy MMS File'
  17. '      7) Cleanup Global Variables
  18. '      8) Exit Installation
  19. '*******************************************************************************
  20. Option Explicit
  21. REM Define Constants
  22. CONST TempFolder    = "c:\temp\"
  23. CONST LogFolderName = "AdobeFlash"
  24. CONST InstallFlashVersion = "21.0.0.197"
  25. REM Define Global Variables
  26. DIM Architecture  : Set Architecture = Nothing
  27. DIM LogFolder     : LogFolder        = TempFolder & LogFolderName & "\"
  28. DIM RelativePath  : Set RelativePath = Nothing
  29. REM Define Relative Installation Path
  30. DefineRelativePath()
  31. REM Determine Architecture
  32. DetermineArchitecture()
  33. REM Create Logs Folder
  34. CreateLogFolder()
  35. REM Uninstall Old Version of Flash
  36. UninstallOldFlash()
  37. REM Install Flash
  38. InstallFlash()
  39. REM Copy MMS File
  40. CopyMMS()
  41. REM Cleanup Global Variables
  42. GlobalVariableCleanup()
  43. '*******************************************************************************
  44. '*******************************************************************************
  45. Sub DefineRelativePath()
  46. REM Get File Name with full relative path
  47. RelativePath = WScript.ScriptFullName
  48. REM Remove file name, leaving relative path only
  49. RelativePath = Left(RelativePath, InStrRev(RelativePath, "\" ))
  50. End Sub
  51. '*******************************************************************************
  52. Sub DetermineArchitecture()
  53. REM Define Local Objects
  54. DIM WshShell : Set WshShell = CreateObject("WScript.Shell" )
  55. REM Define Local Variables
  56. DIM OsType : OsType = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE" )
  57. If OsType = "x86" then
  58.  Architecture = "x86"
  59. elseif OsType = "AMD64" then
  60.  Architecture = "x64"
  61. end if
  62. REM Cleanup Local Variables
  63. Set WshShell = Nothing
  64. Set OsType   = Nothing
  65. End Sub
  66. '*******************************************************************************
  67. Sub CreateLogFolder()
  68. REM Define Local Objects
  69. DIM FSO : Set FSO = CreateObject("Scripting.FileSystemObject" )
  70. If NOT FSO.FolderExists(TempFolder) then
  71.  FSO.CreateFolder(TempFolder)
  72. End If
  73. If NOT FSO.FolderExists(LogFolder) then
  74.  FSO.CreateFolder(LogFolder)
  75. End If
  76. REM Cleanup Local Objects & Variables
  77. Set FSO = Nothing
  78. End Sub
  79. '*******************************************************************************
  80. Sub UninstallOldFlash()
  81. REM Define Local Objects
  82. DIM FSO    : SET FSO    = CreateObject("Scripting.FileSystemObject" )
  83. DIM oShell : SET oShell = CreateObject("Wscript.Shell" )
  84. REM Define Local Variables
  85. DIM oAPPDATA     : oAPPDATA     = oShell.ExpandEnvironmentStrings("%APPDATA%" )
  86. DIM Parameters   : Parameters   = Chr(32) & "-uninstall activex"
  87. DIM Uninstallx86 : Uninstallx86 = RelativePath & "uninstall_flash_player_32bit.exe" & Parameters
  88. DIM Uninstallx64 : Uninstallx64 = RelativePath & "uninstall_flash_player_64bit.exe" & Parameters
  89. If Architecture = "x86" then
  90.  oShell.Run Uninstallx86, 1, True
  91. Else
  92.  oShell.Run Uninstallx64, 1, True
  93. End If
  94. If FSO.FolderExists("C:\Windows\system32\Macromed\Flash\" ) then
  95.  FSO.DeleteFile "C:\Windows\system32\Macromed\Flash\*.*", True
  96.  FSO.DeleteFolder "C:\Windows\system32\Macromed\Flash", True
  97. End If
  98. If FSO.FolderExists("C:\Windows\SysWOW64\Macromed\Flash\" ) then
  99.  FSO.DeleteFile("C:\Windows\SysWOW64\Macromed\Flash\*.*" )
  100.  FSO.DeleteFolder "C:\Windows\system32\Macromed\Flash", True
  101. End If
  102. If FSO.FolderExists(oAPPDATA & "\Adobe\Flash Player\" ) then
  103.  FSO.DeleteFile(oAPPDATA & "\Adobe\Flash Player\*.*" )
  104.  FSO.DeleteFolder oAPPDATA & "\Adobe\Flash Player", True
  105. End If
  106. If FSO.FolderExists(oAPPDATA & "\Macromedia\Flash Player\" ) then
  107.  FSO.DeleteFile(oAPPDATA & "\Macromedia\Flash Player\*.*" )
  108.  FSO.DeleteFolder oAPPDATA & "\Macromedia\Flash Player", True
  109. End If
  110. REM Cleanup Local Objects & Variables
  111. Set FSO          = Nothing
  112. Set oShell       = Nothing
  113. Set Parameters   = Nothing
  114. Set Uninstallx86 = Nothing
  115. Set Uninstallx64 = Nothing
  116. End Sub
  117. '*******************************************************************************
  118. Sub InstallFlash()
  119. REM Define Local Objects
  120. DIM oShell : SET oShell = CreateObject("Wscript.Shell" )
  121. REM Define Local Variables
  122. DIM Filex86    : Filex86    = Chr(32) & RelativePath & "install_flash_player_11_active_x_32bit.msi"
  123. DIM Filex64    : Filex64    = Chr(32) & RelativePath & "install_flash_player_11_active_x_64bit.msi"
  124. DIM LogFilex86 : LogFilex86 = Chr(32) & "/lvx" & Chr(32) & LogFolder & "Flash11x86.log"
  125. DIM LogFilex64 : LogFilex64 = Chr(32) & "/lvx" & Chr(32) & LogFolder & "Flash11x64.log"
  126. DIM Parameters : Parameters = Chr(32) & "/qb- /norestart"
  127. DIM Install32  : Install32  = "msiexec.exe /i" & Filex86 & LogFilex86 & Parameters
  128. DIM Install64  : Install64  = "msiexec.exe /i" & Filex64 & LogFilex64 & Parameters
  129. oShell.Run Install32, 1, True
  130. If Architecture = "x64" Then
  131.  oShell.Run Install64, 1, True
  132. End If
  133. REM Cleanup Local Variables
  134. Set Filex86    = Nothing
  135. Set Filex64    = Nothing
  136. Set LogFilex86 = Nothing
  137. Set LogFilex64 = Nothing
  138. Set oShell     = Nothing
  139. Set Parameters = Nothing
  140. Set Install32  = Nothing
  141. Set Install64  = Nothing
  142. End Sub
  143. '*******************************************************************************
  144. Sub CopyMMS()
  145. REM Define Local Objects
  146. DIM FSO    : SET FSO    = CreateObject("Scripting.FileSystemObject" )
  147. If Architecture = "x86" then
  148.  If FSO.FileExists("C:\Windows\system32\Macromed\Flash" ) then
  149.   FSO.DeleteFile "C:\Windows\system32\Macromed\Flash\mms.cfg", True
  150.  End If
  151.  FSO.CopyFile RelativePath & "mms.cfg", "C:\Windows\system32\Macromed\Flash\", True
  152. Else
  153.  If FSO.FileExists("C:\Windows\SysWow64\Macromed\Flash" ) then
  154.   FSO.DeleteFile "C:\Windows\SysWow64\Macromed\Flash\mms.cfg", True
  155.  End If
  156.  FSO.CopyFile RelativePath & "mms.cfg", "C:\Windows\SysWow64\Macromed\Flash\", True
  157. End If
  158. REM Cleanup Local Objects
  159. Set FSO = Nothing
  160. End Sub
  161. '*******************************************************************************
  162. Sub GlobalVariableCleanup()
  163. Set Architecture = Nothing
  164. Set LogFolder    = Nothing
  165. Set RelativePath = Nothing
  166. End Sub


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  deploiement GPO flash player avec script

 

Sujets relatifs
Générer un JSON avec un script PHP et l'exploiter dans de l'AngularJSAutomatisation d'un script PHP avec CRON
Serveur pour faire tourner un script php[Script] Formatter un fichier plat à partir d'une clause copy
Modification sur un scriptScript ajout de programme au démarage de Winows
Tester si un script tourne déjà[BATCH] Script de comparaison valeur de registre avec valeur en dur
recherche de script "téléchargement"Ne pas devoir recréer un script pour chaque <div>
Plus de sujets relatifs à : deploiement GPO flash player avec script


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR