pinokiod 3.4.26 → 3.4.28
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/kernel/bin/index.js +3 -2
- package/kernel/bin/vs.js +33 -19
- package/package.json +1 -1
- package/script/index.js +1 -0
- package/server/index.js +22 -21
package/kernel/bin/index.js
CHANGED
|
@@ -507,7 +507,7 @@ class Bin {
|
|
|
507
507
|
// await this.mod(name).rm({}, ondata)
|
|
508
508
|
// await this.mod(name).install(options, ondata)
|
|
509
509
|
//}
|
|
510
|
-
async tryInstall(requirement, i, total, ondata) {
|
|
510
|
+
async tryInstall(requirement, x, i, total, ondata) {
|
|
511
511
|
let current_platform = os.platform()
|
|
512
512
|
let current_arch = os.arch()
|
|
513
513
|
let current_gpu = this.kernel.gpu
|
|
@@ -566,6 +566,7 @@ class Bin {
|
|
|
566
566
|
const message = `${m.mod.description ? '<br>' + m.mod.description : ''}`
|
|
567
567
|
ondata({ html: `<b><i class="fas fa-circle-notch fa-spin"></i> ${progress} Installing ${name}</b>${message}` }, "notify2")
|
|
568
568
|
console.log("## Before m.mod.install", requirement)
|
|
569
|
+
requirement._attempt = x
|
|
569
570
|
await m.mod.install(requirement, ondata, this.kernel)
|
|
570
571
|
|
|
571
572
|
// // 2 second delay to fix conda issue
|
|
@@ -617,7 +618,7 @@ class Bin {
|
|
|
617
618
|
console.log("already installed. skip.")
|
|
618
619
|
} else {
|
|
619
620
|
console.log("not installed. install.")
|
|
620
|
-
await this.tryInstall(requirement, i, requirements.length, ondata)
|
|
621
|
+
await this.tryInstall(requirement, x, i, requirements.length, ondata)
|
|
621
622
|
}
|
|
622
623
|
}
|
|
623
624
|
|
package/kernel/bin/vs.js
CHANGED
|
@@ -7,6 +7,38 @@ class VS {
|
|
|
7
7
|
async install(req, ondata) {
|
|
8
8
|
// 3. Run installer
|
|
9
9
|
if (os.release().startsWith("10")) {
|
|
10
|
+
|
|
11
|
+
ondata({ raw: `[0] VS Installation Attempt ${req._attempt}\r\n` })
|
|
12
|
+
let attempt = req._attempt;
|
|
13
|
+
console.log("VS Installation attempt " + attempt)
|
|
14
|
+
|
|
15
|
+
// 1. wait 3 seconds
|
|
16
|
+
// 2. check installed
|
|
17
|
+
// 3. if NOT installed, j
|
|
18
|
+
|
|
19
|
+
if (attempt > 0) {
|
|
20
|
+
let WARNING = `<div><div>[NOTICE] Visual Studio install step keeps repeating?</div>
|
|
21
|
+
<ol style="padding-inline-start:20px">
|
|
22
|
+
<li>Launch <b>Visual Studio Installer</b> on Windows</li>
|
|
23
|
+
<li>Find <b>Visual Studio Build Tools 2019</b> and <b>Uninstall</b></li>
|
|
24
|
+
<li>And relaunch Pinokio</li>
|
|
25
|
+
</ol></div>`
|
|
26
|
+
/*
|
|
27
|
+
ondata({
|
|
28
|
+
raw: `\r\n\x1b[33m${WARNING}\x1b[0m\r\n\r\n`
|
|
29
|
+
})
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
let html = `<div>
|
|
33
|
+
<img src="/vsinstaller.gif">
|
|
34
|
+
<div style="padding:5px; font-size:12px">${WARNING}</div>
|
|
35
|
+
</div>`
|
|
36
|
+
ondata({
|
|
37
|
+
html,
|
|
38
|
+
// href: <link location to open>,
|
|
39
|
+
}, "notify")
|
|
40
|
+
}
|
|
41
|
+
|
|
10
42
|
// Download installer
|
|
11
43
|
const installer_url = "https://github.com/cocktailpeanut/bin/releases/download/vs_buildtools/vs_buildtools.exe"
|
|
12
44
|
const installer = "vs_buildtools.exe"
|
|
@@ -23,26 +55,8 @@ class VS {
|
|
|
23
55
|
ondata(stream)
|
|
24
56
|
})
|
|
25
57
|
ondata({ raw: `Install finished\r\n\r\n` })
|
|
26
|
-
let WARNING = `<div><div>[NOTICE] Visual Studio install step keeps repeating?</div>
|
|
27
|
-
<ol style="padding-inline-start:20px">
|
|
28
|
-
<li>Launch <b>Visual Studio Installer</b> on Windows</li>
|
|
29
|
-
<li>Find <b>Visual Studio Build Tools 2019</b> and <b>Uninstall</b></li>
|
|
30
|
-
<li>And relaunch Pinokio</li>
|
|
31
|
-
</ol></div>`
|
|
32
|
-
/*
|
|
33
|
-
ondata({
|
|
34
|
-
raw: `\r\n\x1b[33m${WARNING}\x1b[0m\r\n\r\n`
|
|
35
|
-
})
|
|
36
|
-
*/
|
|
37
58
|
|
|
38
|
-
|
|
39
|
-
<img src="/vsinstaller.gif">
|
|
40
|
-
<div style="padding:5px; font-size:12px">${WARNING}</div>
|
|
41
|
-
</div>`
|
|
42
|
-
ondata({
|
|
43
|
-
html,
|
|
44
|
-
// href: <link location to open>,
|
|
45
|
-
}, "notify")
|
|
59
|
+
|
|
46
60
|
return this.kernel.bin.rm(installer, ondata)
|
|
47
61
|
} else {
|
|
48
62
|
ondata({ raw: `Must be Windows 10 or above\r\n` })
|
package/package.json
CHANGED
package/script/index.js
CHANGED
package/server/index.js
CHANGED
|
@@ -2101,27 +2101,28 @@ class Server {
|
|
|
2101
2101
|
if (options && options.port) {
|
|
2102
2102
|
this.port = options.port
|
|
2103
2103
|
} else {
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
const
|
|
2111
|
-
const
|
|
2112
|
-
|
|
2113
|
-
// const
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2104
|
+
this.port = 42000
|
|
2105
|
+
// let platform = os.platform()
|
|
2106
|
+
// if (platform === 'linux') {
|
|
2107
|
+
// // on linux you are not allowed to listen on ports below 1024
|
|
2108
|
+
// this.port = 42000
|
|
2109
|
+
// } else {
|
|
2110
|
+
// const primary_port = 80
|
|
2111
|
+
// const secondary_port = 42000
|
|
2112
|
+
// const available = await Util.is_port_available(primary_port)
|
|
2113
|
+
// //const running = await Util.is_port_running(primary_port)
|
|
2114
|
+
//// const running1 = await Util.port_running("localhost", primary_port)
|
|
2115
|
+
//// const running2 = await Util.port_running("127.0.0.1", primary_port)
|
|
2116
|
+
//// const running = running1 || running2
|
|
2117
|
+
//// const available = !running
|
|
2118
|
+
// //const available = await portfinder.isAvailablePromise({ host: "0.0.0.0", port: primary_port })
|
|
2119
|
+
// console.log("check available", { primary_port, available })
|
|
2120
|
+
// if (available) {
|
|
2121
|
+
// this.port = primary_port
|
|
2122
|
+
// } else {
|
|
2123
|
+
// this.port = secondary_port
|
|
2124
|
+
// }
|
|
2125
|
+
// }
|
|
2125
2126
|
}
|
|
2126
2127
|
|
|
2127
2128
|
console.log("available port", this.port)
|