From 4abaaff06d4710302b7e6d9f0cd9e5d81afb26a7 Mon Sep 17 00:00:00 2001 From: Too-Naive Date: Wed, 17 Jan 2018 01:25:38 +0800 Subject: [PATCH] Bug fixed * Change copyright year --- README.md | 32 +++++++++++++++++--------------- header/diff.hpp | 2 +- header/download.hpp | 2 +- header/pipedebug.hpp | 2 +- header/ptrerr.hpp | 2 +- object-runwithcode/choose.cpp | 2 +- tool.cpp | 20 ++++++++++---------- 7 files changed, 32 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index bf0e449..08dfd5a 100644 --- a/README.md +++ b/README.md @@ -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 --------|------------------- @@ -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? @@ -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 diff --git a/header/diff.hpp b/header/diff.hpp index 2ad16e9..736032b 100644 --- a/header/diff.hpp +++ b/header/diff.hpp @@ -1,7 +1,7 @@ /* * This source code was published under GPL v3 * - * Copyright (C) 2017 Too-Naive + * Copyright (C) 2016-2018 Too-Naive * */ diff --git a/header/download.hpp b/header/download.hpp index 367de95..0f48e35 100644 --- a/header/download.hpp +++ b/header/download.hpp @@ -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) diff --git a/header/pipedebug.hpp b/header/pipedebug.hpp index b07ff08..760149a 100644 --- a/header/pipedebug.hpp +++ b/header/pipedebug.hpp @@ -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 diff --git a/header/ptrerr.hpp b/header/ptrerr.hpp index e2b4415..93adb5c 100644 --- a/header/ptrerr.hpp +++ b/header/ptrerr.hpp @@ -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 diff --git a/object-runwithcode/choose.cpp b/object-runwithcode/choose.cpp index 173d2c4..6407681 100644 --- a/object-runwithcode/choose.cpp +++ b/object-runwithcode/choose.cpp @@ -1,7 +1,7 @@ /* * This source code was published under GPL v3 * - * Copyright (C) 2016 Too-Naive + * Copyright (C) 2016-2018 Too-Naive * */ diff --git a/tool.cpp b/tool.cpp index 2b9301e..69f7fbf 100644 --- a/tool.cpp +++ b/tool.cpp @@ -1,7 +1,7 @@ /* * This source code was published under GPL v3 * - * Copyright (C) 2017 Too-Naive + * Copyright (C) 2016-2018 Too-Naive * */ @@ -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)) @@ -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 @@ -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")); } @@ -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")); @@ -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); } @@ -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; }