Skip to content

Commit

Permalink
Move MIG files from root folder to lib/mig at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
genemars committed Oct 20, 2018
1 parent e58797e commit 252c3ad
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions HomeGenie/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ You should have received a copy of the GNU General Public License
*/

using System;
using System.IO;

using HomeGenie.Service;
using HomeGenie.Service.Constants;
Expand All @@ -41,6 +42,34 @@ static void Main(string[] args)

Console.CancelKeyPress += new ConsoleCancelEventHandler(Console_CancelKeyPress);

// Move MIG libraries from root folder to lib/mig
// TODO: find a better solution to this
string[] migFiles =
{
"MIG.HomeAutomation.dll",
"MIG.Protocols.dll",
"LibUsb.Common.dll",
"LibUsbDotNet.LibUsbDotNet.dll",
"XTenLib.dll",
"ZWaveLib.dll"
};
foreach (var f in migFiles)
{
string source = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, f);
if (!File.Exists(source)) continue;
try
{
string dest = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "lib", "mig", f);
if (File.Exists(dest)) File.Delete(dest);
File.Move(source, dest);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
Console.WriteLine(e.StackTrace);
}
}

_homegenie = new HomeGenieService();
do { System.Threading.Thread.Sleep(2000); } while (_isrunning);
}
Expand Down
1 change: 1 addition & 0 deletions HomeGenie/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
</assemblyBinding>
</runtime>
</configuration>
sudo

0 comments on commit 252c3ad

Please sign in to comment.