forked from thelsing/CreateKnxProd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ETSPathHelper.cs
33 lines (29 loc) · 858 Bytes
/
ETSPathHelper.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.IO;
namespace CreateKnxProd
{
public static class ETSPathHelper
{
private static string Programfolder = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
public static string Combine(params string[] paths)
{
var pathElements = new List<string>();
pathElements.Add(Programfolder);
pathElements.Add(CheckForETS6());
pathElements.AddRange(paths);
return Path.Combine(pathElements.ToArray());
}
private static string CheckForETS6()
{
if (Directory.Exists(Path.Combine(Programfolder, "ETS6")))
{
return "ETS6";
}
else
{
return "ETS5";
}
}
}
}