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

Microsoft Azure Discussion :

Installation d'un service Windows dans une tâche de démarrage


Sujet :

Microsoft Azure

  1. #1
    Futur Membre du Club
    Inscrit en
    Mai 2010
    Messages
    4
    Détails du profil
    Informations forums :
    Inscription : Mai 2010
    Messages : 4
    Points : 5
    Points
    5
    Par défaut Installation d'un service Windows dans une tâche de démarrage
    Bonjour à tous,

    J'essaye d'installer un service Windows lors du déploiement d'un rôle sur Azure mais cela ne fonctionne pas.

    Pour déclencher l'installation du service j'ai paramétré une tâche de démarrage dans le fichier DefinitionService.csdef :

    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
        <Startup>
          <Task commandLine="GNetCalcServices\AzureInstall.cmd" executionContext="elevated" taskType="background" />
        </Startup>

    Le fichier cmd contient les lignes suivantes :
    Code batch : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    set here=%~dp0%
    "%windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe" "%here%GNetCalcServices.exe"
    NET START GNetCalcServices

    Dans mon fichier de log, j'ai les informations suivantes :

    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
     
    E:\approot\bin>"D:\windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe" "E:\approot\bin\GNetCalcServices\GNetCalcServices.exe" 
    Microsoft (R) .NET Framework Installation utility Version 2.0.50727.4016
    Copyright (c) Microsoft Corporation.  All rights reserved.
     
     
    Running a transacted installation.
     
    Beginning the Install phase of the installation.
    See the contents of the log file for the E:\approot\bin\GNetCalcServices\GNetCalcServices.exe assembly's progress.
    The file is located at E:\approot\bin\GNetCalcServices\GNetCalcServices.InstallLog.
    Installing assembly 'E:\approot\bin\GNetCalcServices\GNetCalcServices.exe'.
    Affected parameters are:
       logtoconsole = 
       assemblypath = E:\approot\bin\GNetCalcServices\GNetCalcServices.exe
       logfile = E:\approot\bin\GNetCalcServices\GNetCalcServices.InstallLog
    Unable to create an instance of the GNetCalcServices.ProjectInstaller installer type.
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
    The inner exception System.IO.FileNotFoundException was thrown with the following error message: Could not find file 'E:\approot\bin\App.InstallConfig.xml'..
     
    An exception occurred during the Install phase.
    System.InvalidOperationException: Unable to create an instance of the GNetCalcServices.ProjectInstaller installer type.
    The inner exception System.Reflection.TargetInvocationException was thrown with the following error message: Exception has been thrown by the target of an invocation..
    The inner exception System.IO.FileNotFoundException was thrown with the following error message: Could not find file 'E:\approot\bin\App.InstallConfig.xml'..
     
    The Rollback phase of the installation is beginning.
    See the contents of the log file for the E:\approot\bin\GNetCalcServices\GNetCalcServices.exe assembly's progress.
    The file is located at E:\approot\bin\GNetCalcServices\GNetCalcServices.InstallLog.
    Rolling back assembly 'E:\approot\bin\GNetCalcServices\GNetCalcServices.exe'.
    Affected parameters are:
       logtoconsole = 
       assemblypath = E:\approot\bin\GNetCalcServices\GNetCalcServices.exe
       logfile = E:\approot\bin\GNetCalcServices\GNetCalcServices.InstallLog
    Unable to create an instance of the GNetCalcServices.ProjectInstaller installer type.
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
    The inner exception System.IO.FileNotFoundException was thrown with the following error message: Could not find file 'E:\approot\bin\App.InstallConfig.xml'..
    An exception occurred during the Rollback phase of the System.Configuration.Install.AssemblyInstaller installer.
    System.InvalidOperationException: Unable to create an instance of the GNetCalcServices.ProjectInstaller installer type.
    The inner exception System.Reflection.TargetInvocationException was thrown with the following error message: Exception has been thrown by the target of an invocation..
    The inner exception System.IO.FileNotFoundException was thrown with the following error message: Could not find file 'E:\approot\bin\App.InstallConfig.xml'..
    An exception occurred during the Rollback phase of the installation. This exception will be ignored and the rollback will continue. However, the machine might not fully revert to its initial state after the rollback is complete.
     
    The Rollback phase completed successfully.
     
    The transacted install has completed.
    The installation failed, and the rollback has been performed.
     
    E:\approot\bin>NET START GNetCalcServices 
    The service name is invalid.
    Il semblerait que l'installUtil.exe recherche le "App.InstallConfig.xml" au mauvais endroit mais je ne trouve pas comment spécifier le chemin.

    De plus, le script fonctionne très bien quand je l'exécute manuellement.

    Merci d'avance pour vos réponses.

  2. #2
    Futur Membre du Club
    Inscrit en
    Mai 2010
    Messages
    4
    Détails du profil
    Informations forums :
    Inscription : Mai 2010
    Messages : 4
    Points : 5
    Points
    5
    Par défaut
    J'ai résolu mon problème en modifiant une ligne dans le fichier cmd :

    Code batch : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
    set here=%~dp0%
     
    REM On se place dans le répertoire où se trouve le script
    cd %here%
     
    "%windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe" "%here%GNetCalcServices.exe"
    NET START GNetCalcServices

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

Discussions similaires

  1. Installer Windows dans une partition Créer avec Linux
    Par Luke spywoker dans le forum Ubuntu
    Réponses: 1
    Dernier message: 20/08/2012, 18h25
  2. Réponses: 2
    Dernier message: 16/10/2011, 15h17
  3. Service windows exécutant une tâche périodique
    Par Nico_stras dans le forum C#
    Réponses: 13
    Dernier message: 06/03/2008, 08h46
  4. [C#] installation comme étant service windows
    Par fafa139 dans le forum Windows Forms
    Réponses: 5
    Dernier message: 04/04/2006, 10h41
  5. Se servir du login/passwd window dans une appli
    Par ericb dans le forum Windows
    Réponses: 8
    Dernier message: 26/05/2004, 17h34

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