{"id":50899265,"url":"https://github.com/webduinoio/webbit_installer","last_synced_at":"2026-06-16T01:31:36.905Z","repository":{"id":93926340,"uuid":"189141242","full_name":"webduinoio/webbit_installer","owner":"webduinoio","description":"🏗️ Installer for Web:bit Desktop Version","archived":false,"fork":false,"pushed_at":"2026-06-12T08:47:27.000Z","size":5807,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-06-12T10:22:18.864Z","etag":null,"topics":["webbit"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webduinoio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-05-29T03:06:32.000Z","updated_at":"2026-06-12T08:47:32.000Z","dependencies_parsed_at":"2023-06-25T22:29:36.896Z","dependency_job_id":null,"html_url":"https://github.com/webduinoio/webbit_installer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/webduinoio/webbit_installer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webduinoio%2Fwebbit_installer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webduinoio%2Fwebbit_installer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webduinoio%2Fwebbit_installer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webduinoio%2Fwebbit_installer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webduinoio","download_url":"https://codeload.github.com/webduinoio/webbit_installer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webduinoio%2Fwebbit_installer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34387472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["webbit"],"created_at":"2026-06-16T01:31:30.415Z","updated_at":"2026-06-16T01:31:36.899Z","avatar_url":"https://github.com/webduinoio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web:Bit 安裝版 for Windows\n\nWeb:Bit 教育版 Windows 安裝程式（x64），以現代工具鏈重新打造，\n取代 2022 年的 NW.js 舊版（`WebBitSetup.exe`，保留於本 repo 供參考）。\n\n| 元件 | 舊版（2022） | 本版 |\n|------|-------------|------|\n| 桌面框架 | NW.js 0.36.2 (win-ia32) | Electron 42 (win-x64) |\n| 打包 | 手刻 NSIS 腳本 | electron-builder → NSIS 安裝程式 |\n| 前端套件管理 | bower（已停止維護） | npm |\n| 前端建置 | gulp + gulp-uglify | esbuild + less |\n| USB 連線 | chrome.serial + node-serialport | Web Serial API（UI 內建） |\n| 韌體燒錄 | esptool.exe | esp-web-flasher（UI 內建，瀏覽器端燒錄） |\n| CH340 驅動 | NSIS 安裝時靜默執行 | 同樣保留（installer.nsh），App 選單也可手動安裝 |\n\nUI 來源為 `../simulator-bit-edu`（即雲端版 https://webbit.webduino.io/blockly/ 的原始碼），\n本版將其建置為離線可用的本地版本。與 macOS 版（`../webbit_installer_mac`）共用相同架構與程式碼。\n\n## 檔案說明\n\n```\nwebbit_installer/\n├── WebBitSetup.exe        # 【舊版】2022 NW.js 安裝程式（git-lfs，保留參考）\n├── WebBitOTA/             # 【舊版】OTA 更新檔（OTA 伺服器已停用）\n│\n├── electron/              # Electron 主程序（跨平台 Windows / macOS）\n│   ├── main.js            #   express 伺服器、視窗、Web Serial、單一實例鎖\n│   ├── menu.js            #   原生選單（zh-hant / en；Windows 含 USB 驅動安裝項目）\n│   ├── i18n.js            #   選單在地化\n│   └── preload.js         #   USB 裝置偵測（視窗標題提示）\n├── i18n/                  # 選單語系檔（en / zh-hant；簡體中文已移除）\n├── scripts/\n│   ├── build-ui.mjs       # UI 建置（取代 bower + gulp）\n│   └── mirror-simulator.mjs  # 模擬器雲端鏡像\n├── ui-deps/               # 前端相依套件（npm 取代 bower）\n├── drivers/usb_driver/    # CH340 USB 驅動（v1 開發板用）\n├── build/\n│   ├── icon.ico           # App 圖示（多解析度）\n│   └── installer.nsh      # NSIS 自訂腳本（安裝時靜默裝 CH340 驅動）\n├── app-ui/                # 建置輸出（gitignore）\n└── release/               # 安裝程式輸出（gitignore）\n    └── WebBitSetup-2.0.5-x64.exe\n```\n\n## 系統需求\n\n- **執行**：Windows 10 / 11（64 位元）\n- **建置**：Node.js 20+（macOS / Linux / Windows 皆可建置）、上層目錄需有 `simulator-bit-edu` repo\n\n## 建置步驟\n\n```bash\n# 0. 確認上層目錄已 clone simulator-bit-edu\n#    git clone https://github.com/webduinoio/simulator-bit-edu.git ../simulator-bit-edu\n\n# 1. 安裝相依套件\nnpm install\ncd ui-deps \u0026\u0026 npm install --legacy-peer-deps \u0026\u0026 cd ..\n\n# 2. 建置 UI + 鏡像模擬器\nnpm run build:all\n\n# 3.（開發）直接執行（macOS / Windows 皆可）\nnpm start\n\n# 4. 打包 Windows 安裝程式（在 macOS / Linux 上會自動下載 Windows 版 Electron 與 NSIS 工具）\nnpm run dist\n# 產出：release/WebBitSetup-2.0.5-x64.exe\n```\n\n## 安裝方式（給使用者）\n\n1. 執行 `WebBitSetup-2.0.5-x64.exe`\n2. 安裝程式會要求系統管理員權限（需要安裝到 Program Files 與 CH340 驅動）\n3. 可自選安裝路徑；安裝過程會自動靜默安裝 CH340 USB 驅動\n4. 完成後桌面與開始選單會有「Web:Bit」捷徑\n5. **未簽章**：Windows SmartScreen 可能顯示「Windows 已保護您的電腦」→\n   點「**其他資訊**」→「**仍要執行**」\n\n## 運作原理\n\n1. **離線 UI**：`build-ui.mjs` 把 `simulator-bit-edu/client/public/blockly` 的原始碼以 esbuild\n   minify 成 `dist/`、用 less 編譯樣式、把 npm 套件佈局成 bower 的 `components/` 路徑、\n   下載韌體 .bin 檔到本地（燒錄時不需網路）。\n2. **安裝版模式**：UI 啟動時 `fetch('/auth/isLogin')` 收到 404 → 自動進入安裝版模式\n   （免登入、隱藏雲端功能）。因此本地伺服器**不可**加入 SPA fallback。\n3. **USB / 韌體燒錄**：新版 UI 內建 Web Serial 與 esp-web-flasher，\n   Electron 主程序只負責 `select-serial-port` 自動選擇 Web:Bit 開發板\n   （CH340 vendorId 6790 / ESP32-S2 vendorId 12346）。\n   注意：`window.isInstalledVersion__` 必須建置為 `false`（見 build-ui.mjs patchIndexHtml）——\n   `true` 是舊版 NW.js 專用，USB 積木會改連不存在的 127.0.0.1:8080 橋接服務，導致 USB 無法執行。\n4. **USB 裝置偵測**：preload.js 透過 `navigator.serial.getPorts()` 偵測 Web:Bit 開發板插拔，\n   並在視窗標題列顯示「已偵測到 USB 裝置」（還原舊版 NW.js 的行為）。\n\n## Windows 實機測試清單\n\n本安裝程式在 macOS 上跨平台建置，**請在實際 Windows 電腦上完成以下測試**：\n\n- [ ] 執行 `WebBitSetup-2.0.5-x64.exe`，完成安裝（含 UAC 提權）\n- [ ] CH340 驅動於安裝過程自動安裝成功（裝置管理員可確認）\n- [ ] 開啟 Web:Bit：Blockly 編輯器與模擬器正常顯示\n- [ ] 斷網狀態下開啟：依然正常（離線模式）\n- [ ] 接上 Web:Bit 開發板（v1 與 v2），點 UI 右上角 USB 圖示可連線\n- [ ] 韌體更新功能可正常燒錄\n- [ ] 選單「語言」切換正常\n- [ ] 選單「資訊 → 安裝 USB 驅動程式」可手動執行驅動安裝\n- [ ] 解除安裝程式正常運作\n\n## 已知限制\n\n1. **雲端功能不可用**（與舊版安裝版相同）：登入、雲端存檔、分享連結、創意範例——\n   UI 在安裝版模式會自動隱藏這些功能\n2. **部分積木需要網路**：AI 影像辨識、Google 試算表、氣象資訊、LINE 等\n3. **未簽章**：SmartScreen 會出現警告（如需大量發布，建議購買 Windows 程式碼簽章憑證，\n   在 package.json 的 `build.win` 加入憑證設定）\n4. **韌體版本**：韌體 .bin 在建置時下載打包（目前 1.3.0_0525_01），\n   更新韌體版本需重新執行 `npm run build:ui` 並重新打包\n5. **僅支援 64 位元 Windows**：如需 32 位元，需在 `build.win.target.arch` 加入 `ia32`\n   （但 Electron 對 ia32 的支援已逐步淘汰，不建議）\n6. **OTA 自動更新未實作**：舊版的 ota.webduino.io 伺服器已停用；\n   如需自動更新可改用 electron-updater + GitHub Releases\n\n## 與其他 repo 的關係\n\n- **`../webbit_installer_mac`**：macOS 版（相同架構、共用程式碼）；\n  修改 electron/ 或 scripts/ 時請同步兩邊\n- **`../simulator-bit-edu`**：UI 原始碼；改完後重新執行 `npm run build:ui`\n- **`../webbit-desktop`**：舊版 NW.js 原始碼（已不再使用，保留參考）\n- **`WebBitSetup.exe`（本 repo 根目錄）**：舊版安裝程式，保留供舊專案參考\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebduinoio%2Fwebbit_installer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebduinoio%2Fwebbit_installer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebduinoio%2Fwebbit_installer/lists"}