Expose the ID of the service

Process launched from winsw can use these information to talk back to winsw.exe
pull/37/merge
Kohsuke Kawaguchi 2014-03-04 10:16:46 -08:00
parent c6b4eef548
commit 2ffdbde6a9
1 changed files with 6 additions and 3 deletions

View File

@ -63,13 +63,16 @@ namespace winsw
break; break;
} }
// register the base directory as environment variable so that future expansions can refer to this.
Environment.SetEnvironmentVariable("BASE", p);
BaseName = baseName; BaseName = baseName;
BasePath = Path.Combine(p, BaseName); BasePath = Path.Combine(p, BaseName);
dom.Load(BasePath + ".xml"); dom.Load(BasePath + ".xml");
// register the base directory as environment variable so that future expansions can refer to this.
Environment.SetEnvironmentVariable("BASE", p);
// ditto for ID
Environment.SetEnvironmentVariable("SERVICE_ID", Id);
Environment.SetEnvironmentVariable("WINSW_EXECUTABLE", ExecutablePath);
} }
/// <summary> /// <summary>