diff --git a/lf_daemon/ProcessExtensions.cs b/lf_daemon/ProcessExtensions.cs index 695f964..af8d80d 100644 --- a/lf_daemon/ProcessExtensions.cs +++ b/lf_daemon/ProcessExtensions.cs @@ -120,10 +120,12 @@ private enum WTS_INFO_CLASS public static void log(string msg) { +#if (DEBUG) string strAppPath = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "lt_daemon.log"); FileStream fs = File.Open(strAppPath, FileMode.Append); fs.Write(System.Text.UTF8Encoding.UTF8.GetBytes(msg+"\r\n")); fs.Close(); +#endif } /// /// Gets the user token from the currently active session. Application must be running within the context of the LocalSystem Account. diff --git a/lf_daemon/createService.cmd b/lf_daemon/createService.cmd index 9ead9dc..e9ca680 100644 --- a/lf_daemon/createService.cmd +++ b/lf_daemon/createService.cmd @@ -1,4 +1,4 @@ -@echo off -@rem Intended to run from the same directory (e.g. bin); build should copy to bin. -sc create "LenovoFanDaemon" binpath= "%~dp0lf_daemon.exe LenovoFan.exe" displayname= "LenovoFanDaemon" -sc start "LenovoFanDaemon" +@echo off +@rem Intended to run from the same directory (e.g. bin); build should copy to bin. +sc create "LenovoFanDaemon" binpath= "%~dp0lf_daemon.exe LenovoFan.exe" displayname= "LenovoFanDaemon" start=auto +sc start "LenovoFanDaemon"