OEM Device Manager Customization and Packaging
Hardware manufacturers, system integrators, and OEM teams can build a custom-branded Windows device management application on top of the MIT-licensed CDM_OEM UI layer—customizing the application name, company identity, logo and icon, theme color, support link, and visible tabs without writing device protocol code from scratch. Using a desktop AI coding tool, you can paste a single prompt to set up the local environment, customize the interface, and compile a standalone .exe installer or portable package automatically.
Before You Start
No programming background is required, and you do not need to manually install Python or Git beforehand:
1. Install a Desktop AI Coding Tool
Install and open any desktop AI tool capable of editing local folders and running terminal commands (enable Agent / Builder mode):
| Region | Official Desktop AI Tools | Agent Mode Toggle |
|---|---|---|
| International | Cursor, VS Code (GitHub Copilot), Claude Code, or Codex CLI | Select Agent mode in the chat panel (or run the CLI agent in the folder) |
| Mainland China | Trae CN, Lingma IDE, Baidu Comate, or Tencent CodeBuddy (direct connection, no proxy needed) | Switch the right-hand chat panel to Builder / SOLO or Agent / Craft mode |
Do not use browser-only chat tabs (such as web ChatGPT, DeepSeek web, or Doubao web), as web pages cannot directly modify local folders or compile Windows executables on your PC.
2. Prepare a Working Folder (Optional Logo Image)
- Create an empty folder on a 64-bit Windows 10 / 11 PC (a short ASCII path such as
D:\MyCDMis recommended). You can either let the AI download theCDM-0.9.0source archive automatically in Step 2, or extract theCDM-0.9.0.ziparchive from the button above intoD:\MyCDM. - If you have a company or product logo image (
.svg,.png, or.jpg, ideally square), place it directly insideD:\MyCDM—the AI will convert it into both the window.icoicon and the header logo automatically.
Build Your Custom Package in 3 Steps
Step 1: Open the Working Folder in Your AI Tool
Launch your desktop AI coding tool, click Open Folder (File -> Open Folder), select D:\MyCDM, and make sure the chat panel is set to Agent / Builder mode (for CLI tools, cd D:\MyCDM in PowerShell and launch the agent).
Step 2: Paste the One-Shot Prompt into AI
Click the copy button in the top-right corner of the block below, paste it into your AI chat box, replace the bracketed [...] placeholders with your own brand details, and press Enter:
Please customize and package an OEM device management application in this folder end-to-end by executing these steps directly:
1. If cdm-runtime.lock.json is not yet in the current directory, download the CANmeleon CDM_OEM CDM-0.9.0 source archive (use https://github.com/CANmeleon/canmeleon-device-manager/archive/refs/tags/CDM-0.9.0.zip , or https://gitee.com/canmeleon/canmeleon-device-manager/archive/refs/tags/CDM-0.9.0.zip in Mainland China), extract it, and move all files from the inner folder to the current root directory. Read AGENTS.md, docs/oem-development.md, and docs/cli-api.md first.
2. (If running on a Mainland China network where PyPI is slow, set $env:PIP_INDEX_URL = 'https://pypi.tuna.tsinghua.edu.cn/simple' first.) Run powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\setup.ps1 to prepare the project-local Python 3.12.10 environment and download/verify the pinned CDM 0.9.0 runtime (do not modify global Python, requirements.lock, or cdm-runtime.lock.json).
3. Update oem/branding.json with my brand details:
- Application display name (name): [e.g. Acme CAN Manager]
- Publisher / company identifier (publisher): [e.g. Acme Corp]
- Brand accent color (theme_color, 6-digit hex): [e.g. #0052CC]
- Show online firmware check controls (online_firmware): [true to keep online check, or false for offline-only firmware import]
- Help button URL (help_url): [your support URL, or leave empty to hide the button]
- Generate a distinct ASCII product_id matching [A-Za-z][A-Za-z0-9_.-]+ (replace the demo value) and a fresh GUID for app_id.
4. Assets and UI customization: If I placed an image in the current folder, use PySide6 in .venv\Scripts\python.exe to generate a clean square header logo and oem/icon.ico inside oem/ and reference them in branding.json; if no image was provided, generate a clean oem/logo.svg and matching oem/icon.ico using my product name and theme color (note: build.ps1 copies only branding.json, logo, and icon into oem/). Additional UI changes: [e.g. Keep the default clean layout; or describe changes such as "add technical support email support@example.com to the Help dialog" while keeping all UI strings bilingual in Chinese and English and keeping all device operations on the public CLI].
5. Run .venv\Scripts\python.exe -m pytest -q and confirm tests pass (update corresponding UI tests if intentional page or text customizations affect default assertions).
6. Compile and package (if the Windows temp path contains non-ASCII characters, set $env:CDM_OEM_BUILD_ROOT = 'C:\cdm-oem-build' first):
- Run powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\build.ps1 to build the standalone compiled folder (if no C++ compiler is installed and downloading winlibs from GitHub times out, install Microsoft Visual Studio C++ Build Tools via winget install Microsoft.VisualStudio.2022.BuildTools --accept-package-agreements --accept-source-agreements --override "--quiet --wait --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended" and re-run build.ps1), and also zip the verified oem_main.dist folder into dist\ as a portable archive.
- Check whether Inno Setup 6.7.3 is installed; if missing, run winget install --id JRSoftware.InnoSetup --version 6.7.3 --exact --accept-package-agreements --accept-source-agreements , then run .\scripts\package.ps1 -PackageDir <oem_main.dist path> to generate the single-file setup EXE (if GitHub is unreachable for Inno Setup 6.7.3, deliver the verified portable ZIP immediately and share the command to run package.ps1 after manual Inno Setup 6.7.3 installation). Report the generated file paths when done.Command confirmation and first-build time
Approve terminal command execution prompts if your AI tool asks for permission. Compiling the UI into a native Windows executable takes 3–8 minutes on the first run; subsequent rebuilds reuse local compilation caches and finish much faster.
Step 3: Preview and Distribute Your Software
Once the AI completes the steps, collect your ready-to-distribute deliverables in dist\ (both formats bundle your compiled OEM UI and the complete CDM 0.9.0 runtime—end users need neither Python nor a separate CANmeleon Device Manager installation):
| Output path | Distribution format and purpose |
|---|---|
dist\CANmeleon-OEM-demo-0.9.0-setup-x64.exe | Single-file Windows x64 setup wizard. Rename it to match your product (for example, Acme-CAN-Manager-Setup.exe) and send it to customers. dist\oem-installer-build.json records its byte size and SHA-256 checksum. |
dist\*.zip | Portable no-install ZIP (archived from build\<timestamp>\oem_main.dist). Customers extract the archive and run CDM_OEM.exe directly without running an installer. |
To refine your app after previewing, send a plain-language follow-up in the same AI chat:
- Instant preview without waiting for compilation:
Run .\scripts\run.ps1 so I can preview the live UI window first. - Adjust colors and support info:
Change the theme color to dark green #0F6B50, add "Support: support@example.com" to the Help dialog in both English and Chinese, and rebuild. - Switch to offline-only delivery:
My customers work on air-gapped networks—set online_firmware to false so only offline firmware ZIP import is shown, then rebuild. - Simplify visible tabs:
Keep only the Firmware tab and Help dialog (set pages to firmware and help), update the UI tests accordingly, and rebuild.
Branding Configuration Reference
Core product identity settings live in oem/branding.json. Back up this file so you can reuse the same identifiers across future releases of your product:
| Field | Default demo value | Description and validation rules |
|---|---|---|
name | "CDM_OEM" | Product display name shown in the window title, desktop/Start Menu shortcuts, and setup wizard. Must not contain double quotes or line breaks. |
publisher | "canmeleon-oem" | Publisher or company name written to executable metadata and the Windows installer. |
product_id | "Kunhong.CANmeleon.OEMDemo" | Unique ASCII identifier (starts with a letter; letters, digits, ., _, - only) used for the installation folder, %LOCALAPPDATA% cache directory, taskbar AppUserModelID, and running mutex. Assign a new value for a new product and keep it unchanged across upgrades of that same product. |
app_id | "5C70252A-..." | Inno Setup upgrade GUID. Generate a unique GUID for a new product and keep it unchanged across future upgrades so upgrades replace your previous version cleanly without colliding with other vendors. |
theme_color | "#007F78" | Accent color for selected rows and highlights in 6-digit #RRGGBB hex format. |
online_firmware | true | true enables explicit stable / beta online firmware checks and downloads; false hides online controls for local-cache and offline ZIP workflows. |
logo | "logo.svg" | Header logo filename inside oem/ (rendered at 24×24 by default). |
icon | "icon.ico" | .ico filename inside oem/ shared by the window icon, taskbar, compiled EXE, and setup wizard (rebuild after changing). |
help_url | "https://canmeleon.com/..." | Target URL opened by the Help website button inside the Help dialog; set to "" to hide the button. |
pages | ["devices", "firmware", "help"] | Visible UI modules: firmware (slot management and firmware catalog), devices (device details, channel termination, and USB modes), help (header Help & diagnostics dialog). Keep at least one item. |
Manual PowerShell Commands (Optional)
In environments where you prefer running commands manually instead of delegating to an AI agent, extract CDM-0.9.0.zip, open PowerShell in the extracted root directory, and run:
# Optional in Mainland China: accelerate pip downloads with Tsinghua PyPI mirror
# $env:PIP_INDEX_URL = 'https://pypi.tuna.tsinghua.edu.cn/simple'
# 1. Provision project-local Python 3.12.10 and the pinned CDM 0.9.0 runtime
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\setup.ps1
# 2. Launch the customized OEM UI for quick local preview
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\run.ps1
# 3. Compile standalone portable directory (outputs build\<timestamp>\oem_main.dist)
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\build.ps1
# 4. (Optional) Build single-file setup EXE with Inno Setup 6.7.3
winget install --id JRSoftware.InnoSetup --version 6.7.3 --exact
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\package.ps1If the build machine cannot reach release assets online, download CANmeleon-device-manager-win64.zip from the CDM-0.9.0 release on Gitee or GitHub (must match the exact size and SHA-256 in cdm-runtime.lock.json) and pass -RuntimeZip:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\setup.ps1 -RuntimeZip 'D:\downloads\CANmeleon-device-manager-win64.zip'Functional Scope, Safety Boundaries, and Licensing
0.9.0 OEM Template Capabilities
| Area | Support in CDM_OEM (0.9.0) |
|---|---|
| Device discovery | Automatic 5-second idle scan, USB node & driver status display, device UID and channel readback |
| Firmware slots | Inspect occupied and empty slots, switch the active firmware, and uninstall non-running firmware |
| Import & install | Import complete offline firmware release ZIPs, filter by compatibility, preview plans (dry-run), and install into empty slots or replace existing slots; optional online check/download |
| Channels & modes | Read/apply software-controlled channel termination (with automatic readback check) and switch USB operating modes exposed by the connected device and firmware |
| Diagnostics & i18n | Runtime Chinese/English switch, Operation ID lookup, and one-click diagnostic JSON copy |
| Recovery & advanced | Not included: KH-Updater recovery mode flashing, storage layout rearrangement when contiguous space is insufficient, device self-test, V2 workflows, and client auto-update. Direct users to the original CANmeleon device manager for those workflows; upgrade OEM deployments by shipping a new full installer |
Safety Rules for Customizations
Whether changes are generated by AI or written by an engineer, preserve these safeguards:
- Public CLI boundary only: All device operations must go through
oem/client.pycalling the complete pinnedCANmeleon-device-manager.exepublic CLI (schema_version=1) with deviceUIDandplan_idverification. Never strip files fromruntime/cdmor parse internal backend state files. - Write protection and uncertain outcomes: Keep USB and power connected during firmware writes or mode switches; closing the UI or killing a child process does not safely cancel an active device write. On
TIMEOUTorOUTCOME_UNKNOWN, write actions remain disabled until the user refreshes and reads the actual device state—never add automatic write retries. - Code signing for public distribution:
package.ps1records SHA-256 integrity metadata without applying an Authenticode certificate. Before distributing installers to external customers, signCDM_OEM.exeand the final setup.exewith your organization's Windows code-signing certificate (signtool) to prevent Windows SmartScreen "Unknown publisher" prompts.
Open-Source License and Trademark Boundaries
- OEM layer (MIT): Original
oem/UI code, the public CLI adapter, documentation, build scripts, and the sample logo in this repository are released under the MIT License, permitting commercial customization, compilation, and redistribution. - Runtime and third-party components: The MIT License does not grant rights to CANmeleon trademarks or relicense the bundled CDM runtime binary or third-party components (including dynamically loaded PySide6 / Qt 6.11.1 LGPL/GPL libraries, Python PSF runtime files, and Inno Setup).
scripts/build.ps1automatically bundlesLICENSE,THIRD_PARTY_NOTICES.md, andlicenses/into the installed directory—keep these notices intact when redistributing your customized package. See THIRD_PARTY_NOTICES.md on GitHub (or Gitee mirror).
Troubleshooting
Slow downloads or GitHub timeouts in Mainland China
Source archives and the CDM 0.9.0 runtime download directly from Gitee; if Python package or compiler downloads are slow on restricted networks, apply these three options (already built into the one-shot prompt):
- Slow
pipdownloads duringsetup.ps1: Set$env:PIP_INDEX_URL = 'https://pypi.tuna.tsinghua.edu.cn/simple'(orhttps://mirrors.aliyun.com/pypi/simple/) before runningsetup.ps1. - Nuitka
winlibsdownload timeout: Without Visual Studio installed, Nuitka downloads MinGW from GitHub Releases. Install Microsoft Visual Studio C++ Build Tools via Microsoft's CDN (winget install Microsoft.VisualStudio.2022.BuildTools --override "--quiet --wait --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended") so Nuitka compiles directly with local MSVC without accessing GitHub. - Inno Setup 6.7.3 download timeout or
Expected Inno Setup 6.7.3: Official Inno Setup 6.7.3 installers are listed on the Inno Setup Historical Downloads page. You can run.\scripts\build.ps1immediately to produce a verified portable directory (zip and distribute without Inno Setup), or installinnosetup-6.7.3.exemanually and run.\scripts\package.ps1(pass-Iscc 'C:\Path\To\ISCC.exe'if installed to a custom directory).
Non-ASCII Windows username or temp directory error
Non-ASCII project paths under an ASCII Windows user profile are staged automatically by build.ps1. If your Windows user profile path itself contains non-ASCII characters (making %TEMP% non-ASCII), set $env:CDM_OEM_BUILD_ROOT = 'C:\cdm-oem-build' before building.
INVALID_PACKAGE when importing a ZIP
Select a complete official firmware release ZIP (see Firmware downloads), not the device manager software archive (CANmeleon-device-manager-win64.zip) or an individual extracted binary.
BUSY or DEVICE_BUSY when connecting
Another program—such as the original CANmeleon device manager or CAN software (CANoe, PCAN-View, ZCANPRO, etc.)—is holding the device. Disconnect the original manager and close active CAN applications, then click Refresh.
Feedback and Commercial Cooperation
- OEM template and build scripts: Report issues in GitHub Issues or Gitee Issues with the
CDM-0.9.0version and terminal output or copied diagnostic JSON (review and redact deviceUIDvalues as needed before posting publicly). - Hardware adaptation, custom firmware, and OEM inquiries: For custom hardware, chip porting, dedicated USB VID/PID firmware, or commercial integration services, visit Contact CANmeleon or email Kunhong technical support.