Install c++ windows service on the system

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gerome Muent

    #1

    Install c++ windows service on the system

    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:
    [RunInstallerAtt ribute(true)]
    public ref class LucyServiceInst aller: public Installer {
    private:
    ServiceInstalle r^ serviceInstalle r;
    ServiceProcessI nstaller^ processInstalle r;

    public:
    LucyServiceInst aller() {
    processInstalle r=gcnew ServiceProcessI nstaller();
    serviceInstalle r=gcnew ServiceInstalle r();

    processInstalle r->Account =ServiceAccount ::LocalSystem;
    serviceInstalle r->StartType =ServiceStartMo de::Manual;
    serviceInstalle r->ServiceName="L ucyInstaller";

    Installers->Add(serviceIns taller);
    Installers->Add(processIns taller);
    }

    };


    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\Micr osoft.NET\Frame work\v2.0.50727 \InstallUtil.ex e
    LucyService.exe
    Microsoft (R) .NET Framework-Installationspr ogramm, Version 2.0.50727.832
    Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.

    Beim Initialisieren der Installation ist eine Ausnahme aufgetreten:
    System.IO.FileL oadException: 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



Working...