SharpeRAD/Cake.Services

Install is still broken

Closed this issue · 2 comments

The fix to #6 included in 0.2.7 isn't quite right. Given this task:

Task("RegisterService")
  .Does(() => {
    InstallService(new InstallSettings()
    {
        ServiceName = "TestServiceName",
        DisplayName = "TestServiceDisplay",
        Description = "Test Service",

        ExecutablePath = @"C:\path\to\bin.exe"
    });
  });

The output when invoking the task is:

PS C:\dev\project> ./build.ps1 -Target RegisterService
Preparing to run build script...
Running build script...
Analyzing build script...
Processing build script...
Installing addins...
Compiling build script...

========================================
RegisterService
========================================
Executing task: RegisterService
The service TestServiceName does not exist.
Executing: & "sc.exe" create "TestServiceName" binPath="C:/path/to/bin.exe" DisplayName="TestServiceDisplay"
DESCRIPTION:
        Creates a service entry in the registry and Service Database.
USAGE:
        sc <server> create [service name] [binPath= ] <option1> <option2>...

OPTIONS:
NOTE: The option name includes the equal sign.
      A space is required between the equal sign and the value.
 type= <own|share|interact|kernel|filesys|rec>
       (default = own)
 start= <boot|system|auto|demand|disabled|delayed-auto>
       (default = demand)
 error= <normal|severe|critical|ignore>
       (default = normal)
 binPath= <BinaryPathName>
 group= <LoadOrderGroup>
 tag= <yes|no>
 depend= <Dependencies(separated by / (forward slash))>
 obj= <AccountName|ObjectName>
       (default = LocalSystem)
 DisplayName= <display name>
 password= <password>

Executing: & "sc.exe" description "Test Service"
DESCRIPTION:
        Sets the description string for a service.
USAGE:
        sc <server> description [service name] [description]

Finished executing task: RegisterService

Task                          Duration
--------------------------------------------------
RegisterService               00:00:00.3460776
--------------------------------------------------
Total:                        00:00:00.3460776

If you look in the NOTE: section of the output, you see NOTE: The option name includes the equal sign. A space is required between the equal sign and the value. which is what I believe is the problem. Cake.Services isn't putting a space between binPath= and the path

PR then?

Yes, I am planning on trying to fix this tonight.