-
Notifications
You must be signed in to change notification settings - Fork 616
fix(windows): Fix npm wrapper scripts for Windows #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,26 @@ | ||||||||||||
| @echo off | ||||||||||||
| setlocal | ||||||||||||
|
|
||||||||||||
| :: Detect architecture | ||||||||||||
| set "ARCH=x64" | ||||||||||||
| if "%PROCESSOR_ARCHITECTURE%"=="ARM64" set "ARCH=arm64" | ||||||||||||
| if "%PROCESSOR_ARCHITECTURE%"=="x86" ( | ||||||||||||
| if not defined PROCESSOR_ARCHITEW6432 set "ARCH=x86" | ||||||||||||
| ) | ||||||||||||
|
Comment on lines
+7
to
+9
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Windows 32-bit detection sets ARCH=x86 but no agent-browser-win32-x86.exe binary is built, causing npm install to fail on 32-bit Windows systems |
||||||||||||
|
|
||||||||||||
| :: Get script directory | ||||||||||||
| set "SCRIPT_DIR=%~dp0" | ||||||||||||
| node "%SCRIPT_DIR%..\dist\index.js" %* | ||||||||||||
|
|
||||||||||||
| :: Path to the Windows binary | ||||||||||||
| set "BINARY=%SCRIPT_DIR%agent-browser-win32-%ARCH%.exe" | ||||||||||||
|
|
||||||||||||
| :: Check if binary exists | ||||||||||||
| if not exist "%BINARY%" ( | ||||||||||||
| echo Error: agent-browser binary not found at %BINARY% >&2 | ||||||||||||
| echo Run 'npm install' to download the binary, or 'npm run build:native' to build it locally. >&2 | ||||||||||||
|
Comment on lines
+19
to
+20
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Invalid stderr redirection syntax >&2 in Windows batch file that doesn't support Unix-style redirection |
||||||||||||
| exit /b 1 | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| :: Run the binary with all arguments | ||||||||||||
| "%BINARY%" %* | ||||||||||||
| exit /b %errorlevel% | ||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows ARM64 architecture detection attempts to load non-existent agent-browser-win32-arm64.exe binary, causing npm install to fail on ARM64 Windows machines