https://github.com/jtgsystems/driver-updater---windows
๐ง Windows driver updater - Automatic driver detection, download & installation tool
https://github.com/jtgsystems/driver-updater---windows
ai automation llm nlp python rag tools
Last synced: about 2 months ago
JSON representation
๐ง Windows driver updater - Automatic driver detection, download & installation tool
- Host: GitHub
- URL: https://github.com/jtgsystems/driver-updater---windows
- Owner: jtgsystems
- License: mit
- Created: 2025-03-07T23:55:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-04-13T17:37:26.000Z (3 months ago)
- Last Synced: 2026-04-13T18:24:38.461Z (3 months ago)
- Topics: ai, automation, llm, nlp, python, rag, tools
- Language: PowerShell
- Size: 786 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README
# Windows Driver and Update Tool - Auto-Start Edition
[](https://www.microsoft.com/windows)
[](https://docs.microsoft.com/powershell/)
[](LICENSE)
[](CHANGELOG.md)
## ๐ Table of Contents
- [๐ฏ Overview](#-overview)
- [โจ Features](#-features)
- [๐ง Installation](#-installation)
- [๐ฑ USB Drive Deployment](#-usb-drive-deployment)
- [๐ฅ๏ธ System Requirements](#๏ธ-system-requirements)
- [?? Official Sources](#-official-sources)
- [๐ฆ How It Works](#-how-it-works)
- [๐ Usage Modes](#-usage-modes)
- [๐ ๏ธ Configuration](#๏ธ-configuration)
- [๐ Logging & Monitoring](#-logging--monitoring)
- [๐ Security Features](#-security-features)
- [๐ Troubleshooting](#-troubleshooting)
- [โ ๏ธ Important Notes](#๏ธ-important-notes)
- [๐ Performance](#-performance)
- [๐ค Contributing](#-contributing)
## ๐ฏ Overview
The **Windows Driver and Update Tool** is an enterprise-grade, fully automated solution for installing Windows updates, drivers, and apps on new system builds or existing systems. It automatically installs itself to Windows startup, applies updates, and removes itself when complete. Feature upgrades (e.g., Windows 10 to Windows 11) are excluded. ๐
### ๐ Key Highlights
- **๐ Fully Autonomous** - Set it and forget it! Runs automatically at startup
- **๐พ USB Deployment Ready** - Deploy from USB drives to multiple systems
- **๐งน Self-Cleaning** - Removes itself when updates are applied
- **๐ State Persistence** - Survives reboots and continues where it left off
- **๐ก๏ธ Enterprise Safe** - Comprehensive error handling and logging
## โจ Features
### ๐ฏ Core Functionality
| Feature | Description |
|---------|-------------|
| ?? **Auto-Detection** | Automatically discovers Windows updates and driver updates from Windows Update |
| ๐ฆ **Batch Installation** | Installs multiple updates in a single session |
| ๐ **Auto-Startup** | Adds itself to Windows startup (Registry + Task Scheduler) |
| ๐๏ธ **Self-Removal** | Automatically removes itself when no more updates need applying |
| ๐พ **USB Support** | Detects USB execution and copies to local drive |
| ๐ **State Management** | Tracks progress across reboots with JSON state file |
| ๐ **Comprehensive Logging** | Detailed logs with rotation and Event Log fallback |
| ๐ก๏ธ **Safety Features** | Driver backup, restore points, signature validation |
### ๐ Advanced Features
- **๐ Dual Startup Methods** - Uses both Registry and Scheduled Task for reliability
- **โก Smart Detection** - Identifies and skips preview/beta drivers
- **๐ Retry Logic** - Automatic retry with exponential backoff
- **๐ Progress Tracking** - Visual progress bars and status updates
- **๐ Internet Check** - Validates connectivity before attempting updates
- **๐ฝ Driver Backup** - Exports current drivers before updates
- **๐ Reboot Management** - Handles required reboots gracefully
## ๐ง Installation
### ๐ฆ Quick Start (Recommended)
1. **Download the package** to any location (USB drive or local folder)
2. **Double-click** `Install-DriverUpdater.cmd`
3. **Accept** the UAC prompt for administrator privileges
4. **Select option 1** to install and configure auto-start
5. โ
**Done!** The tool will handle everything automatically
### ๐ฏ Manual Installation
```powershell
# Run PowerShell as Administrator
cd "path\to\driver-updater"
# Execute the auto-start script
.\WindowsDriverUpdater_AutoStart.ps1
```
### ๐ฑ๏ธ One-Click Installation
Simply run `Install-DriverUpdater.cmd` - it handles elevation and execution automatically!
## ๐ฑ USB Drive Deployment
### ๐ Preparing USB Drive
1. **Format USB** drive (FAT32 or NTFS)
2. **Copy all files** to USB root or subfolder:
```
๐ USB Drive
โโโ ๐ Install-DriverUpdater.cmd
โโโ ๐ WindowsDriverUpdater_AutoStart.bat
โโโ ๐ WindowsDriverUpdater_AutoStart.ps1
โโโ ๐ README.md
```
3. **Label the USB** (optional): "DRIVER_UPDATER"
### ๐ Deployment Process
1. **Insert USB** into target system
2. **Navigate to USB** in File Explorer
3. **Run** `Install-DriverUpdater.cmd`
4. **Remove USB** after installation starts (tool copies itself locally)
### ๐ Mass Deployment
For multiple systems:
```batch
@echo off
:: Deploy to multiple systems via network
for %%C in (PC001 PC002 PC003) do (
echo Deploying to %%C...
xcopy /E /Y "\\server\share\DriverUpdater\*" "\\%%C\C$\Temp\DriverUpdater\"
psexec \\%%C -s -d cmd /c "C:\Temp\DriverUpdater\Install-DriverUpdater.cmd"
)
```
## ๐ฅ๏ธ System Requirements
### โ
Minimum Requirements
| Component | Requirement |
|-----------|-------------|
| ๐ฅ๏ธ **OS** | Windows 10 (1809+) / Windows 11 / Server 2016+ |
| โ๏ธ **PowerShell** | Version 5.1 or later |
| ๐ค **Privileges** | Administrator rights |
| ๐ **Network** | Internet connection for driver downloads |
| ๐พ **Disk Space** | 500MB free (more for driver backups) |
| ๐ง **Services** | Windows Update service enabled |
### ๐ Prerequisites Check
The tool automatically verifies:
- โ
Administrator privileges
- โ
PowerShell version
- โ
Windows Update service status
- โ
Internet connectivity
- โ
Required PowerShell modules
## ?? Official Sources
These references describe the Windows Update and driver update mechanisms used by this tool:
- Windows Update overview: https://support.microsoft.com/windows/update-windows-3c5ae7fc-9fb6-9af1-1984-b5e0412c556a
- Update drivers manually: https://support.microsoft.com/windows/update-drivers-manually-in-windows-ec62f46c-ff14-c91d-eead-d7126dc1f7b6
- Windows Update error reference: https://learn.microsoft.com/windows/deployment/update/windows-update-error-reference
- Windows Update Agent API (WUAPI): https://learn.microsoft.com/windows/win32/api/wuapi/
- PSWindowsUpdate module: https://www.powershellgallery.com/packages/PSWindowsUpdate
## ๐ฆ How It Works
### ๐ Workflow Diagram
```mermaid
graph TD
A[๐ Start] --> B{Running from USB?}
B -->|Yes| C[๐ Copy to Local]
B -->|No| D[๐ Use Current Location]
C --> E[๐ Check for Updates]
D --> E
E --> F{Updates Found?}
F -->|Yes| G[๐ฆ Install Drivers]
F -->|No| H[๐ Increment Counter]
G --> I[๐พ Save State]
H --> J{3 Consecutive No Updates?}
I --> K[๐ Add to Startup]
J -->|Yes| L[๐๏ธ Self-Remove]
J -->|No| M[โฐ Wait for Next Run]
K --> N[๐ Reboot if Needed]
L --> O[โ
Complete]
M --> E
N --> E
```
### ๐ Execution Phases
#### Phase 1: Initialization ๐
- Checks admin privileges
- Detects USB vs local execution
- Creates working directory
- Initializes logging
#### Phase 2: Setup ๐ง
- Installs required PowerShell modules
- Registers Microsoft Update service
- Validates internet connectivity
- Loads previous state (if exists)
#### Phase 3: Update Discovery ๐
- Queries Windows Update for drivers and updates
- Filters out preview/beta drivers
- Validates driver signatures
- Creates driver list
#### Phase 4: Installation ๐ฆ
- Creates driver backup (optional)
- Creates restore point (optional)
- Installs each driver sequentially
- Logs success/failure for each
#### Phase 5: State Management ๐พ
- Updates installation counter
- Records consecutive no-update runs
- Saves state to JSON file
- Adds to startup (first run only)
#### Phase 6: Completion Check โ
- Evaluates completion criteria
- Removes from startup if complete
- Cleans up files and folders
- Final logging
## ๐ Usage Modes
### ๐ฎ Interactive Mode (Default)
Run `WindowsDriverUpdater_AutoStart.bat` for menu-driven interface:
```
========================================
Windows Driver Updater Auto-Start
========================================
Select an option:
[1] Install and Configure Auto-Start
[2] Check for Updates Only
[3] Remove from Startup
[4] View Status
[5] Exit
Enter your choice (1-5):
```
### ๐ค Automated Mode
```powershell
# Silent installation with auto-start
.\WindowsDriverUpdater_AutoStart.ps1
# Check only mode (no installation)
.\WindowsDriverUpdater_AutoStart.ps1 -CheckOnly
# Remove from startup
.\WindowsDriverUpdater_AutoStart.ps1 -RemoveFromStartup
```
### ๐ฏ Legacy Compatibility Mode
For systems requiring the original updater:
```powershell
# Use the original script with parameters
.\WindowsDriverUpdater_Updated.ps1 -Silent -AutoInstall -CreateRestorePoint
```
## ๐ ๏ธ Configuration
### ๐ File Locations
| File/Folder | Default Location | Purpose |
|-------------|------------------|---------|
| ๐ **Working Directory** | `%ProgramData%\DriverUpdater` | Main operational folder |
| ๐ **State File** | `%ProgramData%\DriverUpdater\DriverUpdater.state` | Tracks progress |
| ๐ **Log File** | `%ProgramData%\DriverUpdater\DriverUpdater_AutoStart.log` | Detailed logging |
| ๐พ **Driver Backups** | `%ProgramData%\DriverUpdater\DriverBackups\` | Pre-update backups |
| ๐ง **Registry Key** | `HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run` | Startup entry |
| โฐ **Scheduled Task** | `DriverUpdaterAutoStart` | Backup startup method |
### โ๏ธ Customization
Edit the configuration section in `WindowsDriverUpdater_AutoStart.ps1`:
```powershell
$script:Config = @{
ScriptName = "WindowsDriverUpdater_AutoStart"
StartupRegPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
StartupTaskName = "DriverUpdaterAutoStart"
LogFileName = "DriverUpdater_AutoStart.log"
StateFile = "DriverUpdater.state"
MaxRetries = 3 # Retry attempts for operations
RetryDelaySeconds = 5 # Delay between retries
ConsecutiveNoUpdatesThreshold = 3 # Runs before self-removal
}
```
## ๐ Logging & Monitoring
### ๐ Log Levels
| Level | Icon | Description | Example |
|-------|------|-------------|---------|
| **Info** | โน๏ธ | General information | "Checking for updates..." |
| **Success** | โ
| Successful operations | "Successfully installed: Intel Graphics Driver" |
| **Warning** | โ ๏ธ | Non-critical issues | "System Restore not enabled" |
| **Error** | โ | Critical failures | "Failed to install driver: Access denied" |
### ๐ Log File Format
```
2024-01-15 10:30:45 - [Info] ============================================================
2024-01-15 10:30:45 - [Info] Driver Updater Auto-Start v4.4 Started
2024-01-15 10:30:45 - [Info] Running from: C:\DriverUpdater\WindowsDriverUpdater_AutoStart.ps1
2024-01-15 10:30:45 - [Info] Is USB: False
2024-01-15 10:30:46 - [Success] Modules installed successfully
2024-01-15 10:30:48 - [Info] Found 3 updates
2024-01-15 10:31:05 - [Success] Successfully installed: Intel HD Graphics Driver
2024-01-15 10:31:45 - [Success] Successfully installed: Realtek Audio Driver
2024-01-15 10:32:15 - [Warning] Failed to install Bluetooth Driver: Error 0x80240017
2024-01-15 10:32:16 - [Info] Installed 2 of 3 updates
2024-01-15 10:32:17 - [Success] Driver Updater completed successfully
```
### ๐ State File Structure
```json
{
"InstallCount": 5,
"LastRun": "2024-01-15 10:32:17",
"ConsecutiveNoUpdates": 1,
"IsComplete": false
}
```
### ๐ Monitoring Commands
```powershell
# View current state
Get-Content "$env:ProgramData\DriverUpdater\DriverUpdater.state" | ConvertFrom-Json
# Monitor log in real-time
Get-Content "$env:ProgramData\DriverUpdater\DriverUpdater_AutoStart.log" -Wait -Tail 10
# Check startup registration
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" | Select-Object DriverUpdaterAutoStart
Get-ScheduledTask -TaskName "DriverUpdaterAutoStart" -ErrorAction SilentlyContinue
# View Event Log entries (if file logging fails)
Get-EventLog -LogName Application -Source "DriverUpdater" -Newest 20
```
## ๐ Security Features
### ๐ก๏ธ Built-in Protections
| Feature | Description | Status |
|---------|-------------|--------|
| ๐ **Admin Enforcement** | Requires administrator privileges | โ
Mandatory |
| ๐ **Driver Signatures** | Validates driver digital signatures | โ
Default |
| ๐พ **Automatic Backup** | Backs up drivers before updates | โ
Default |
| ๐ **Restore Points** | Creates system restore points | โ๏ธ Optional |
| ๐ซ **Beta Filtering** | Excludes preview/beta drivers | โ
Default |
| ๐ **Audit Trail** | Comprehensive logging of all actions | โ
Always |
| ๐ **TLS Security** | Uses TLS 1.2/1.3 for downloads | โ
Enforced |
### ๐ Security Best Practices
1. **๐ Run from trusted sources only**
2. **๐ Review logs after deployment**
3. **๐พ Keep driver backups for 30 days**
4. **๐ Test on non-production systems first**
5. **๐ Monitor Event Logs for anomalies**
## ๐ Troubleshooting
### โ Common Issues & Solutions
#### ๐ซ "Administrator privileges required"
**Solution:**
```batch
:: Right-click and "Run as administrator"
:: Or use the Install-DriverUpdater.cmd launcher
```
#### ๐ "No internet connection detected"
**Solution:**
```powershell
# Check Windows Update service
Get-Service wuauserv | Start-Service
# Test connectivity
Test-NetConnection download.windowsupdate.com -Port 443
Test-NetConnection windowsupdate.microsoft.com -Port 443
# Check firewall
Get-NetFirewallRule | Where DisplayName -like "*Windows Update*"
```
#### ๐ฆ "PSWindowsUpdate module installation failed"
**Solution:**
```powershell
# Manual installation
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-PackageProvider -Name NuGet -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module -Name PSWindowsUpdate -Force -AllowClobber -Scope AllUsers
```
#### ๐ "Script not running at startup"
**Solution:**
```powershell
# Verify Registry entry
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "DriverUpdaterAutoStart"
# Check Scheduled Task
Get-ScheduledTask -TaskName "DriverUpdaterAutoStart" | Get-ScheduledTaskInfo
# Re-add to startup manually
.\WindowsDriverUpdater_AutoStart.ps1
```
#### ๐พ "State file corrupted"
**Solution:**
```powershell
# Delete state file and restart
Remove-Item "$env:ProgramData\DriverUpdater\DriverUpdater.state" -Force
.\WindowsDriverUpdater_AutoStart.ps1
```
### ๐ Diagnostic Commands
```powershell
# Full system diagnostic
$diag = @{
OS = Get-CimInstance Win32_OperatingSystem | Select Caption, Version, BuildNumber
PowerShell = $PSVersionTable.PSVersion
WUService = Get-Service wuauserv | Select Name, Status, StartType
Internet = Test-NetConnection download.windowsupdate.com -Port 443 -InformationLevel Quiet
Modules = Get-Module -ListAvailable PSWindowsUpdate
AdminRights = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
StateFile = Test-Path "$env:ProgramData\DriverUpdater\DriverUpdater.state"
LogFile = Test-Path "$env:ProgramData\DriverUpdater\DriverUpdater_AutoStart.log"
}
$diag | ConvertTo-Json -Depth 3
```
## โ ๏ธ Important Notes
### ๐จ Critical Information
> **โก USB Deployment:** The tool automatically detects USB execution and copies itself to the local drive. You can safely remove the USB after starting installation.
> **๐ Reboot Handling:** The tool schedules automatic reboots when required. Save your work before running!
> **๐๏ธ Self-Removal:** After 3 consecutive runs with no updates found, the tool removes itself completely.
> **๐พ Backup Location:** Driver backups are stored in `%ProgramData%\DriverUpdater\DriverBackups\` with timestamp folders.
### ๐ Pre-Installation Checklist
- [ ] โ
Windows 10/11 or Server 2016+
- [ ] โ
Administrator privileges available
- [ ] โ
Internet connection active
- [ ] โ
Windows Update service enabled
- [ ] โ
At least 500MB free disk space
- [ ] โ
System backup completed (recommended)
### ๐ Update Cycle
1. **Initial Run**: Installs available updates, adds to startup
2. **Subsequent Runs**: Checks for new updates at each startup
3. **Completion**: Removes itself after confirming no more updates
## ๐ Performance
### โก Performance Metrics
| Metric | Value | Notes |
|--------|-------|-------|
| ๐ **Startup Impact** | < 5 seconds | Minimal boot time increase |
| ๐พ **Memory Usage** | ~50-100 MB | During active updating |
| ๐ **Network Usage** | Variable | Depends on driver sizes |
| โฑ๏ธ **Average Runtime** | 5-30 minutes | Per update session |
| ๐ฆ **Driver Install Rate** | 1-3 min/driver | Includes validation |
### ๐ฏ Optimization Tips
1. **Use Silent Mode** for faster execution
2. **Skip Backup** if you have recent system backup
3. **Filter Drivers** to update only specific hardware
4. **Schedule During Off-Hours** for minimal disruption
## ๐ค Contributing
### ๐ Reporting Issues
When reporting issues, please include:
1. ๐ Full error message
2. ๐ Relevant log excerpts
3. ๐ป System specifications
4. ๐ Steps to reproduce
### ๐ง Contact
- **Issues**: Create an issue in the repository
- **Security**: Report security issues privately
- **Feature Requests**: Use the feature request template
---
## Changelog
### Version 4.4 (2025-12-19) - Drivers, Updates, and Apps Auto-Start`r`n`r`n**Changes:**`r`n- Added app updates (WinGet and Microsoft Store)`r`n- Added Defender definitions and PowerShell module updates`r`n- Maintained feature-upgrade exclusion`r`n`r`n
**Changes:**
- Added Windows updates (security/critical/rollups) alongside driver updates
- Explicitly excluded feature upgrades (e.g., Windows 10 to Windows 11)
- Updated auto-start logs to reflect new version
### Version 4.2 (2025-12-19) - Reliability & Cleanup Fixes
**Fixes:**
- Prevented state/log recreation after self-removal
- Ensured log/state directories are created reliably under ProgramData
- Allowed driver updates without KB metadata to be processed
**Improvements:**
- Added TLS hardening to auto-start module installation
- Updated connectivity checks to use Microsoft endpoints
### Version 4.1 (2025-12-02) - Code Audit & Modernization Release
**Security Fixes:**
- Fixed potential command injection vulnerability in startup registration (path validation added)
- Replaced insecure temp script execution with scheduled task cleanup
- Added path validation before startup registration
**Bug Fixes:**
- Fixed incorrect filter logic in `Select-DriverUpdates` (formerly `Filter-DriverUpdates`)
- Fixed System Restore check that incorrectly queried restore points instead of service status
- Fixed string multiplication syntax (`"="*60`) that returned empty string
- Fixed version mismatch between header (v3.3) and log output (v3.4)
- Added null checks for driver update properties
**Modernization:**
- Replaced deprecated `Get-WmiObject` with `Get-CimInstance` (CIM is the modern standard)
- TLS 1.3 now added conditionally only when available (prevents errors on older systems)
- Renamed `Rotate-LogFile` to `Invoke-LogRotation` (PowerShell approved verbs)
- Renamed `Filter-DriverUpdates` to `Select-DriverUpdates` (PowerShell approved verbs)
- Added comprehensive documentation blocks to all functions
**Code Quality:**
- Added `[CmdletBinding()]` and proper parameter blocks to functions
- Improved error handling with specific exception catching
- Enhanced log rotation with efficient `-Filter` parameter usage
- Fixed inconsistent brace styles throughout codebase
- Added proper exit codes to all batch launchers
**New Features:**
- Added `Test-DriverUpdater.ps1` validation script for installation verification
- Improved batch file error handling and user feedback
**Performance:**
- Optimized log file cleanup to use `-Filter` parameter directly
- Reduced unnecessary string operations
### Version 4.0 (Previous)
- Initial Auto-Start Edition release
- USB deployment support
- Self-removal after completion
### Version 3.3 (Legacy)
- Core driver update functionality
- PSWindowsUpdate integration
---
## License
This project is licensed under the MIT License - see the LICENSE file for details.
## Acknowledgments
- Microsoft Windows Update team for the update infrastructure
- PSWindowsUpdate module contributors
- Community testers and contributors
---
**Happy Updating!**
*Made for Windows System Administrators*