maurice-daly / DriverAutomationTool

Home of the Driver Automation Tool
https://www.msendpointmgr.com
BSD 2-Clause "Simplified" License
382 stars 114 forks source link

Dell drivers not processing #361

Open CDartois-TAP opened 2 years ago

CDartois-TAP commented 2 years ago

Hello ... I'm trying to update / install new drivers and regardless of DAT tool version (6.4.9, 6.5.6, 7.04 or 7.1.2) it gets stuck "processing",

Using the Dell OptiPlex 3070 as an example here...

======== Dell ConfigMgr 3070 DRIVER PROCESSING STARTED ======== ConfigMgr: Latest driver revision found - 3070

then ... nothing. even hours later.

Currently trying 6.4.9, I have attached the log file.

DriverAutomationTool - Copy.log .

Entirp commented 1 year ago

+1

MildMcHaggis commented 1 year ago

This is happening for us too. It looks like maybe Dell CAB files to .EXE files and now the DriverAutomationTool.ps1 can't extract the drivers.

I'm hoping the tool will be updated soon to fix the issue. But for now, we are getting around it by adding some code to the DriverAutomationTool.ps1 file to change what it does when it sees an EXE file instead of a CAB file. And since the files are named a little differently, I had to change the code to get the the correct "DriverRevision". I don't know if it will handle every Dell driver, but I'm hoping it will get us by for now. Hopefully it'll help someone else.

Here's what I did (hopefully it will format ok:

First - To change the way it grabs the driver version (DriverRevision): Find this line and change it from: $DriverRevision = $Drivercab.Split("-") | Select-Object -Last 2 | Select-Object -First 1

Change it to: $DriverRevision = ($Drivercab.Split("_") | Select-Object -Last 1).Split(".")|Select-Object -First 1

Then - To add handling for the EXEs I did this: In the "Invoke-ContentExtract" function, I changed the following code to check for an exe file and handle it differently.

Changed from:

if ($Make -eq "Dell") {
    global:Write-LogEntry -Value "$($Product): Extracting $Make drivers to $DriverExtractDest" -Severity 1
    Start-Job -Name "$Make $Model driver extract" -ScriptBlock $DriverExtractJob -ArgumentList $DriverSourceCab, $DriverExtractDest
    While ((Get-Job -Name "$Make $Model driver extract").State -eq "Running") {
    global:Write-LogEntry -Value "$($Product): Waiting for extract process to complete..  Next check in 30 seconds" -Severity 1
        Start-Sleep -Seconds 30
    }
}

Changed To:

if ($Make -eq "Dell") {
    global:Write-LogEntry -Value "$($Product): Extracting $Make drivers to $DriverExtractDest" -Severity 1
    #If the driver file is an .EXE - Extract using the command line switch 
        global:Write-LogEntry -Value "Driver Source CAB = $DriverSourceCab" -Severity 1
        If($DriverSourceCab.tolower().contains(".exe"))
        {
                global:Write-LogEntry -Value "$($Product): Driver package is an EXE - Extracting using the EXE" -Severity 1
                $DriverExtraction = Start-Process "$DriverSourceCab" -ArgumentList "/s /e=""$DriverExtractDest""" -PassThru
                $DriverExtraction.WaitForExit()
         } 
         Else 
         {
              Start-Job -Name "$Make $Model driver extract" -ScriptBlock $DriverExtractJob -ArgumentList $DriverSourceCab, $DriverExtractDest
           While ((Get-Job -Name "$Make $Model driver extract").State -eq "Running") {
             global:Write-LogEntry -Value "$($Product): Waiting for extract process to complete..  Next check in 30 seconds" -Severity 1
                  Start-Sleep -Seconds 30
             }
           }
}
MiketheMaker18 commented 1 year ago

This is happening for us too. It looks like maybe Dell CAB files to .EXE files and now the DriverAutomationTool.ps1 can't extract the drivers.

I'm hoping the tool will be updated soon to fix the issue. But for now, we are getting around it by adding some code to the DriverAutomationTool.ps1 file to change what it does when it sees an EXE file instead of a CAB file. And since the files are named a little differently, I had to change the code to get the the correct "DriverRevision". I don't know if it will handle every Dell driver, but I'm hoping it will get us by for now. Hopefully it'll help someone else.

Here's what I did (hopefully it will format ok:

First - To change the way it grabs the driver version (DriverRevision): Find this line and change it from: $DriverRevision = $Drivercab.Split("-") | Select-Object -Last 2 | Select-Object -First 1

Change it to: $DriverRevision = ($Drivercab.Split("_") | Select-Object -Last 1).Split(".")|Select-Object -First 1

Then - To add handling for the EXEs I did this: In the "Invoke-ContentExtract" function, I changed the following code to check for an exe file and handle it differently.

Changed from:

if ($Make -eq "Dell") {
  global:Write-LogEntry -Value "$($Product): Extracting $Make drivers to $DriverExtractDest" -Severity 1
  Start-Job -Name "$Make $Model driver extract" -ScriptBlock $DriverExtractJob -ArgumentList $DriverSourceCab, $DriverExtractDest
  While ((Get-Job -Name "$Make $Model driver extract").State -eq "Running") {
  global:Write-LogEntry -Value "$($Product): Waiting for extract process to complete..  Next check in 30 seconds" -Severity 1
      Start-Sleep -Seconds 30
  }
}

Changed To:

if ($Make -eq "Dell") {
  global:Write-LogEntry -Value "$($Product): Extracting $Make drivers to $DriverExtractDest" -Severity 1
  #If the driver file is an .EXE - Extract using the command line switch 
        global:Write-LogEntry -Value "Driver Source CAB = $DriverSourceCab" -Severity 1
        If($DriverSourceCab.tolower().contains(".exe"))
        {
                global:Write-LogEntry -Value "$($Product): Driver package is an EXE - Extracting using the EXE" -Severity 1
                $DriverExtraction = Start-Process "$DriverSourceCab" -ArgumentList "/s /e=""$DriverExtractDest""" -PassThru
                $DriverExtraction.WaitForExit()
         } 
         Else 
         {
              Start-Job -Name "$Make $Model driver extract" -ScriptBlock $DriverExtractJob -ArgumentList $DriverSourceCab, $DriverExtractDest
         While ((Get-Job -Name "$Make $Model driver extract").State -eq "Running") {
           global:Write-LogEntry -Value "$($Product): Waiting for extract process to complete..  Next check in 30 seconds" -Severity 1
                Start-Sleep -Seconds 30
           }
           }
}

I was going insane thinking it was some permissions issue or something. This did the trick, thank you!

edit: You should do a pull request for this.

agbrint commented 1 year ago

+1 on the PR @MildMcHaggis where does one obtain the current PS1 these days? ;)

MiketheMaker18 commented 1 year ago

It's located in the Program Directory (Program files\Driver Automation Tool\Installation)

+1 on the PR @MildMcHaggis where does one obtain the current PS1 these days? ;)