Skip to content

Windows: Remove kernel filter driver, add self-extracting installer with version management and conflict detection#7

Open
hangzqcom wants to merge 9 commits intoqualcomm:mainfrom
hangzqcom:remove-kernel-filter-driver
Open

Windows: Remove kernel filter driver, add self-extracting installer with version management and conflict detection#7
hangzqcom wants to merge 9 commits intoqualcomm:mainfrom
hangzqcom:remove-kernel-filter-driver

Conversation

@hangzqcom
Copy link
Copy Markdown

@hangzqcom hangzqcom commented Apr 14, 2026

Summary

Remove the kernel-mode USB filter driver from the Windows variant of this userspace-only repository, and introduce a self-extracting installer that manages driver lifecycle — including version tracking, upgrade/downgrade logic, and automatic detection and removal of all conflicting driver packages.

Changes

1. Remove kernel filter driver and build artifacts (184805f)

The kernel-mode USB filter driver (qcusbfilter.sys) and pre-built .cat catalog files do not belong in a userspace driver repository.

  • Removed: src/windows/filter/ directory (qcusbfilter binaries for amd64/arm/arm64/i386)
  • Removed: src/windows/qcfilter.inf (kernel filter driver INF)
  • Removed: All .cat files from version control (build artifacts, not source)
  • Added: src/windows/build.bat — generates .cat catalog files using inf2cat
  • Added: src/windows/sign.bat — production code-signing script using signtool
  • Added: .gitignore — excludes .cat files and build artifacts

2. Add self-extracting installer with version tracking (63bc4a0)

A new Windows installer packages all INF+CAT driver files into a single self-extracting EXE with an appended ZIP payload and binary trailer.

New files:

  • src/windows/installer/install.c — Installer C source (~1100 lines)
  • src/windows/installer/version.h — Version constants (v1.00.1.7), package name, registry key definitions
  • src/windows/installer/CMakeLists.txt — CMake build configuration (MSVC, UAC elevation manifest)
  • src/windows/installer/package.py — Python script to create ZIP payload and append trailer with CRC32
  • src/windows/installer/package.bat — One-command build+package script
  • src/windows/installer/miniz.c, miniz.h, miniz-LICENSE — Embedded ZIP decompression (public domain)

Installer features:

Command Description
qcom-usb-userspace-drivers.exe Install drivers (auto-upgrades if older version found)
qcom-usb-userspace-drivers.exe /query Query installed packages and detect conflicting drivers
qcom-usb-userspace-drivers.exe /force Force install (bypass version check — reinstall or downgrade)
qcom-usb-userspace-drivers.exe /version Print installer version and exit
qcom-usb-userspace-drivers.exe /help Print usage help
  • Records installed version, INF list, install date, and package name in HKLM\SOFTWARE\Qualcomm\QcomUsbDrivers
  • Version comparison prevents same-version reinstall or accidental downgrade (use /force to override)
  • Output filename includes version: qcom-usb-userspace-drivers_1.00.1.7.exe

3. Add conflicting driver package detection and removal (61abd29)

Before installing (both fresh and upgrade), the installer automatically detects and removes all conflicting driver packages in this order:

Priority Conflict type Detection Removal
1 Legacy QPM-managed packages (QUD, QUD.internal, Qualcomm_Userspace_Driver) qpm-cli availability on PATH qpm-cli --uninstall <package>
2 Previous userspace driver installation Registry INF list at HKLM\SOFTWARE\Qualcomm\QcomUsbDrivers pnputil /delete-driver per INF
3 Kernel-mode driver packages (qcfilter, qcwwan, qdbusb, qcwdfmdm, qcwdfser) pnputil /enum-drivers matching original INF name pnputil /delete-driver /uninstall /force

All conflict removal is non-fatal — if a package is not found or removal fails, installation proceeds normally.

Enhanced /query command reports four sections:

  1. Installed userspace driver package (from registry)
  2. Userspace drivers in the Windows driver store (with OEM name and version)
  3. Kernel-mode drivers in the driver store (flagged as conflicting)
  4. Legacy QPM-managed package availability

README updates

  • Updated repository structure (removed filter driver references)
  • Added installer CLI reference table
  • Added build instructions for package.bat
  • Added conflict detection table documenting all three removal paths
  • Removed manual kernel driver installation instructions

Testing

  • Build installer: cd src\windows\installer && package.bat
  • Fresh install on clean system
  • Upgrade over previous userspace installation
  • /query with no drivers installed
  • /query with kernel drivers present
  • /query with legacy QPM packages
  • /force reinstall and downgrade
  • /version and /help output

@hangzqcom hangzqcom force-pushed the remove-kernel-filter-driver branch from 8f3aa5e to 991c0d9 Compare April 14, 2026 22:57
@hangzqcom hangzqcom changed the title Remove Windows kernel filter driver Remove Windows kernel filter driver and .cat build artifacts Apr 14, 2026
@hangzqcom hangzqcom force-pushed the remove-kernel-filter-driver branch 6 times, most recently from 21079d7 to 28194da Compare April 15, 2026 03:03
- Remove kernel filter driver (qcusbfilter) binaries, INF, and catalog files

- Remove all .cat files from version control (build artifacts)

- Add build.bat script to generate and optionally sign .cat files using inf2cat/signtool

- Add .gitignore to exclude .cat files

- Update README with build instructions and updated repository structure

Signed-off-by: Hang Zhao (QCT) <hangz@qti.qualcomm.com>
@hangzqcom hangzqcom force-pushed the remove-kernel-filter-driver branch from 28194da to 184805f Compare April 15, 2026 03:15
- Add version.h (v1.00.1.7) with version constants and registry key definitions

- Add version comparison, /query, /force, /version, /help CLI options to installer

- Auto-uninstall old driver packages on upgrade before installing new ones

- Record installed version, INF list, and install date in registry

- Include version in packaged installer filename (QcomUsbDriverInstaller_<ver>.exe)

- Update README with installer CLI reference and building instructions

- Update .gitignore for versioned installer filename pattern
Before installing, the installer now detects and removes three types of conflicting packages:

1. Previous userspace installations (tracked in registry INF list)

2. Kernel-mode driver packages: qcfilter, qcwwan, qdbusb, qcwdfmdm, qcwdfser

3. Legacy QPM-managed packages: QUD, QUD.internal, Qualcomm_Userspace_Driver

All conflict removal is non-fatal — installation proceeds even if a package is not found or removal fails. Updated README with conflict detection table.
@hangzqcom hangzqcom changed the title Remove Windows kernel filter driver and .cat build artifacts Windows: Remove kernel filter driver, add self-extracting installer with version management and conflict detection Apr 15, 2026
hangzqcom and others added 6 commits April 15, 2026 14:30
Signed-off-by: chehan <chehan@qti.qualcomm.com>
Signed-off-by: chehan <chehan@qti.qualcomm.com>
Signed-off-by: chehan <chehan@qti.qualcomm.com>
Signed-off-by: chehan <chehan@qti.qualcomm.com>
Signed-off-by: chehan <chehan@qti.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants