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 :
Il semblerait que l'installUtil.exe recherche le "App.InstallConfig.xml" au mauvais endroit mais je ne trouve pas comment spécifier le chemin.
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.
De plus, le script fonctionne très bien quand je l'exécute manuellement.
Merci d'avance pour vos réponses.
Partager