Skip to content

Commit 7bbc3de

Browse files
committed
service auto-start / remove log for release
1 parent 35b84ba commit 7bbc3de

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lf_daemon/ProcessExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,12 @@ private enum WTS_INFO_CLASS
120120

121121
public static void log(string msg)
122122
{
123+
#if (DEBUG)
123124
string strAppPath = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "lt_daemon.log");
124125
FileStream fs = File.Open(strAppPath, FileMode.Append);
125126
fs.Write(System.Text.UTF8Encoding.UTF8.GetBytes(msg+"\r\n"));
126127
fs.Close();
128+
#endif
127129
}
128130
/// <devdoc>
129131
/// Gets the user token from the currently active session. Application must be running within the context of the LocalSystem Account.

lf_daemon/createService.cmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@echo off
2-
@rem Intended to run from the same directory (e.g. bin); build should copy to bin.
3-
sc create "LenovoFanDaemon" binpath= "%~dp0lf_daemon.exe LenovoFan.exe" displayname= "LenovoFanDaemon"
4-
sc start "LenovoFanDaemon"
1+
@echo off
2+
@rem Intended to run from the same directory (e.g. bin); build should copy to bin.
3+
sc create "LenovoFanDaemon" binpath= "%~dp0lf_daemon.exe LenovoFan.exe" displayname= "LenovoFanDaemon" start=auto
4+
sc start "LenovoFanDaemon"

0 commit comments

Comments
 (0)