Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Commit

Permalink
Bug fixed
Browse files Browse the repository at this point in the history
* Change copyright year
  • Loading branch information
Too-Naive committed Jan 16, 2018
1 parent a8e50c8 commit 4abaaff
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 30 deletions.
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# Download Executable File

[![Build status](https://ci.appveyor.com/api/projects/status/8aya86796ipmuwr2/branch/master?svg=true)](https://ci.appveyor.com/project/Too-Naive/windows/branch/master)
Last update: Sept. 7th, 2017
Last update: Jan. 17th, 2018

#### 下载地址:(v2.2.0)
#### 下载地址:(v2.2.1)

- zip Package (Include `tool.exe` and `choose.exe`)
- [点我来下载](https://git.io/v5wzs)
- [点我来下载](https://git.io/vN8tJ)

如只需下载tool.exe请到[release](https://github.com/HostsTools/Windows/releases)页面手动下载
如只需下载tool.exe请到[release](https://github.com/HostsTools/Windows/releases/latest)页面手动下载

OS type | Minimun Supported Version
--------|-------------------
Expand All @@ -30,17 +30,9 @@ Server | Microsoft Windows Server 2003 Family

~~作者弃坑了~~

请通过issue来反馈任何bug以及程序问题,bug会及时得到修复。

## New Feature

如果服务无法更新hosts 请尝试安装静默启动

打开choose.exe后输入11按下回车 重启即可

## 警告

1. **请不要删除`# Copyright (c) 2014-2017, racaljk.`(作为程序的识别位点) 否则 有可能发生不可预料的后果**
1. **请不要删除`# Copyright (c) 2017-2018, googlehosts members.`(作为程序的识别位点) 否则 有可能发生不可预料的后果**
2. **如果先前没有使用本项目hosts文件 而使用了其他项目的hosts文件的 请重置hosts文件(具体方法看下方使用说明)后 再使用本程序**

## How to use?
Expand All @@ -52,15 +44,25 @@ main program file: `tool.exe`
- 无参数运行`tool.exe` 用来更新hosts文件 如有更新 程序会备份原有的hosts文件
- 运行`choose.exe` 来选择更多的运行选项

## 现有功能

* 启动程序后,从指定的源自动更新hosts文件
* 程序会保留先前的自定义hosts,如果您有使用其他的hosts,请在备份好自己自定义的hosts之后重置hosts文件
* 可选的以服务启动,在后台自动更新hosts文件
* 可选的以用户态模式(静默)开机启动,在后台自动更新hosts文件 (打开`choose.exe`后输入11按下回车)
* 程序会留下一份更新备份,如出现问题可直接更改备份文件名还原
* 程序可以直接重置hosts文件
* 可选的在服务出现问题时,使用 Debug 模式进行监听服务的状态

## 注意事项

1. 如果安装服务 程序会往`%SystemRoot%`下复制一个`hoststools.exe`文件用来作为服务启动的主程序
2. 安装服务后 日志文件会保存在`C:\Hosts_Tool_log.log`下 您可以通过查看日志观察服务的工作状态
7. 本程序一切有更改hosts文件的行为前都会先备份hosts文件。
3. 本程序一切有更改hosts文件的行为前都会先备份hosts文件。
4. 请间隔一段时间后清理`%SystemRoot%\system32\drivers\etc\`文件夹 (程序加入了询问删除早期备份文件的功能)
5. 如有任何疑问或bug反馈,请开新的issue (如是服务问题请附上日志文件)


## Code license:
## License:

General Public License Version 3
2 changes: 1 addition & 1 deletion header/diff.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This source code was published under GPL v3
*
* Copyright (C) 2017 Too-Naive
* Copyright (C) 2016-2018 Too-Naive
*
*/

Expand Down
2 changes: 1 addition & 1 deletion header/download.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This source code was published under GPL v3
*
* Copyright (C) 2017 Too-Naive
* Copyright (C) 2016-2018 Too-Naive
*
*/
//download.hpp(Re-edit)
Expand Down
2 changes: 1 addition & 1 deletion header/pipedebug.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This source code was published under GPL v3
*
* Copyright (C) 2017 Too-Naive
* Copyright (C) 2016-2018 Too-Naive
*
*/
#pragma once
Expand Down
2 changes: 1 addition & 1 deletion header/ptrerr.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This source code was published under GPL v3
*
* Copyright (C) 2017 Too-Naive
* Copyright (C) 2016-2018 Too-Naive
*
*/
//ptrerr.hpp
Expand Down
2 changes: 1 addition & 1 deletion object-runwithcode/choose.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This source code was published under GPL v3
*
* Copyright (C) 2016 Too-Naive
* Copyright (C) 2016-2018 Too-Naive
*
*/

Expand Down
20 changes: 10 additions & 10 deletions tool.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This source code was published under GPL v3
*
* Copyright (C) 2017 Too-Naive
* Copyright (C) 2016-2018 Too-Naive
*
*/

Expand Down Expand Up @@ -56,7 +56,7 @@
#define objectwebsite _T("https:\x2f\x2fgithub.com/HostsTools/Windows")
//end.

#define ConsoleTitle _T("googlehosts tool v2.2.0 Build time:Sep. 7th, '17")
#define ConsoleTitle _T("googlehosts tool v2.2.1 Build time:Jan. 17th, '18")

#define CASE(x,y) case x : y; break;
#define DEBUGCASE(x) CASE(x,___debug_point_reset(x))
Expand Down Expand Up @@ -140,7 +140,7 @@ Example:\n\
#define copyrightshow _T("\
------------------------------------------------------------\n\
Hosts Tool for Windows Console by: Too-Naive\n\
Copyright (C) 2017 @Too-Naive License:General Public License\n\
Copyright (C) 2016-2018 @Too-Naive License:General Public License\n\
------------------------------------------------------------\n")

//Global variable
Expand Down Expand Up @@ -666,7 +666,7 @@ void Func_Service_Install(bool _q){
SC_HANDLE shMang=_pNULL_,shSvc=_pNULL_;
if (_q){
_tprintf(_T(" LICENSE:General Public License\n \
Copyright (C) 2017 @Too-Naive\n\n"));
Copyright (C) 2016-2018 @Too-Naive\n\n"));
_tprintf(_T(" Bug report:[hidden] \n\t \
Or open new issue\n------------------------------------------------------\n\n"));
}
Expand Down Expand Up @@ -846,7 +846,7 @@ DWORD __stdcall NormalEntry(LPVOID){
SetCurrentDirectory(szline);
if (!bIsServiceMode){
_tprintf(_T(" LICENSE:General Public License\n%s\n\
Copyright (C) 2017 @Too-Naive\n"),welcomeShow);
Copyright (C) 2016-2018 @Too-Naive\n"),welcomeShow);
_tprintf(_T(" Project website:%s\n"),objectwebsite);
_tprintf(_T(" Bug report:[hidden] \n\t\
Or open new issue\n\n\n"));
Expand All @@ -855,7 +855,7 @@ DWORD __stdcall NormalEntry(LPVOID){
if (request_client) ___pipeopen(),___pipesendmsg(_T("\nMessage from service:\n\n"));
Func_FastPMNTS(_T("Open log file.\n"));
___checkEx(_T("LICENSE:General Public License\n"),1);
___checkEx(_T("Copyright (C) 2017 Too-Naive\n"),0);
___checkEx(_T("Copyright (C) 2016-2018 Too-Naive\n"),0);
___checkEx(_T("Bug report:[hidden]\n"),0);
___checkEx(_T(" Or open new issue.(https://github.com/HostsTools/Windows)\n"),0);
}
Expand Down Expand Up @@ -912,16 +912,16 @@ DWORD __stdcall NormalEntry(LPVOID){
throw buf1;
if (!(_=_tfopen(ReservedFile,_T("w"))))
throw ReservedFile;
while (!feof(fp)){//checking is end of file?
while (!feof(fp)){ //checking is end of file?
//to prevent print complex line
memset(szline,0,sizeof(szline));
_fgetts(szline,localbufsize,fp);
if (*szline==_T('#')) {//fast check is commit
if (_tcsstr(szline,_T("\x72\x61\x63\x61\x6c\x6a\x6b")))
break; else
if (*szline==_T('#')) { //fast check is comment
//File original hosts start
if (_tcsstr(szline,_T("googlehosts members")))
break; else
if (_tcsstr(szline,_T("\x72\x61\x63\x61\x6c\x6a\x6b")))
break; //else
// check is need ignore the commits
if (bIgnoreCommit) continue;
}
Expand Down

0 comments on commit 4abaaff

Please sign in to comment.