Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix(windows): install the ARM64 VC runtime instead of detecting the x64 one

Minh14112062d237b2cb3f
diff --git a/.github/workflows/template-tauri-build-windows-arm64.yml b/.github/workflows/template-tauri-build-windows-arm64.yml
index 72f9f2eb9..d63616d6a 100644
--- a/.github/workflows/template-tauri-build-windows-arm64.yml
+++ b/.github/workflows/template-tauri-build-windows-arm64.yml
@@ -147,7 +147,7 @@ jobs:
- name: Replace Icons for Beta Build
if: env.CHANNEL != 'stable'
shell: bash
- run: cp .github/scripts/icon-${CHANNEL}.png src-tauri/icons/icon.png
+ run: cp ".github/scripts/icon-${CHANNEL}.png" src-tauri/icons/icon.png
- name: Installing node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
@@ -389,6 +389,16 @@ jobs:
# Left unpatched, an ARM64 install fetches and runs the x64 redist.
$c = $c.Replace('vc_redist.x64.exe', 'vc_redist.arm64.exe')
+ # And the matching detection, which is the half that actually bites:
+ # the VC runtime registers per architecture, and an ARM64 machine
+ # almost always carries the x64 redist for emulated apps. Probing the
+ # x64 keys therefore finds it, concludes the runtime is present, and
+ # skips installing the ARM64 one the app links against. Guessing wrong
+ # the other way merely re-runs an idempotent installer -- it exits 1638
+ # and the script already treats that as success.
+ $c = $c.Replace('\VC\Runtimes\x64', '\VC\Runtimes\arm64')
+ $c = $c.Replace('VC_RuntimeMinimumVSU_amd64', 'VC_RuntimeMinimumVSU_arm64')
+
$base, $build = $env:NEW_VERSION, $env:NEW_VERSION
if ($env:NEW_VERSION -match '^([^-]+)-(?:rc(\d+)-beta|(.+))$') {
$base = $Matches[1]
diff --git a/scripts/download-bin.mjs b/scripts/download-bin.mjs
index 244379ca5..9cceae490 100644
--- a/scripts/download-bin.mjs
+++ b/scripts/download-bin.mjs
@@ -263,6 +263,9 @@ async function main() {
if (platform === 'win32') {
copyFile(
path.join(binDir, 'bun.exe'),
+ // uvPlatform, not bunPlatform: tauri resolves an externalBin by rust
+ // target triple, which is the spelling uv happens to use and bun does
+ // not (bun ships windows-aarch64, tauri wants aarch64-pc-windows-msvc).
path.join(binDir, `bun-${uvPlatform}.exe`),
(err) => {
if (err) {