pinokiod 3.3.37 → 3.3.39

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.
Files changed (2) hide show
  1. package/kernel/bin/vs.js +24 -13
  2. package/package.json +1 -1
package/kernel/bin/vs.js CHANGED
@@ -6,24 +6,30 @@ class VS {
6
6
  description = "Look for a dialog requesting admin permission and approve it to proceed. This will install Microsoft visual studio build tools, which is required for building several python wheels."
7
7
  async install(req, ondata) {
8
8
 
9
- // 2. Download installer
10
- const installer_url = "https://github.com/cocktailpeanut/bin/releases/download/vs_buildtools/vs_buildtools.exe"
11
- const installer = "vs_buildtools.exe"
12
- ondata({ raw: `downloading installer: ${installer_url}...\r\n` })
13
- await this.kernel.bin.download(installer_url, installer, ondata)
14
-
15
- // 2.1. Try uninstalling first
16
- ondata({ raw: `uninstalling existing vs 2019 in case corrupt...\r\n` })
17
- await this.uninstall(req, ondata)
18
9
 
19
10
  // 3. Run installer
20
11
  if (os.release().startsWith("10")) {
21
- ondata({ raw: `running installer: ${installer}...\r\n` })
12
+
13
+ // Download installer
14
+ const installer_url = "https://github.com/cocktailpeanut/bin/releases/download/vs_buildtools/vs_buildtools.exe"
15
+ const installer = "vs_buildtools.exe"
16
+ ondata({ raw: `[1] downloading installer: ${installer_url}...\r\n\r\n` })
17
+ await this.kernel.bin.download(installer_url, installer, ondata)
18
+
19
+ ondata({ raw: `[2] uninstalling existing vs 2019 in case corrupt...\r\n\r\n` })
20
+ await this.uninstall(req, ondata)
21
+
22
+ ondata({ raw: `[3] running installer: ${installer}...\r\n\r\n` })
22
23
  const cmd = this.cmd("install")
23
24
  await this.kernel.bin.exec({ sudo: true, message: cmd, }, (stream) => {
24
25
  ondata(stream)
25
26
  })
26
- ondata({ raw: `Install finished\r\n` })
27
+ ondata({ raw: `[4] updating...\r\n\r\n` })
28
+ const cmd2 = this.cmd("update")
29
+ await this.kernel.bin.exec({ sudo: true, message: cmd2, }, (stream) => {
30
+ ondata(stream)
31
+ })
32
+ ondata({ raw: `Install finished\r\n\r\n` })
27
33
  return this.kernel.bin.rm(installer, ondata)
28
34
  } else {
29
35
  ondata({ raw: `Must be Windows 10 or above\r\n` })
@@ -270,8 +276,13 @@ class VS {
270
276
  const filename = this.kernel.bin.path("vs_buildtools.exe")
271
277
  let items = ["Microsoft.VisualStudio.Workload.VCTools"]
272
278
  let add = items.map((item) => { return `--add ${item}` }).join(" ")
273
- let cmd = `start /wait ${filename} ${mode === 'uninstall' ? mode: ''} --passive --wait --includeRecommended --nocache ${add} --channelId VisualStudio.16.Release`
274
- return cmd
279
+ if (mode === "repair") {
280
+ let cmd = `start /wait ${filename} ${mode} --passive --wait --nocache`
281
+ return cmd
282
+ } else {
283
+ let cmd = `start /wait ${filename} ${mode === 'uninstall' ? mode: ''} --passive --wait --includeRecommended --nocache ${add}`
284
+ return cmd
285
+ }
275
286
  }
276
287
  }
277
288
  module.exports = VS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.3.37",
3
+ "version": "3.3.39",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {