Rem Script de finalisation d'installation de Peugeot Planet Diag 3.1.39 Rem Les anciens raccourcis sont effacés Rem Les nouveaux raccourcis sont créés dim serveur, proxyuser, proxypwd, proxyaddress, proxyport, proxy REM Valeurs par défaut insérées dans le fichier de configuration du client. serveur = "https://ogds.peugeot.com/diagnostic/" proxyuser ="" proxypwd = "" proxyaddress = "" proxyport = "80" proxy = "FALSE" ConsoleIdType = "" REM ======================================== REM création de l'icone PPDIAG sur le bureau REM et suppression des anciens raccourcis REM ======================================== Set WshShell = WScript.CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") DesktopPath = WshShell.SpecialFolders("Desktop") Rem effacement des raccourcis 1.5 If (fso.FileExists(DesktopPath & "\Peugeot Planet Diag.lnk")) Then fso.DeleteFile(DesktopPath & "\Peugeot Planet Diag.lnk") If (fso.FileExists(DesktopPath & "\Config PPD Server.lnk")) Then fso.DeleteFile(DesktopPath & "\Config PPD Server.lnk") If (fso.FileExists(DesktopPath & "\View PPD Server.lnk")) Then fso.DeleteFile(DesktopPath & "\View PPD Server.lnk") If (fso.FileExists(DesktopPath & "\Ediag.Properties.lnk")) Then fso.DeleteFile(DesktopPath & "\Ediag.Properties.lnk") If (fso.FileExists(DesktopPath & "\PPDiag Server.lnk")) Then fso.DeleteFile(DesktopPath & "\PPDiag Server.lnk") REM creation du raccourci ppdiag 3.1.39 Set oShellLink = WshShell.CreateShortcut(DesktopPath & "\Peugeot Planet Diag.lnk") oShellLink.TargetPath = "C:\app\ppdiag\ppd.bat" oShellLink.Arguments = " start -browser" oShellLink.WindowStyle = 7 oShellLink.IconLocation = "c:\app\ppdiag\ppd.ico" oShellLink.Description = "Peugeot Planet Diag 3.1.39" oShellLink.WorkingDirectory = "c:\app\ppdiag\" oShellLink.Save Rem ==================================================== Rem Détermination de l'adresse MAC de la machine Rem ==================================================== On Error Resume Next strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration",,48) For Each objItem in colItems if objitem.MACAddress <> "" and objitem.IPEnabled and objItem.SettingID <> "" then ' Wscript.Echo "IPEnabled: " & objItem.IPEnabled ' Wscript.Echo "MACAddress: " & objItem.MACAddress ' Wscript.Echo "SettingID: " & objItem.SettingID MACAddress = replace(objItem.MACAddress,":","-") exit for end if Next if MACAddress="" then For Each objItem in colItems if objitem.MACAddress <> "" and objItem.SettingID <> "" then MACAddress = replace(objItem.MACAddress,":","-") exit for end if Next end if If MACaddress = "" Then taille = "0000000000" & cstr(month(now)) & cstr(day(now)) & cstr(hour(now)) & cstr(minute(now)) & cstr(second(now)) taille = right(taille,10) MACaddress = "FF-" & mid(taille,1,2) & "-" & mid(taille,3,2) & "-" & mid(taille,5,2) & "-" & mid(taille,7,2) & "-" & mid(taille,9,2) End If If MACaddress = "" Then MACaddress = "00-00-00-00-00-00" on error goto 0 If ConsoleIdType="" Then ConsoleIdType="MAC" REM =================================== REM récupération des anciens paramètres REM =================================== reptemp = WshShell.ExpandEnvironmentStrings("%temp%") if fso.FileExists(reptemp&"\ediag.properties") then Set fichpropin=fso.OpenTextFile(reptemp&"\ediag.properties",1) Do until fichpropin.AtEndOfStream a = fichpropin.readline if mid(a,1,20)="connexion.proxyuser" then proxyuser = mid(a,22,len(a)-21) if mid(a,1,19)="connexion.proxypw" then proxypwd = mid(a,21,len(a)-20) if mid(a,1,23)="connexion.proxyaddress" then proxyaddress = mid(a,25,len(a)-24) if mid(a,1,20)="connexion.proxyport" then proxyport = mid(a,22,len(a)-21) if mid(a,1,19)="connexion.useproxy" then proxy = mid(a,21,len(a)-20) If Mid(a,1,15)="bds.console.id=" Then MACaddress = Mid(a,21,Len(a)-15) If Mid(a,1,20)="bds.console.id.type=" Then ConsoleIdType = Mid(a,21,Len(a)-20) loop fichpropin.close end if Rem ===================================================== Rem ouverture puis paramétrage du fichier properties 3.1.39 Rem ===================================================== Set fichpropin=fso.OpenTextFile("c:\app\ppdiag\persistent\ediag.properties",1) Set fichpropout=fso.CreateTextFile("c:\app\ppdiag\persistent\ediag1.properties",1) Do until fichpropin.AtEndOfStream a = fichpropin.readline If not ((Mid(a,1,20)="connection.proxyuser") or _ (Mid(a,1,19)="connection.proxypwd") or _ (Mid(a,1,23)="connection.proxyaddress") or _ (Mid(a,1,21)="connection.proxyport") or _ (Mid(a,1,20)="connection.useproxy") or _ (Mid(a,1,24)="connection.diagserverurl") or _ (Mid(a,1,15)="bds.console.id=") or _ (Mid(a,1,20)="bds.console.id.type=")) Then fichpropout.writeline(a) loop a = "connection.proxyuser=" + proxyuser : fichpropout.writeline(a) a = "connection.proxypwd=" + proxypwd : fichpropout.writeline(a) a = "connection.proxyaddress=" + proxyaddress : fichpropout.writeline(a) a = "connection.proxyport="+proxyport : fichpropout.writeline(a) a = "connection.useproxy=" + proxy : fichpropout.writeline(a) a = "connection.diagserverurl=" + serveur: fichpropout.writeline(a) a = "bds.console.id=" + MACaddress: fichpropout.writeline(a) a = "bds.console.id.type=" + ConsoleIdType: fichpropout.writeline(a) fichpropin.close fichpropout.close fso.deletefile("c:\app\ppdiag\persistent\ediag.properties") fso.CopyFile "c:\app\ppdiag\persistent\ediag1.properties", "c:\app\ppdiag\persistent\ediag.properties" fso.deletefile("c:\app\ppdiag\persistent\ediag1.properties") fso.deletefile(reptemp&"\ediag.properties")