Browse Source

处理 Windows 系统安装在非 C 盘的情况。 #128

oldj 9 years ago
parent
commit
0b24a215f3
5 changed files with 76 additions and 56 deletions
  1. 72 52
      app/build/bundle.js
  2. 1 1
      app/package.json
  3. 1 1
      app/src/libs/paths.js
  4. 1 1
      app/version.js
  5. 1 1
      package.json

File diff suppressed because it is too large
+ 72 - 52
app/build/bundle.js


+ 1 - 1
app/package.json

@@ -1,6 +1,6 @@
 {
   "name": "SwitchHosts!",
-  "version": "3.2.0",
+  "version": "3.2.1",
   "description": "Switch hosts quickly!",
   "main": "main.js",
   "scripts": {},

+ 1 - 1
app/src/libs/paths.js

@@ -9,7 +9,7 @@ const path = require('path');
 const util = require('./util');
 const platform = process.platform;
 const sys_host_path = platform == 'win32' ?
-    'C:\\WINDOWS\\system32\\drivers\\etc\\hosts' : // todo 处理系统没有安装在 C 盘的情况
+    `${process.env.windir}\\system32\\drivers\\etc\\hosts` : // Windows 系统有可能不安装在 C 盘
     '/etc/hosts';
 const home_path = util.getUserHome();
 const work_path = path.join(home_path, '.SwitchHosts');

+ 1 - 1
app/version.js

@@ -1 +1 @@
-exports.version = [3,2,0,4178];
+exports.version = [3,2,1,4180];

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "switchhosts",
-  "version": "3.2.0",
+  "version": "3.2.1",
   "description": "Homepage: [https://oldj.github.io/SwitchHosts/](https://oldj.github.io/SwitchHosts/)",
   "main": "",
   "scripts": {

Some files were not shown because too many files changed in this diff