IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VBScript Discussion :

Pb d'installation d'un msi avec vbscript


Sujet :

VBScript

  1. #1
    Futur Membre du Club
    Inscrit en
    Février 2008
    Messages
    8
    Détails du profil
    Informations forums :
    Inscription : Février 2008
    Messages : 8
    Points : 6
    Points
    6
    Par défaut Pb d'installation d'un msi avec vbscript
    Bonjour je souhaite installer un msi sur plusieurs machines qui sont listés dans une répertoire par un autre script. Mon probleme est que tout fonctionne sauf à l'instalaltion du msi sur le poste client j'ai une erreure dans le journal d'application : Product: Advitium Client Components -- Internal Error 2103. 26

    Merci de votre aide


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    Option Explicit
     
    Dim strInstaller 'The command to install the software package
    Dim strComputer 'The Computer
    Dim objWMIService 
    Dim strProcess 'The process to terminate before running the command
    Dim objProcess
    Dim objFSO, objFSO1, objFSO2
    Dim strFilePath 'The filename and path to the installer package
    Dim strDestination 'the filename and path on the destination computer for the package
    Dim colProcess 
    Dim intProcessID 'The number assigned to the process that is created
    Dim fso, fichier, fileItem
    Dim i, imax
    Dim objFileCopy
    Dim errReturn
     
     
    Const DeleteReadOnly = True
    Const HIDDEN_WINDOW = 1
    Const PathMDB   = "\\macs16\poste_advitium_test" 
     
    Set fso = CreateObject("Scripting.FileSystemObject")
    imax = 0
    'début de l'énumération
    For Each fichier In fso.GetFolder(PathMDB).Files
        Set fileItem = fso.GetFile(fichier)
     
        imax = imax + 1
        ReDim Preserve Tableau(1, imax)
        Tableau(1, imax) = Fichier.Name
     
     
        Set fileItem = Nothing
    Next
     
    'installation
     
    For i = 1 To imax
     
    'Set the variables
    strComputer = Tableau(1,i)
    strInstaller = "msiexec.exe /i c:\AdvitiumClientComponents.msi /qn"
    strProcess = "'iexplore.exe'"
    strFilePath = "\\macs16\drivers\soft\Advitium\AdvitiumClientComponents.msi"
    strDestination = "\\" & strComputer & "\c$\AdvitiumClientComponents.msi"
     
    'Display the variables when it runs
    WScript.Echo "Target Computer: " & strComputer
    WSCript.Echo "Stopping process " & strProcess
    WScript.Echo "Command: " & strInstaller
    WScript.Echo "Package: " & strDestination
     
    'Copy the installer package to the target PC
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFileCopy = objFSO.GetFile(strFilePath)
    objFileCopy.Copy (strDestination)
     
    'Stop Internet Explorer if it is running
     Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") 
     Set colProcess = objWMIService.ExecQuery("Select * from Win32_Process Where Name = " & strProcess)
     For Each objProcess in colProcess
    	 objProcess.Terminate()
    Next
     
    'Start the installer
     
    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2:Win32_Process")
    errReturn = objWMIService.Create(strInstaller, Null, Null, intProcessID)
     
    If errReturn = 0 Then
    	WScript.Echo "Installer was started with a process ID of " & intProcessID
     
    	'Set objFSO2 = CreateObject("Scripting.FileSystemObject")
    'objFSO2.DeleteFile("\\macs16\poste_advitium\"& strComputer)
     
      Else
    	Wscript.Echo strProcess & " could not be started due to error " & errReturn
    End If
     
     
    Next
     
     
     
     
     
    WScript.Quit

  2. #2
    Futur Membre du Club
    Inscrit en
    Février 2008
    Messages
    8
    Détails du profil
    Informations forums :
    Inscription : Février 2008
    Messages : 8
    Points : 6
    Points
    6
    Par défaut Pb d'installation d'un msi avec vbscript
    En fait si vous avez une solution pour lancer un .msi qui se trouve sur un poste distant a partir d'un script sur un serveur je suis prenneur !!

    MErci d'avance

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 0
    Dernier message: 13/03/2012, 09h45
  2. Installer Msi avec parametres via un vbs
    Par benguil dans le forum VBScript
    Réponses: 7
    Dernier message: 23/07/2009, 17h12
  3. Package MSI avec ancienne appli VB6 ayant déjà une install Wise
    Par EMC51 dans le forum Installation, Déploiement et Sécurité
    Réponses: 0
    Dernier message: 23/08/2007, 11h07
  4. Problème d'installation d'application ".msi"
    Par maddog2032 dans le forum Windows Serveur
    Réponses: 4
    Dernier message: 16/09/2005, 11h31
  5. [INNO SETUP][ORACLE] Installer le client Oracle avec Inno
    Par AnnSo dans le forum Bases de données
    Réponses: 11
    Dernier message: 19/08/2004, 16h21

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo