Skip to content

Commit

Permalink
Update as a common host syncer;
Browse files Browse the repository at this point in the history
  • Loading branch information
ylvict committed Aug 29, 2016
1 parent a9dd4e6 commit 0d23e0d
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 21 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# syncracaljkhost
A Windows services for auto update local hosts file from repo https://github.com/racaljk/hosts
# Host Syncer
A Windows services for auto update local hosts file.

Install Steps:

1. Unzip [**release**](https://github.com/ylvict/syncracaljkhost/releases) package;
1. Unzip [**release**](https://github.com/ylvict/hostsyner/releases) package;
2. Launch Command Prompt (cmd) as Administrator
3. Navigate to folder where pack unzipped to;
4. Run "Install.bat";
Expand Down
3 changes: 2 additions & 1 deletion src/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<configuration>
<appSettings>
<add key="Interval" value="3600000"/>
<add key="HostFileSrc" value="https://raw.githubusercontent.com/racaljk/hosts/master/hosts"/>
<add key="HostFileSrc" value="https://github.com/fengixng/google-hosts/raw/master/hosts"/>
<add key="CommitInfoLink" value="https://api.github.com/repos/fengixng/google-hosts/commits?path=/hosts"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
Expand Down
2 changes: 1 addition & 1 deletion src/CGitHost.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/CGitHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Timers;
using System.Web.Script.Serialization;

namespace racaljkhost
namespace HostSyncer
{
partial class CGitHost : ServiceBase
{
Expand All @@ -16,7 +16,7 @@ partial class CGitHost : ServiceBase

private string LocalHostBak => Path.Combine(EtcPath, "hosts.bak");

private string CommitInfoLink => "https://api.github.com/repos/racaljk/hosts/commits?path=/hosts";
private string CommitInfoLink => ConfigurationManager.AppSettings["CommitInfoLink"];

private string HostFileLink => ConfigurationManager.AppSettings["HostFileSrc"];

Expand Down
4 changes: 2 additions & 2 deletions src/racaljkhost.csproj → src/HostSyncer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ProjectGuid>{44764DFB-A3CA-4036-92BC-1C25081E57F2}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>racaljkhost</RootNamespace>
<AssemblyName>racaljkhost</AssemblyName>
<RootNamespace>HostSyncer</RootNamespace>
<AssemblyName>HostSyncer</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
Expand Down
2 changes: 1 addition & 1 deletion src/racaljkhost.sln → src/HostSyncer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "racaljkhost", "racaljkhost.csproj", "{44764DFB-A3CA-4036-92BC-1C25081E57F2}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HostSyncer", "HostSyncer.csproj", "{44764DFB-A3CA-4036-92BC-1C25081E57F2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
6 changes: 3 additions & 3 deletions src/Install.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\installutil.exe" racaljkhost.exe
net start racaljkhost
sc config racaljkhost start= auto
"%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\installutil.exe" hostsyncer.exe
net start hostsyncer
sc config hostsyncer start= auto
2 changes: 1 addition & 1 deletion src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace racaljkhost
namespace HostSyncer
{
static class Program
{
Expand Down
6 changes: 3 additions & 3 deletions src/ProjectInstaller.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/ProjectInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Linq;
using System.Threading.Tasks;

namespace racaljkhost
namespace HostSyncer
{
[RunInstaller(true)]
public partial class ProjectInstaller : System.Configuration.Install.Installer
Expand Down
4 changes: 2 additions & 2 deletions src/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("racaljkhost")]
[assembly: AssemblyTitle("hostsyncer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("racaljkhost")]
[assembly: AssemblyProduct("hostsyncer")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand Down
2 changes: 1 addition & 1 deletion src/Uninstall.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\installutil.exe" /u racaljkhost.exe
"%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\installutil.exe" /u hostsyncer.exe

0 comments on commit 0d23e0d

Please sign in to comment.