vanspod 0.3.2 → 0.4.1
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/README.md +4 -4
- package/dist/classroomApp.js +198 -52
- package/dist/clientDetection.js +4 -2
- package/dist/commandRunner.js +9 -2
- package/dist/environmentIcons.js +3 -2
- package/dist/environmentInstallLog.js +51 -0
- package/dist/environmentProgress.js +27 -0
- package/dist/officialDownloads.js +115 -0
- package/dist/officialInstaller.js +158 -0
- package/dist/page.js +77 -11
- package/dist/pagePrototype.js +1 -1
- package/dist/start.js +48 -31
- package/dist/systemPath.js +53 -0
- package/dist/version.js +1 -1
- package/dist/windowsEnvironment.js +193 -0
- package/dist/windowsEnvironmentSystem.js +201 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ npm run dist
|
|
|
38
38
|
npm pack --pack-destination dist
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
exe 產物為 `dist/VansPod.exe`,本機套件為 `dist/vanspod-0.
|
|
41
|
+
exe 產物為 `dist/VansPod.exe`,本機套件為 `dist/vanspod-0.4.1.tgz`;可在 Windows 用 `npm install -g <套件路徑>` 安裝測試。圖片、favicon、系統匣與移除腳本均包含在發佈產物中。更新 logo 後執行 `powershell.exe -NoProfile -File scripts/build-icon.ps1` 重建多尺寸 Windows icon。
|
|
42
42
|
|
|
43
43
|
exe 發佈管道為本專案 GitHub Releases,npm 為公開 registry 的 [`vanspod`](https://www.npmjs.com/package/vanspod) 套件。更新時不要執行完整移除,否則會清除課堂資料。
|
|
44
44
|
|
|
@@ -46,12 +46,12 @@ exe 發佈管道為本專案 GitHub Releases,npm 為公開 registry 的 [`vans
|
|
|
46
46
|
|
|
47
47
|
一般 push 不發佈;推送 `v*` tag 會在 Windows runner 安裝 Node.js 24、檢查型別、執行測試、打包並驗證 exe/npm 生命週期,全部通過後才建立 GitHub Release,最後發佈 npm 套件。學生從 Release 下載 `VansPod.exe`,同頁提供 `SHA256SUMS.txt`。
|
|
48
48
|
|
|
49
|
-
發版前同步 `package.json`、`package-lock.json` 與 `src/version.ts` 的版本;tag 必須等於 `v` 加版本號,否則流程失敗。以 `0.
|
|
49
|
+
發版前同步 `package.json`、`package-lock.json` 與 `src/version.ts` 的版本;tag 必須等於 `v` 加版本號,否則流程失敗。以 `0.4.1` 為例:
|
|
50
50
|
|
|
51
51
|
```powershell
|
|
52
52
|
git push origin master
|
|
53
|
-
git tag -a v0.
|
|
54
|
-
git push origin v0.
|
|
53
|
+
git tag -a v0.4.1 -m "VansPod 0.4.1"
|
|
54
|
+
git push origin v0.4.1
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
新版本使用新的版本號與 tag。相同 tag 的 Actions 重跑會更新該 Release 的產物。
|
package/dist/classroomApp.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ClassroomApp = exports.COPIED_KEY_NOTICE = exports.ENVIRONMENT_TOOLS = void 0;
|
|
3
|
+
exports.ClassroomApp = exports.COPIED_KEY_NOTICE = exports.ENVIRONMENT_LABEL = exports.ENVIRONMENT_TOOLS = void 0;
|
|
4
4
|
const secureStorage_1 = require("./secureStorage");
|
|
5
5
|
const storageErrors_1 = require("./storageErrors");
|
|
6
6
|
const adapterSettings_1 = require("./adapterSettings");
|
|
@@ -8,17 +8,18 @@ const clientRoutes_1 = require("./clientRoutes");
|
|
|
8
8
|
const node_util_1 = require("node:util");
|
|
9
9
|
const courseCatalog_1 = require("./courseCatalog");
|
|
10
10
|
const modelProxy_1 = require("./modelProxy");
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
// 新工具加在最後,不改既有 id。
|
|
12
|
+
exports.ENVIRONMENT_TOOLS = ["uv", "git", "node", "pwsh", "vscode"];
|
|
13
|
+
exports.ENVIRONMENT_LABEL = {
|
|
13
14
|
uv: "uv",
|
|
14
15
|
git: "git",
|
|
15
16
|
node: "Node.js",
|
|
16
17
|
pwsh: "PowerShell 7",
|
|
18
|
+
vscode: "VS Code",
|
|
17
19
|
};
|
|
18
20
|
const LOCAL_LIST_NOTE = "這是本機清單。";
|
|
19
21
|
exports.COPIED_KEY_NOTICE = "已複製 Classroom API Key。請勿分享給不信任的人。";
|
|
20
22
|
const INSTALL_UNAVAILABLE = "尚未指定專案資料夾,安裝不可用。";
|
|
21
|
-
const REOPEN_TERMINAL = "請重開終端機再重新檢查。";
|
|
22
23
|
const ENVIRONMENT_ABORTED = "已中止安裝。系統安裝程式可能仍在執行,請等待結束或稍後重新安裝。";
|
|
23
24
|
const PROXY_CLIENTS = ["codex", "claude", "copilot"];
|
|
24
25
|
class ClassroomApp {
|
|
@@ -64,14 +65,17 @@ class ClassroomApp {
|
|
|
64
65
|
set mode(mode) { this.clientModes = { codex: mode, claude: mode }; }
|
|
65
66
|
modelIds = [];
|
|
66
67
|
modelProviders = [];
|
|
67
|
-
|
|
68
|
-
uv: false,
|
|
69
|
-
git: false,
|
|
70
|
-
node: false,
|
|
71
|
-
pwsh: false,
|
|
72
|
-
};
|
|
68
|
+
environmentReadiness = {};
|
|
73
69
|
environmentSelected = new Set();
|
|
70
|
+
// 每次學生改勾選就加一;檢查開始後學生改過,檢查結束就不覆蓋他的勾選。
|
|
71
|
+
environmentSelectionEdits = 0;
|
|
72
|
+
environmentCheck;
|
|
73
|
+
// 任何一次檢查開始過就為真:啟動時的背景檢查只跑一次,學生已按過「重新檢查」也不再補跑。
|
|
74
|
+
initialEnvironmentCheckStarted = false;
|
|
74
75
|
environmentNotice;
|
|
76
|
+
environmentLog;
|
|
77
|
+
// 背景 Environment Install 進行中才有:這次要裝的每個工具目前的階段。
|
|
78
|
+
environmentProgress;
|
|
75
79
|
proxyRunning = false;
|
|
76
80
|
mustRestart = [];
|
|
77
81
|
modelRestart = [];
|
|
@@ -109,6 +113,7 @@ class ClassroomApp {
|
|
|
109
113
|
adapters: { ...this.adapters },
|
|
110
114
|
adapterNotice: this.adapterNotice,
|
|
111
115
|
tools: this.environmentTools(),
|
|
116
|
+
environmentInstalling: this.environmentProgress !== undefined,
|
|
112
117
|
};
|
|
113
118
|
if (this.connectionError)
|
|
114
119
|
view.connectionError = this.connectionError;
|
|
@@ -169,6 +174,9 @@ class ClassroomApp {
|
|
|
169
174
|
if (this.mode === "classroom" && this.modelIds[0]) {
|
|
170
175
|
view.modelId = this.modelIds[0];
|
|
171
176
|
}
|
|
177
|
+
if (this.environmentLog) {
|
|
178
|
+
view.environmentLogFolder = this.environmentLog.folder;
|
|
179
|
+
}
|
|
172
180
|
if (this.environmentNotice) {
|
|
173
181
|
view.environmentNotice = this.environmentNotice;
|
|
174
182
|
}
|
|
@@ -196,73 +204,188 @@ class ClassroomApp {
|
|
|
196
204
|
vsCodeChat: { ...this.clientRoutes.vsCodeChat },
|
|
197
205
|
};
|
|
198
206
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
207
|
+
/** 檢查全部工具的 Environment Tool Readiness;已有檢查在跑就等它,不重複探測。 */
|
|
208
|
+
checkEnvironment() {
|
|
209
|
+
if (this.environmentCheck)
|
|
210
|
+
return this.environmentCheck;
|
|
211
|
+
if (this.commandRunning)
|
|
212
|
+
return Promise.resolve();
|
|
213
|
+
this.initialEnvironmentCheckStarted = true;
|
|
214
|
+
const edits = this.environmentSelectionEdits;
|
|
215
|
+
const check = (async () => {
|
|
205
216
|
try {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
217
|
+
await this.probeAllEnvironmentTools();
|
|
218
|
+
// 檢查期間學生自己改過勾選,就保留他的選擇。
|
|
219
|
+
if (this.environmentSelectionEdits === edits)
|
|
220
|
+
this.selectNotReadyEnvironmentTools();
|
|
221
|
+
// 學生在 VansPod 外裝好 VS Code,按「重新檢查」也讓 VS Code Chat 跟著可用。
|
|
222
|
+
if (this.environmentReadiness.vscode?.readiness === "ready")
|
|
223
|
+
await this.redetectVsCodeChat();
|
|
224
|
+
}
|
|
225
|
+
finally {
|
|
226
|
+
this.environmentCheck = undefined;
|
|
227
|
+
}
|
|
228
|
+
})();
|
|
229
|
+
this.environmentCheck = check;
|
|
230
|
+
return check;
|
|
231
|
+
}
|
|
232
|
+
/** 每次檢查後的預設勾選:未就緒(未安裝或需要修復)的工具。 */
|
|
233
|
+
selectNotReadyEnvironmentTools() {
|
|
234
|
+
this.environmentSelected = new Set(exports.ENVIRONMENT_TOOLS.filter((id) => {
|
|
235
|
+
const checked = this.environmentReadiness[id];
|
|
236
|
+
return checked !== undefined && checked.readiness !== "ready";
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
239
|
+
async probeAllEnvironmentTools() {
|
|
240
|
+
await Promise.all(exports.ENVIRONMENT_TOOLS.map((tool) => this.probeEnvironmentTool(tool)));
|
|
241
|
+
}
|
|
242
|
+
async probeEnvironmentTool(tool) {
|
|
243
|
+
let readiness;
|
|
244
|
+
try {
|
|
245
|
+
readiness = await this.deps.environment.probe(tool);
|
|
212
246
|
}
|
|
247
|
+
catch {
|
|
248
|
+
readiness = { readiness: "missing" };
|
|
249
|
+
}
|
|
250
|
+
this.environmentReadiness[tool] = readiness;
|
|
251
|
+
return readiness;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* 安裝後的驗證:environment 已經驗證過就採用它的結果,每個工具只檢查一次。
|
|
255
|
+
* 安裝程式要求重新開機、工具還不能用時算「需要修復」:裝過了,重新開機後再檢查(US32)。
|
|
256
|
+
*/
|
|
257
|
+
async verifyInstalledTool(tool, result) {
|
|
258
|
+
let verified = result?.verified ?? await this.probeEnvironmentTool(tool);
|
|
259
|
+
if (result?.rebootRequired && verified.readiness === "missing")
|
|
260
|
+
verified = { ...verified, readiness: "needsRepair" };
|
|
261
|
+
this.environmentReadiness[tool] = verified;
|
|
262
|
+
return verified;
|
|
213
263
|
}
|
|
214
264
|
selectEnvironment(tools) {
|
|
215
265
|
if (this.commandRunning) {
|
|
216
266
|
return;
|
|
217
267
|
}
|
|
268
|
+
this.environmentSelectionEdits += 1;
|
|
218
269
|
this.environmentSelected = new Set(exports.ENVIRONMENT_TOOLS.filter((id) => tools.includes(id)));
|
|
219
270
|
}
|
|
271
|
+
/** Environment Install:開發工具與 Project Folder 無關,沒選資料夾也能安裝。 */
|
|
220
272
|
async confirmEnvironment() {
|
|
221
|
-
if (this.stopping || this.commandRunning
|
|
273
|
+
if (this.stopping || this.commandRunning) {
|
|
222
274
|
return;
|
|
223
275
|
}
|
|
224
276
|
const selected = exports.ENVIRONMENT_TOOLS.filter((id) => this.environmentSelected.has(id));
|
|
225
277
|
if (selected.length === 0) {
|
|
226
278
|
return;
|
|
227
279
|
}
|
|
228
|
-
|
|
280
|
+
// 頁面請求不等安裝結束(見 start.ts 的 POST /environment);commandRunning 在整段背景安裝期間保持為真,
|
|
281
|
+
// exit guard、版本更新與移除都靠它詢問是否中止。
|
|
229
282
|
this.commandRunning = true;
|
|
230
283
|
this.environmentNotice = undefined;
|
|
284
|
+
const progress = {};
|
|
285
|
+
for (const tool of selected)
|
|
286
|
+
progress[tool] = { stage: "waiting" };
|
|
287
|
+
this.environmentProgress = progress;
|
|
231
288
|
const abort = this.beginInstall();
|
|
232
|
-
|
|
289
|
+
const rebootSuggested = [];
|
|
290
|
+
const failures = [];
|
|
233
291
|
try {
|
|
292
|
+
// 啟動時的背景檢查還沒結束就先等它,避免檢查與安裝後的驗證互相覆蓋。
|
|
293
|
+
if (this.environmentCheck)
|
|
294
|
+
await this.environmentCheck;
|
|
295
|
+
await this.startEnvironmentLog();
|
|
234
296
|
for (const tool of selected) {
|
|
297
|
+
if (abort.signal.aborted)
|
|
298
|
+
break;
|
|
299
|
+
// 輪到這個工具:先是「準備中」,environment 開始下載或啟動安裝程式時再回報下載中、安裝中。
|
|
300
|
+
progress[tool] = { stage: "preparing" };
|
|
301
|
+
const report = (reported) => {
|
|
302
|
+
if (abort.signal.aborted)
|
|
303
|
+
return;
|
|
304
|
+
progress[tool] = { ...reported };
|
|
305
|
+
};
|
|
235
306
|
let result;
|
|
236
307
|
try {
|
|
237
|
-
result = await this.deps.environment.install(tool,
|
|
308
|
+
result = await this.deps.environment.install(tool, abort.signal, report);
|
|
238
309
|
}
|
|
239
310
|
catch {
|
|
240
|
-
|
|
311
|
+
result = undefined;
|
|
241
312
|
}
|
|
242
|
-
if (abort.signal.aborted
|
|
313
|
+
if (abort.signal.aborted) {
|
|
243
314
|
break;
|
|
244
315
|
}
|
|
245
|
-
|
|
316
|
+
// 安裝程式的結束碼只產生提示;裝好與否以立刻重新驗證為準。
|
|
317
|
+
// 驗證會讀登錄檔裡最新的 PATH,剛裝好的工具不必重開 VansPod 就看得到。
|
|
318
|
+
progress[tool] = { stage: "verifying" };
|
|
319
|
+
const verified = await this.verifyInstalledTool(tool, result);
|
|
320
|
+
await this.environmentLog?.verified(tool, verified).catch(() => { });
|
|
321
|
+
if (verified.readiness === "ready") {
|
|
322
|
+
progress[tool] = { stage: "done" };
|
|
323
|
+
if (result?.rebootRequired)
|
|
324
|
+
rebootSuggested.push(tool);
|
|
325
|
+
if (tool === "vscode")
|
|
326
|
+
await this.redetectVsCodeChat();
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
// 單一工具失敗不中斷後續工具;結果列出每個失敗的工具與原因。
|
|
330
|
+
progress[tool] = { stage: "failed" };
|
|
331
|
+
failures.push(environmentInstallFailure(exports.ENVIRONMENT_LABEL[tool], result, verified));
|
|
332
|
+
}
|
|
333
|
+
if (abort.signal.aborted) {
|
|
334
|
+
// 中止後重新檢查全部工具,畫面顯示實際狀態(ADR-0008);仍算在這次安裝裡。
|
|
335
|
+
await this.probeAllEnvironmentTools();
|
|
336
|
+
this.selectNotReadyEnvironmentTools();
|
|
246
337
|
}
|
|
247
338
|
}
|
|
248
339
|
finally {
|
|
340
|
+
this.environmentProgress = undefined;
|
|
249
341
|
this.endInstall();
|
|
250
342
|
this.commandRunning = false;
|
|
251
343
|
}
|
|
252
344
|
if (abort.signal.aborted) {
|
|
253
|
-
await this.checkEnvironment();
|
|
254
345
|
this.environmentNotice = ENVIRONMENT_ABORTED;
|
|
346
|
+
await this.environmentLog?.finish("已中止").catch(() => { });
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
const notices = [];
|
|
350
|
+
if (rebootSuggested.length > 0) {
|
|
351
|
+
notices.push(`${rebootSuggested.map((tool) => exports.ENVIRONMENT_LABEL[tool]).join("、")} 已就緒,建議重新開機。`);
|
|
352
|
+
}
|
|
353
|
+
notices.push(...failures);
|
|
354
|
+
this.environmentNotice = notices.length > 0 ? notices.join("") : undefined;
|
|
355
|
+
// 安裝後的驗證也算一次檢查:再按「確認安裝」只處理仍未就緒的工具。
|
|
356
|
+
this.selectNotReadyEnvironmentTools();
|
|
357
|
+
await this.environmentLog?.finish(this.environmentNotice ?? "完成").catch(() => { });
|
|
358
|
+
}
|
|
359
|
+
/** 每次 Environment Install 開一份新紀錄;紀錄開不了也照常安裝。 */
|
|
360
|
+
async startEnvironmentLog() {
|
|
361
|
+
try {
|
|
362
|
+
this.environmentLog = await this.deps.environment.startLog?.();
|
|
363
|
+
}
|
|
364
|
+
catch {
|
|
365
|
+
this.environmentLog = undefined;
|
|
255
366
|
}
|
|
256
|
-
|
|
257
|
-
|
|
367
|
+
}
|
|
368
|
+
/** 結果畫面「開啟紀錄資料夾」:開啟最近一次安裝的紀錄資料夾。 */
|
|
369
|
+
async openEnvironmentLog() {
|
|
370
|
+
if (!this.environmentLog) {
|
|
371
|
+
return;
|
|
258
372
|
}
|
|
373
|
+
await this.deps.environment.openLogFolder?.(this.environmentLog.folder);
|
|
374
|
+
}
|
|
375
|
+
/** 「開啟 VS Code」只在 VS Code 已就緒時有效;有 Project Folder 就直接開那個資料夾。 */
|
|
376
|
+
async openVsCode() {
|
|
377
|
+
if (this.environmentReadiness.vscode?.readiness !== "ready") {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
await this.deps.environment.openVsCode?.(this.projectFolder);
|
|
259
381
|
}
|
|
260
382
|
environmentTools() {
|
|
261
383
|
return exports.ENVIRONMENT_TOOLS.map((id) => ({
|
|
262
384
|
id,
|
|
263
|
-
label: ENVIRONMENT_LABEL[id],
|
|
264
|
-
|
|
385
|
+
label: exports.ENVIRONMENT_LABEL[id],
|
|
386
|
+
...(this.environmentReadiness[id] ?? { readiness: "checking" }),
|
|
265
387
|
selected: this.environmentSelected.has(id),
|
|
388
|
+
...(this.environmentProgress?.[id] ? { progress: { ...this.environmentProgress[id] } } : {}),
|
|
266
389
|
}));
|
|
267
390
|
}
|
|
268
391
|
async copilotRequest(selection) {
|
|
@@ -1263,15 +1386,29 @@ class ClassroomApp {
|
|
|
1263
1386
|
catch { /* The visible red state remains authoritative. */ }
|
|
1264
1387
|
}
|
|
1265
1388
|
}
|
|
1389
|
+
/** VS Code 剛就緒:只重新偵測 VS Code Chat 並啟動它的 Client Route,其他 Client Route 不動。 */
|
|
1390
|
+
async redetectVsCodeChat() {
|
|
1391
|
+
// 還沒啟動或正在停止就不碰 Client Route;啟動中的初始偵測先跑完,避免重複啟動路由。
|
|
1392
|
+
if (this.stopping || !this.initialization)
|
|
1393
|
+
return;
|
|
1394
|
+
await this.initialization.catch(() => undefined);
|
|
1395
|
+
if (this.stopping || this.detectedClients.vsCodeChat)
|
|
1396
|
+
return;
|
|
1397
|
+
await this.detectClient("vsCodeChat");
|
|
1398
|
+
if (this.detectedClients.vsCodeChat)
|
|
1399
|
+
await this.startVsCodeRoute();
|
|
1400
|
+
}
|
|
1266
1401
|
async detectClients() {
|
|
1267
|
-
await Promise.all(["codex", "claude", "vsCodeChat"].map(
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1402
|
+
await Promise.all(["codex", "claude", "vsCodeChat"].map(client => this.detectClient(client)));
|
|
1403
|
+
}
|
|
1404
|
+
/** 偵測失敗就當作沒裝。 */
|
|
1405
|
+
async detectClient(client) {
|
|
1406
|
+
try {
|
|
1407
|
+
this.detectedClients[client] = await this.deps.detectClient?.(client) ?? false;
|
|
1408
|
+
}
|
|
1409
|
+
catch {
|
|
1410
|
+
this.detectedClients[client] = false;
|
|
1411
|
+
}
|
|
1275
1412
|
}
|
|
1276
1413
|
async reloadAllowlistNow() {
|
|
1277
1414
|
if (!this.connected)
|
|
@@ -1581,7 +1718,14 @@ class ClassroomApp {
|
|
|
1581
1718
|
await this.startClaudeCodeRoute();
|
|
1582
1719
|
await this.startVsCodeRoute();
|
|
1583
1720
|
})();
|
|
1584
|
-
|
|
1721
|
+
try {
|
|
1722
|
+
await this.initialization;
|
|
1723
|
+
}
|
|
1724
|
+
finally {
|
|
1725
|
+
// 連線與路由恢復後才在背景檢查一次開發工具,不和啟動時的客戶端偵測搶資源,也不擋住啟動。
|
|
1726
|
+
if (!this.initialEnvironmentCheckStarted)
|
|
1727
|
+
void this.checkEnvironment();
|
|
1728
|
+
}
|
|
1585
1729
|
this.deps.proxy.start();
|
|
1586
1730
|
this.proxyRunning = true;
|
|
1587
1731
|
if (!this.routeRestartNoted) {
|
|
@@ -1770,15 +1914,17 @@ class ClassroomApp {
|
|
|
1770
1914
|
}
|
|
1771
1915
|
}
|
|
1772
1916
|
exports.ClassroomApp = ClassroomApp;
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1917
|
+
/** 安裝後驗證未通過時的提示;安裝程式要求重新開機時,請學生重開機後再檢查。 */
|
|
1918
|
+
function environmentInstallFailure(label, result, verified) {
|
|
1919
|
+
const rejected = result?.failure
|
|
1920
|
+
? `${result.failure},`
|
|
1921
|
+
: result?.exitAccepted === false && result.exitCode !== undefined
|
|
1922
|
+
? `安裝失敗(結束碼 ${result.exitCode}),`
|
|
1923
|
+
: "";
|
|
1924
|
+
const state = verified.readiness === "missing" ? "安裝後仍偵測不到" : "安裝後仍需要修復";
|
|
1925
|
+
const reason = verified.reason ? `:${verified.reason}` : "";
|
|
1926
|
+
const next = result?.rebootRequired ? "請重新開機後按「重新檢查」。" : "請稍後按「重新檢查」。";
|
|
1927
|
+
return `${label} ${rejected}${state}${reason}。${next}`;
|
|
1782
1928
|
}
|
|
1783
1929
|
function usableCatalogYaml(value) {
|
|
1784
1930
|
if (typeof value !== "string" || value.trim() === "") {
|
package/dist/clientDetection.js
CHANGED
|
@@ -6,9 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.detectClient = detectClient;
|
|
7
7
|
const node_child_process_1 = require("node:child_process");
|
|
8
8
|
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
9
|
-
|
|
9
|
+
const systemPath_1 = require("./systemPath");
|
|
10
|
+
async function succeeds(command, args) {
|
|
11
|
+
const env = await (0, systemPath_1.envWithRegistryPath)();
|
|
10
12
|
return new Promise(resolve => {
|
|
11
|
-
(0, node_child_process_1.execFile)(command, args, { timeout: 8000, windowsHide: true, maxBuffer: 64 * 1024 }, error => resolve(!error));
|
|
13
|
+
(0, node_child_process_1.execFile)(command, args, { env, timeout: 8000, windowsHide: true, maxBuffer: 64 * 1024 }, error => resolve(!error));
|
|
12
14
|
});
|
|
13
15
|
}
|
|
14
16
|
/** Detect a usable CLI, or a running/installed Codex desktop app; no model API call. */
|
package/dist/commandRunner.js
CHANGED
|
@@ -4,9 +4,16 @@ exports.collectOutput = collectOutput;
|
|
|
4
4
|
exports.shellLaunch = shellLaunch;
|
|
5
5
|
exports.runCommand = runCommand;
|
|
6
6
|
const node_child_process_1 = require("node:child_process");
|
|
7
|
+
const systemPath_1 = require("./systemPath");
|
|
7
8
|
const ABORTED_NOTICE = "\n已中止。\n";
|
|
8
9
|
const ABORT_GRACE_MS = 5000;
|
|
9
|
-
function collectOutput(command, args, cwd, onOutput, signal
|
|
10
|
+
async function collectOutput(command, args, cwd, onOutput, signal,
|
|
11
|
+
/** 呼叫端已讀過登錄檔 PATH 時傳入,省下一次 PowerShell。 */
|
|
12
|
+
baseEnv) {
|
|
13
|
+
const env = baseEnv ?? await (0, systemPath_1.envWithRegistryPath)();
|
|
14
|
+
// 讀 PATH 期間學生可能已經按了停止;這時不要再啟動指令。
|
|
15
|
+
if (signal?.aborted)
|
|
16
|
+
return { exitCode: undefined, output: "", spawnError: false, aborted: true };
|
|
10
17
|
return new Promise((resolve) => {
|
|
11
18
|
let settled = false;
|
|
12
19
|
let aborted = false;
|
|
@@ -19,7 +26,7 @@ function collectOutput(command, args, cwd, onOutput, signal) {
|
|
|
19
26
|
};
|
|
20
27
|
const child = (0, node_child_process_1.spawn)(command, args, {
|
|
21
28
|
cwd,
|
|
22
|
-
env: { ...
|
|
29
|
+
env: { ...env, PYTHONUTF8: "1", PYTHONIOENCODING: "utf-8" },
|
|
23
30
|
windowsHide: process.platform === "win32",
|
|
24
31
|
// A process group lets abort reach grandchildren such as servers started by uv.
|
|
25
32
|
detached: process.platform !== "win32",
|
package/dist/environmentIcons.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.environmentIcons = void 0;
|
|
4
4
|
// Brand icons from https://github.com/simple-icons/simple-icons (CC0-1.0).
|
|
5
|
-
// PowerShell from 11.15.0; other icons from develop.
|
|
5
|
+
// PowerShell from 11.15.0; VS Code (visualstudiocode) from 7.21.0, before it was removed; other icons from develop.
|
|
6
6
|
exports.environmentIcons = {
|
|
7
7
|
"uv": "<svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m0 .1058.0504 11.9496.0403 9.5597c.0055 1.3199 1.08 2.3854 2.4 2.3798l9.5596-.0403 5.9749-.0252.6075-.0026c1.316-.0056 2.3799-1.0963 2.3799-2.4123h1.0946v2.3894L24 23.9042 23.8992.005 12.9056.0513l.0463 9.5245v5.9637h-1.9583L11.04 9.584 10.9936.0594Z\"/></svg>",
|
|
8
8
|
"git": "<svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M13.09 23.549a1.54 1.54 0 0 1-2.18 0L.451 13.089a1.54 1.54 0 0 1 0-2.179l7.191-7.19 2.733 2.733a1.85 1.85 0 0 0 .964 2.326v6.66a1.849 1.849 0 1 0 1.54 0V8.957l2.508 2.508a1.85 1.85 0 1 0 1.09-1.09l-2.634-2.634a1.85 1.85 0 0 0-2.378-2.377L8.73 2.63 10.91.451a1.54 1.54 0 0 1 2.179 0l10.459 10.46a1.54 1.54 0 0 1 0 2.179z\"/></svg>",
|
|
9
9
|
"node": "<svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383 c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076 c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0 L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392 c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021 c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921 c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603 v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z M19.099,13.993 c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233 c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081 c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833 c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402 c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253 c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z\"/></svg>",
|
|
10
|
-
"pwsh": "<svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M23.181 2.974c.568 0 .923.463.792 1.035l-3.659 15.982c-.13.572-.697 1.035-1.265 1.035H.819c-.568 0-.923-.463-.792-1.035L3.686 4.009c.13-.572.697-1.035 1.265-1.035zm-8.375 9.346c.251-.394.227-.905-.09-1.243L9.122 5.125c-.38-.404-1.037-.407-1.466-.003-.429.402-.468 1.056-.088 1.46l4.662 4.96v.11l-7.42 5.374c-.45.327-.533.977-.187 1.453.346.476.991.597 1.44.27l8.229-5.91c.28-.196.438-.365.514-.52zm-2.796 4.399a.928.928 0 00-.934.923c0 .51.418.923.934.923h4.433a.928.928 0 00.934-.923.928.928 0 00-.934-.923z\"/></svg>"
|
|
10
|
+
"pwsh": "<svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M23.181 2.974c.568 0 .923.463.792 1.035l-3.659 15.982c-.13.572-.697 1.035-1.265 1.035H.819c-.568 0-.923-.463-.792-1.035L3.686 4.009c.13-.572.697-1.035 1.265-1.035zm-8.375 9.346c.251-.394.227-.905-.09-1.243L9.122 5.125c-.38-.404-1.037-.407-1.466-.003-.429.402-.468 1.056-.088 1.46l4.662 4.96v.11l-7.42 5.374c-.45.327-.533.977-.187 1.453.346.476.991.597 1.44.27l8.229-5.91c.28-.196.438-.365.514-.52zm-2.796 4.399a.928.928 0 00-.934.923c0 .51.418.923.934.923h4.433a.928.928 0 00.934-.923.928.928 0 00-.934-.923z\"/></svg>",
|
|
11
|
+
"vscode": "<svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M23.15 2.587L18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 20.06V3.939a1.5 1.5 0 0 0-.85-1.352zm-5.146 14.861L10.826 12l7.178-5.448v10.896z\"/></svg>"
|
|
11
12
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.KEPT_INSTALL_LOGS = void 0;
|
|
7
|
+
exports.startInstallLogFile = startInstallLogFile;
|
|
8
|
+
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
+
/** 只保留最近幾次 Environment Install 的紀錄,避免佔滿學生硬碟。 */
|
|
11
|
+
exports.KEPT_INSTALL_LOGS = 10;
|
|
12
|
+
function stamp(date) {
|
|
13
|
+
const two = (value) => String(value).padStart(2, "0");
|
|
14
|
+
return `${date.getFullYear()}-${two(date.getMonth() + 1)}-${two(date.getDate())}_${two(date.getHours())}${two(date.getMinutes())}${two(date.getSeconds())}`;
|
|
15
|
+
}
|
|
16
|
+
async function createRunFolder(root, name) {
|
|
17
|
+
await promises_1.default.mkdir(root, { recursive: true });
|
|
18
|
+
for (let attempt = 1;; attempt += 1) {
|
|
19
|
+
const folder = node_path_1.default.join(root, attempt === 1 ? name : `${name}-${attempt}`);
|
|
20
|
+
try {
|
|
21
|
+
await promises_1.default.mkdir(folder);
|
|
22
|
+
return folder;
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
if (error.code !== "EEXIST")
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async function pruneOldLogs(root) {
|
|
31
|
+
const entries = await promises_1.default.readdir(root, { withFileTypes: true });
|
|
32
|
+
// 資料夾名稱以時間開頭,字串排序就是時間順序。
|
|
33
|
+
const folders = entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort();
|
|
34
|
+
const old = folders.slice(0, Math.max(0, folders.length - exports.KEPT_INSTALL_LOGS));
|
|
35
|
+
await Promise.all(old.map((name) => promises_1.default.rm(node_path_1.default.join(root, name), { recursive: true, force: true }).catch(() => { })));
|
|
36
|
+
}
|
|
37
|
+
/** 在 <managementDirectory>\InstallLogs 下建立本次安裝的紀錄資料夾,並刪掉超過保留數量的舊紀錄。 */
|
|
38
|
+
async function startInstallLogFile(managementDirectory, now) {
|
|
39
|
+
const root = node_path_1.default.join(managementDirectory, "InstallLogs");
|
|
40
|
+
const folder = await createRunFolder(root, stamp(now));
|
|
41
|
+
await pruneOldLogs(root).catch(() => { });
|
|
42
|
+
const file = node_path_1.default.join(folder, "install.log");
|
|
43
|
+
let pending = Promise.resolve();
|
|
44
|
+
return {
|
|
45
|
+
folder,
|
|
46
|
+
append(text) {
|
|
47
|
+
pending = pending.then(() => promises_1.default.appendFile(file, text, "utf8")).catch(() => { });
|
|
48
|
+
return pending;
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.environmentProgressScript = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* 背景 Environment Install 的進度輪詢:頁面帶 data-environment-progress 時,每 500ms 讀 /environment-status
|
|
6
|
+
* 更新每個工具的階段文字;安裝結束就重新整理頁面顯示結果。狀態在伺服器上,重新整理頁面後照樣接著輪詢。
|
|
7
|
+
*/
|
|
8
|
+
exports.environmentProgressScript = `
|
|
9
|
+
(function () {
|
|
10
|
+
if (!document.querySelector("[data-environment-progress]")) return;
|
|
11
|
+
async function poll() {
|
|
12
|
+
try {
|
|
13
|
+
var response = await fetch("/environment-status", { cache: "no-store" });
|
|
14
|
+
if (!response.ok) throw new Error("status unavailable");
|
|
15
|
+
var status = await response.json();
|
|
16
|
+
if (!status.running) { window.location.reload(); return; }
|
|
17
|
+
status.tools.forEach(function (tool) {
|
|
18
|
+
document.querySelectorAll('[data-environment-stage="' + tool.id + '"]').forEach(function (stage) {
|
|
19
|
+
stage.textContent = tool.stage;
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
} catch (error) {}
|
|
23
|
+
setTimeout(poll, 500);
|
|
24
|
+
}
|
|
25
|
+
setTimeout(poll, 500);
|
|
26
|
+
})();
|
|
27
|
+
`;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.vsCodeInstaller = vsCodeInstaller;
|
|
4
|
+
exports.lookupDownload = lookupDownload;
|
|
5
|
+
exports.wingetToolInstaller = wingetToolInstaller;
|
|
6
|
+
const classroomApp_1 = require("./classroomApp");
|
|
7
|
+
/** Authenticode 簽署者憑證主體裡的組織(O=)必須完全是這個名字。 */
|
|
8
|
+
function signedBy(organization) {
|
|
9
|
+
const escaped = organization.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
10
|
+
return new RegExp(`(?:^|,\\s*)O=${escaped}(?:,|$)`);
|
|
11
|
+
}
|
|
12
|
+
const MICROSOFT_SIGNER = signedBy("Microsoft Corporation");
|
|
13
|
+
const OPENJS_SIGNER = signedBy("OpenJS Foundation");
|
|
14
|
+
// Git for Windows 由維護者 Johannes Schindelin 個人簽署,不是「Git for Windows」。
|
|
15
|
+
const GIT_FOR_WINDOWS_SIGNER = signedBy("Johannes Schindelin");
|
|
16
|
+
/** VS Code User 版:裝在學生自己的帳號下,不需要系統管理員;不自動啟動,等驗證完由學生開啟。 */
|
|
17
|
+
function vsCodeInstaller(architecture, setupLog) {
|
|
18
|
+
return {
|
|
19
|
+
label: classroomApp_1.ENVIRONMENT_LABEL.vscode,
|
|
20
|
+
url: `https://update.code.visualstudio.com/latest/win32-${architecture}-user/stable`,
|
|
21
|
+
fileName: `VSCodeUserSetup-${architecture}.exe`,
|
|
22
|
+
signer: MICROSOFT_SIGNER,
|
|
23
|
+
launch: (installer) => ({
|
|
24
|
+
command: installer,
|
|
25
|
+
// 參數不加引號:Node 會替含空白的參數整個加上引號,Inno Setup 解析時去掉。
|
|
26
|
+
args: [
|
|
27
|
+
"/VERYSILENT",
|
|
28
|
+
"/SUPPRESSMSGBOXES",
|
|
29
|
+
"/NORESTART",
|
|
30
|
+
"/MERGETASKS=desktopicon,addcontextmenufiles,addcontextmenufolders,addtopath,!runcode",
|
|
31
|
+
`/LOG=${setupLog}`,
|
|
32
|
+
],
|
|
33
|
+
}),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const NODE_INDEX_URL = "https://nodejs.org/dist/index.json";
|
|
37
|
+
const GITHUB_LATEST = {
|
|
38
|
+
git: {
|
|
39
|
+
url: "https://api.github.com/repos/git-for-windows/git/releases/latest",
|
|
40
|
+
asset: { x64: /^Git-\d[\d.]*-64-bit\.exe$/, arm64: /^Git-\d[\d.]*-arm64\.exe$/ },
|
|
41
|
+
},
|
|
42
|
+
pwsh: {
|
|
43
|
+
url: "https://api.github.com/repos/PowerShell/PowerShell/releases/latest",
|
|
44
|
+
asset: { x64: /^PowerShell-\d[\d.]*-win-x64\.msi$/, arm64: /^PowerShell-\d[\d.]*-win-arm64\.msi$/ },
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
/** 查詢官方來源的 JSON;失敗時回傳學生看得懂、可以重試的原因。 */
|
|
48
|
+
async function fetchLatest(system, label, url, signal) {
|
|
49
|
+
let response;
|
|
50
|
+
try {
|
|
51
|
+
response = await system.fetchJson(url, { signal });
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
if (signal?.aborted)
|
|
55
|
+
return { aborted: true };
|
|
56
|
+
return { failure: `查詢 ${label} 最新版本失敗:${error instanceof Error ? error.message : String(error)},請稍後再按重試` };
|
|
57
|
+
}
|
|
58
|
+
if (signal?.aborted)
|
|
59
|
+
return { aborted: true };
|
|
60
|
+
if ((response.status === 403 || response.status === 429) && url.startsWith("https://api.github.com/")) {
|
|
61
|
+
// 未驗證的 GitHub API 每個對外 IP 每小時 60 次;教室共用 IP 時容易用完(ADR-0011)。
|
|
62
|
+
return { failure: `查詢 ${label} 最新版本失敗:GitHub 查詢次數已達上限(同一個網路每小時 60 次),請稍後再按重試` };
|
|
63
|
+
}
|
|
64
|
+
if (response.status !== 200)
|
|
65
|
+
return { failure: `查詢 ${label} 最新版本失敗(HTTP ${response.status}),請稍後再按重試` };
|
|
66
|
+
return { body: response.body };
|
|
67
|
+
}
|
|
68
|
+
/** 沒有 winget 時,找出官方最新穩定版(Node.js 為 LTS)安裝檔的下載網址。 */
|
|
69
|
+
async function lookupDownload(system, tool, architecture, signal) {
|
|
70
|
+
const label = classroomApp_1.ENVIRONMENT_LABEL[tool];
|
|
71
|
+
const missing = { failure: `找不到 ${label} 的 ${architecture} 安裝檔,請稍後再按重試` };
|
|
72
|
+
if (tool === "node") {
|
|
73
|
+
const latest = await fetchLatest(system, label, NODE_INDEX_URL, signal);
|
|
74
|
+
if (!("body" in latest))
|
|
75
|
+
return latest;
|
|
76
|
+
const releases = Array.isArray(latest.body) ? latest.body : [];
|
|
77
|
+
// index.json 由新到舊排列;第一個 lts 為真的就是最新 LTS。
|
|
78
|
+
const version = releases.find((release) => release?.lts && typeof release.version === "string" && /^v\d+\.\d+\.\d+$/.test(release.version))?.version;
|
|
79
|
+
if (!version)
|
|
80
|
+
return missing;
|
|
81
|
+
const fileName = `node-${version}-${architecture}.msi`;
|
|
82
|
+
return { download: { url: `https://nodejs.org/dist/${version}/${fileName}`, fileName } };
|
|
83
|
+
}
|
|
84
|
+
const source = GITHUB_LATEST[tool];
|
|
85
|
+
const latest = await fetchLatest(system, label, source.url, signal);
|
|
86
|
+
if (!("body" in latest))
|
|
87
|
+
return latest;
|
|
88
|
+
const assets = latest.body?.assets;
|
|
89
|
+
const asset = (Array.isArray(assets) ? assets : []).find((candidate) => typeof candidate?.name === "string" && source.asset[architecture].test(candidate.name) && typeof candidate.browser_download_url === "string");
|
|
90
|
+
if (!asset)
|
|
91
|
+
return missing;
|
|
92
|
+
return { download: { url: asset.browser_download_url, fileName: asset.name } };
|
|
93
|
+
}
|
|
94
|
+
/** 官方安裝檔:Git 是 Inno Setup,Node.js 與 PowerShell 是 MSI;全部靜默、不自動重新開機,並寫安裝器自己的 log。 */
|
|
95
|
+
function wingetToolInstaller(tool, download, setupLog) {
|
|
96
|
+
const base = { label: classroomApp_1.ENVIRONMENT_LABEL[tool], url: download.url, fileName: download.fileName };
|
|
97
|
+
if (tool === "git") {
|
|
98
|
+
return {
|
|
99
|
+
...base,
|
|
100
|
+
signer: GIT_FOR_WINDOWS_SIGNER,
|
|
101
|
+
launch: (installer) => ({
|
|
102
|
+
command: installer,
|
|
103
|
+
args: ["/VERYSILENT", "/NORESTART", "/NOCANCEL", "/SP-", "/SUPPRESSMSGBOXES", `/LOG=${setupLog}`],
|
|
104
|
+
}),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
...base,
|
|
109
|
+
signer: tool === "node" ? OPENJS_SIGNER : MICROSOFT_SIGNER,
|
|
110
|
+
launch: (installer) => ({
|
|
111
|
+
command: "msiexec",
|
|
112
|
+
args: ["/i", installer, "/qn", "/norestart", ...(tool === "pwsh" ? ["ADD_PATH=1"] : []), "/L*v", setupLog],
|
|
113
|
+
}),
|
|
114
|
+
};
|
|
115
|
+
}
|