Install c++ windows service on the system

G

Gerome Muent

Hi,
I created a windows service with Visual Studio 2008 C++ Express Edition
(dotnet 3.0).

The service is running fine. I can start and stop it and is working.

But I can only install it by installing a dummy service and then modify
the call for the service in the registry. This is not an elegant way of
installing it :-(

In the code I have the following relevant lines:
[RunInstallerAttribute(true)]
public ref class LucyServiceInstaller: public Installer {
private:
ServiceInstaller^ serviceInstaller;
ServiceProcessInstaller^ processInstaller;

public:
LucyServiceInstaller() {
processInstaller=gcnew ServiceProcessInstaller();
serviceInstaller=gcnew ServiceInstaller();

processInstaller->Account =ServiceAccount::LocalSystem;
serviceInstaller->StartType =ServiceStartMode::Manual;
serviceInstaller->ServiceName="LucyInstaller";

Installers->Add(serviceInstaller);
Installers->Add(processInstaller);
}

};


I can't find any installutil.exe on my system for dotnet 3.0 so I found
out that I should use the installutil of dotnet 2.0.
I tried it but it failed with the following error:
C:\LucyService>c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe
LucyService.exe
Microsoft (R) .NET Framework-Installationsprogramm, Version 2.0.50727.832
Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.

Beim Initialisieren der Installation ist eine Ausnahme aufgetreten:
System.IO.FileLoadException: Es wird versucht, eine nicht überprüfbare
ausführba
re Datei mit Fixups zu laden (IAT mit mehr als 2 Abschnitten oder ein
TLS-Abschnitt). (Ausnahme von HRESULT: 0x80131019)

Sorry this is a german version. It means that one file is not
verifiable. But which file?

Thanks for any hints, Gérôme
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top