@flun/windows 3.0.5 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -13
- package/README.md +22 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
# 变更日志
|
|
2
|
+
## [3.0.6] - 2026-07-06 15:31
|
|
3
|
+
|
|
4
|
+
### 新增
|
|
5
|
+
- 在 README 中新增“配置”章节,指导用户通过 `allowScripts` 显式放行本包的安装脚本,避免因 `ignore-scripts` 全局配置导致钩子被跳过。
|
|
2
6
|
## [3.0.5] - 2026-06-16 20:09
|
|
3
7
|
### 变更
|
|
4
|
-
- 联系邮箱更改为:open@flun.top;
|
|
5
|
-
## [3.0.0] - 2026-5-28 21:40
|
|
6
|
-
### 破坏性变更
|
|
7
|
-
- 移除 `sudo: { enabled: false }` 配置项,现在内部自动检查 sudo 可用性并默认使用提权方式,不再支持显式关闭。
|
|
8
|
-
|
|
9
|
-
### 修复
|
|
10
|
-
- 修复 Windows 服务环境下 `os.homedir()` 返回系统目录(如 `C:\Windows\System32\config\systemprofile`)而非当前用户目录的问题
|
|
11
|
-
现在在生成服务 XML 配置时,会自动将安装服务时的当前用户 `USERPROFILE` 注入到服务进程的环境变量中,使得 `os.homedir()` 正确返回用户目录,从而解决依赖用户目录的证书续期等业务路径错误的问题;
|
|
12
|
-
|
|
13
|
-
### 优化
|
|
14
|
-
- 简化 `#xml` getter 中的环境变量处理逻辑,自动合并用户自定义的 `env` 配置,仅在未显式设置 `USERPROFILE` 时追加正确的用户目录;
|
|
15
|
-
- 简化内部提权判断逻辑,统一使用 `sudo`作为默认(若可用), `elevate` 次之作为提权方式。
|
|
16
|
-
- 删除了一些没有使用的导出等一些细节优化;
|
|
8
|
+
- 联系邮箱更改为:open@flun.top;
|
package/README.md
CHANGED
|
@@ -33,6 +33,27 @@
|
|
|
33
33
|
|
|
34
34
|
Windows 上的原生 Node 模块安装复杂,通常需要 Visual Studio 和 node-gyp 进行编译;@flun/windows **不依赖任何原生模块**,所有二进制工具均已预打包,无需安装 Visual Studio 等编译环境;
|
|
35
35
|
|
|
36
|
+
## 配置
|
|
37
|
+
|
|
38
|
+
### 允许安装脚本执行
|
|
39
|
+
|
|
40
|
+
本包在安装时可能触发某些依赖包的自动脚本(如 `postinstall` 等);如果你的 npm 全局配置或项目配置禁止了脚本执行(例如设置了 `ignore-scripts=true`),可能会导致安装不完整或运行时异常;
|
|
41
|
+
|
|
42
|
+
推荐在项目根目录的 `package.json` 中添加 `allowScripts` 字段,显式放行本包及其依赖的脚本:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"allowScripts": {
|
|
47
|
+
"@flun/windows": true
|
|
48
|
+
// 如果依赖的其他包(如 bcrypt、electron-winstaller 等)也有脚本,请按需添加,格式相同
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
> 如果你信任所有安装包,也可以直接在项目 `.npmrc` 中设置 `allow-scripts = false`(表示关闭脚本拦截,所有脚本均允许执行),或删除/设为 `ignore-scripts = false`;
|
|
54
|
+
|
|
55
|
+
配置后,再次运行 `npm install` 即可正常执行所有安装钩子;
|
|
56
|
+
|
|
36
57
|
---
|
|
37
58
|
|
|
38
59
|
# Windows 服务管理
|
|
@@ -356,5 +377,4 @@ kill(进程PID, () => {
|
|
|
356
377
|
|
|
357
378
|
# 许可证
|
|
358
379
|
|
|
359
|
-
winsw 和 sudowin 遵循各自所有者的许可证;@flun/windows 核心代码采用 ISC 许可证(具体内容请见许可证文档)
|
|
360
|
-
```
|
|
380
|
+
winsw 和 sudowin 遵循各自所有者的许可证;@flun/windows 核心代码采用 ISC 许可证(具体内容请见许可证文档)
|