forked from belisleian/uTikDownloadHelper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtractedResources.cs
35 lines (34 loc) · 1.13 KB
/
ExtractedResources.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
34
35
using System;
using System.IO;
namespace uTikDownloadHelper
{
class ExtractedResources
{
private static string extractResources()
{
var resourcesDirectory = Path.Combine(Common.SettingsPath, "app");
if (!Directory.Exists(resourcesDirectory))
{
Directory.CreateDirectory(resourcesDirectory);
}
try
{
File.WriteAllBytes(Path.Combine(resourcesDirectory, "wget.exe"), Properties.Resources.wget);
} catch { }
try
{
File.WriteAllBytes(Path.Combine(resourcesDirectory, "vcruntime140.dll"), Properties.Resources.vcruntime140);
} catch { }
return resourcesDirectory;
}
public string extractedResourcesPath;
public string wget;
public string vcruntime140;
public ExtractedResources()
{
extractedResourcesPath = extractResources();
wget = Path.Combine(extractedResourcesPath, "wget.exe");
vcruntime140 = Path.Combine(extractedResourcesPath, "vcruntime140.dll");
}
}
}