Skip to content

Commit 9a1bebc

Browse files
committed
Update to VC Redist 2022 (17)
1 parent 243eb88 commit 9a1bebc

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src-opam/windows.ml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ let run_vc ~arch fmt =
2828
match arch with
2929
| `I386 -> "x86"
3030
| `X86_64 -> "amd64"
31-
| `Aarch64 | `Aarch32 | `Ppc64le | `S390x | `Riscv64 ->
32-
invalid_arg "Unsupported architecture"
31+
| _ -> invalid_arg "Unsupported architecture"
3332
in
3433
ksprintf
3534
(run {|cd C:\BuildTools\VC\Auxiliary\Build && vcvarsall.bat %s && %s|} arch)
@@ -41,15 +40,26 @@ let run_ocaml_env args fmt =
4140
let cleanup t = t @@ run_powershell {|Remove-Item 'C:\TEMP' -Recurse|} |> crunch
4241

4342
(* VC redist is needed to run WinGet. *)
44-
let install_vc_redist ?(vs_version = "16") () =
43+
let install_vc_redist ?(vs_version = "17") ?(arch = `X86_64) () =
44+
let arch =
45+
match arch with
46+
| `I386 -> "x86"
47+
| `X86_64 -> "x64"
48+
| `Aarch64 -> "arm64"
49+
| _ -> invalid_arg "Unsupported architecture"
50+
in
4551
add
46-
~src:[ "https://aka.ms/vs/" ^ vs_version ^ "/release/vc_redist.x64.exe" ]
52+
~src:
53+
[
54+
sprintf "https://aka.ms/vs/%s/release/vc_redist.%s.exe" vs_version arch;
55+
]
4756
~dst:{|C:\TEMP\|} ()
4857
@@ run
49-
{|C:\TEMP\vc_redist.x64.exe /install /passive /norestart /log C:\TEMP\vc_redist.log|}
58+
{|C:\TEMP\vc_redist.%s.exe /install /passive /norestart /log C:\TEMP\vc_redist.log|}
59+
arch
5060
|> cleanup
5161

52-
let install_visual_studio_build_tools ?(vs_version = "16") components =
62+
let install_visual_studio_build_tools ?(vs_version = "17") components =
5363
let install =
5464
let fmt =
5565
format_of_string

src-opam/windows.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ val sanitize_reg_path : unit -> t
5151
/usr/bin/bash: -c: line 1: syntax error: unexpected end of file
5252
v} |}]
5353

54-
val install_vc_redist : ?vs_version:string -> unit -> t
54+
val install_vc_redist : ?vs_version:string -> ?arch:Ocaml_version.arch -> unit -> t
5555
(** Install Microsoft Visual C++ Redistributable.
5656
@see <https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads> *)
5757

0 commit comments

Comments
 (0)