Skip to content

Conversation

Copy link

Copilot AI commented Jan 12, 2026

Implements driver upgrade functionality with UAC management via external scripts. The existing driver backup and installation commands are now orchestrated with optional UAC disable/restore hooks.

Changes

  • Script execution framework: New ScriptCommand base class executes external scripts with elevation (runas verb). Validates file existence before execution and provides detailed error messages with script paths.

  • UAC management commands: DisableUACCommand and RestoreUACCommand provide script entry points without managing script content. Both inherit from ScriptCommand.

  • Configuration extension: DriverInformation now supports optional DisableUACScriptPath and RestoreUACScriptPath properties via builder pattern.

  • Workflow orchestration: DriverMiddleware executes commands in sequence:

    1. Disable UAC (optional)
    2. Backup existing drivers
    3. Delete old drivers
    4. Install new drivers
    5. Restore UAC (optional)

Usage

Configure UAC scripts via pipeline context:

var builder = new DriverInformation.Builder()
    .SetDriverFileExtension(".inf")
    .SetOutPutDirectory(backupPath)
    .SetDriverDirectory(driverPath)
    .SetFieldMappings(fieldMappings)
    .SetDisableUACScriptPath("path/to/disable_uac.bat")
    .SetRestoreUACScriptPath("path/to/restore_uac.bat")
    .Build();

UAC script execution is optional—the workflow functions without script paths.

Original prompt

This section details on the original issue you should resolve

<issue_title>[FEATURE] Driver Upgrade Function</issue_title>
<issue_description>### Feature Description

Based on the existing implementation code under the Driver directory in GeneralUpdate.Core, complete the following functions:
1.Disable the system UAC via script execution (The script content does not need to be concerned; only need to reserve an executable script entry).
2.Back up drivers (Back up the existing drivers of the same type before upgrading the driver).
3.Upgrade drivers (Install the drivers in the specified directory).
4.Restore UAC via script (The script content does not need to be concerned; only need to reserve an executable script entry).

Operating System Version (Optional)

windows

CPU Instruction Set Architecture (Optional)

x86,x64,arm64</issue_description>

<agent_instructions>First, fully understand all the code, then continue to implement the functionality mentioned in issue #101 based on the implemented code under the Driver directory in GeneralUpdate.Core.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 12, 2026 04:04
Co-authored-by: JusterZhu <11714536+JusterZhu@users.noreply.github.com>
Co-authored-by: JusterZhu <11714536+JusterZhu@users.noreply.github.com>
Copilot AI changed the title [WIP] Add driver upgrade functionality to GeneralUpdate.Core Add UAC script execution support to driver upgrade workflow Jan 12, 2026
Copilot AI requested a review from JusterZhu January 12, 2026 04:08
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.

[FEATURE] Driver Upgrade Function

2 participants