Skip to content

Commit 3c8e872

Browse files
committed
updates
1 parent 3c3b72e commit 3c8e872

2 files changed

Lines changed: 2 additions & 32 deletions

File tree

bin/windows/icon.ico

189 KB
Binary file not shown.

bin/windows/install.js

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { execSync, spawn } from "child_process";
88
import fs from "fs";
99
import path from "path";
1010
import os from "os";
11-
import https from "https";
1211
import { fileURLToPath } from "url";
1312
import { confirm, welcome } from "./ui.js";
1413
import { name__, repo, site } from "../../lib/meta.js";
@@ -30,7 +29,6 @@ if (
3029
const __filename = fileURLToPath(import.meta.url);
3130
const __dirname = path.dirname(__filename);
3231

33-
const ICON_URL = "https://jssc.js.org/favicon.ico";
3432
const APP_NAME = "JSSC";
3533
const EXT = ".jssc";
3634

@@ -49,6 +47,7 @@ const pkgRoot = path.resolve(__dirname, "../../");
4947
const cliPath = path.resolve(localBin, "./cli.js");
5048
const cfgPath = path.resolve(localBin, "./windows/default.justc");
5149
const vbsPath = path.resolve(localBin, "./windows/jssc.vbs");
50+
const icoPath = path.resolve(localBin, "./windows/icon.ico");
5251
const nodePath = process.execPath;
5352

5453
const ui = path.resolve(__dirname, "./ui");
@@ -58,28 +57,6 @@ function run(cmd) {
5857
execSync(cmd, { stdio: "inherit" });
5958
}
6059

61-
function downloadIcon() {
62-
return new Promise((resolve, reject) => {
63-
if (!fs.existsSync(installDir)) {
64-
fs.mkdirSync(installDir, { recursive: true });
65-
}
66-
67-
const file = fs.createWriteStream(iconPath);
68-
69-
https.get(ICON_URL, res => {
70-
if (res.statusCode !== 200) {
71-
reject(new Error("Failed to download icon"));
72-
return;
73-
}
74-
75-
res.pipe(file);
76-
file.on("finish", () => {
77-
file.close(resolve);
78-
});
79-
}).on("error", reject);
80-
});
81-
}
82-
8360
function showProgress() {
8461
return spawn("powershell", [
8562
"-NoProfile",
@@ -93,12 +70,6 @@ function showProgress() {
9370
async function setup() {
9471
const progressUI = showProgress();
9572

96-
try {
97-
await downloadIcon();
98-
} catch (err) {
99-
throw new Error('Failed to download icon:', err.message, '\n' + err.trace);
100-
}
101-
10273
let e = [false, undefined];
10374
try {
10475
fs.mkdirSync(localPkg, {
@@ -109,9 +80,8 @@ async function setup() {
10980
force: true
11081
});
11182
fs.copyFileSync(cfgPath, localCfg);
112-
fs.rmSync(cfgPath);
11383
fs.copyFileSync(vbsPath, localVbs);
114-
fs.rmSync(vbsPath);
84+
fs.copyFileSync(icoPath, iconPath);
11585

11686
const vbs = `wscript.exe \\"${localVbs}\\" \\"${nodePath}\\" \\"${cliPath}\\"`;
11787

0 commit comments

Comments
 (0)