Skip to content

Commit 1f3a7df

Browse files
committed
New logging message
1 parent d5fcd89 commit 1f3a7df

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Tulpep.NetworkAutoSwitch.Service/Program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ static int Main(string[] args)
2525
case "--install":
2626
string currentPath = Assembly.GetExecutingAssembly().Location;
2727
string pathOfService = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "NetworkAutoSwitch.exe");
28-
if(currentPath != pathOfService)
28+
if(currentPath == pathOfService) Logging.WriteMessage("The file is located in {0}, you can not delete it from there after the service installation", currentPath);
29+
else
2930
{
3031
Logging.WriteMessage("Copying file to " + pathOfService);
3132
File.Copy(currentPath, pathOfService, true);
@@ -34,7 +35,7 @@ static int Main(string[] args)
3435
Logging.WriteMessage("Service Installed");
3536
const string serviceName = "NetworkAutoSwitch";
3637
int timeout = 5000;
37-
Logging.WriteMessage(String.Format("Starting Windows Service {0} with timeout of {1} ms", serviceName, timeout));
38+
Logging.WriteMessage("Starting Windows Service {0} with timeout of {1} ms", serviceName, timeout);
3839
StartService(serviceName, timeout);
3940
Logging.WriteMessage("Service running");
4041
return 0;

0 commit comments

Comments
 (0)