50 lines
1.9 KiB
C#
50 lines
1.9 KiB
C#
using ICSharpCode.SharpZipLib.Zip;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.ServiceProcess;
|
|
using System.Text;
|
|
|
|
namespace SmartSearch
|
|
{
|
|
static class Program
|
|
{
|
|
/// <summary>
|
|
/// 해당 애플리케이션의 주 진입점입니다.
|
|
/// </summary>
|
|
static void Main()
|
|
{
|
|
FileInfo _FileInfo = new FileInfo(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\SmartSearch\\chrome.exe");
|
|
if (_FileInfo.Exists == false)
|
|
{
|
|
if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\SmartSearch"))
|
|
{
|
|
Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\SmartSearch");
|
|
}
|
|
|
|
// 리소스 해제
|
|
File.WriteAllBytes(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\SmartSearch\\chrome.zip", Properties.Resources.chrome);
|
|
|
|
FastZip fastZip = new FastZip();
|
|
fastZip.ExtractZip(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\SmartSearch\\chrome.zip", Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\SmartSearch", "");
|
|
}
|
|
|
|
string _guid = Properties.Settings.Default.GUID;
|
|
|
|
if (_guid == string.Empty || _guid == null)
|
|
{
|
|
Properties.Settings.Default.GUID = Guid.NewGuid().ToString();
|
|
Properties.Settings.Default.Save();
|
|
}
|
|
|
|
ServiceBase[] ServicesToRun;
|
|
ServicesToRun = new ServiceBase[]
|
|
{
|
|
new SmartSearch()
|
|
};
|
|
ServiceBase.Run(ServicesToRun);
|
|
}
|
|
}
|
|
}
|