maurice-daly / DriverAutomationTool

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

Paths are longer then 256 Characters. Documentation should be updated #352

Open HermanGB opened 2 years ago

HermanGB commented 2 years ago

I recently came across a driverpack from Lenovo that has a longer path then 256 characters after extraction.

The following key should be added to the client/server running the tool: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /d 1 https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd

image

Path without quotes is 264 characters. image

C:\Program Files\MSEndpointMgr\Driver Automation Tool\Temp\WimDriverFiles\Windows11-21H2-x64-202110\Audio\N2YA120W\Source\Thirdparty\Dolby\ext_bt_lenovo\ext_bt_lenovo_19h1_20h1_v5.706.830.0\BTHENUM_{000 0110b-0000-1000-8000-00805f9b34fb}_VID&0001000a_PID&ffff.xml

HermanGB commented 2 years ago

Looks like adding LongPathsEnabled and rebooting did not solve the issue above. I moved the entire install-folder to C:\DAT and is currently testing to see if this issue is resolved.

shaikh441 commented 2 years ago

Hi, Did you manage to find a resolution for this? We are having the same issue with HP packages

HermanGB commented 2 years ago

Just copy-paste the entire content of "C:\Program Files\MSEndpointMgr\Driver Automation Tool" to C:\DAT. Then simply run "C:\DAT\DriverAutomationTool.exe". This should give you about 50 characters extra. Also make sure your download path is located close to the root of the drive.

shaikh441 commented 2 years ago

Ok thanks will try that for the sources download path.

However, our packages share which connects into the SCCM package path is on a network share, so naturally that is a long path too. Will that also affect the copying of the package and would need to be relocated?

HermanGB commented 2 years ago

If the length exceeds the 256 character limit, then you might see some issues. Just checked my package share and my longest path was only 187 characters. \ServerName.fqdn\Data\Drivers\DriverPackages\HP\EliteOne 800 G4 23.8-in Healthcare Edition All-in-One Business PC\Windows10-21H2-x64-14.00 A 1\StandardPkg\DriverPackage.wim

drewcifur commented 1 year ago

The Dolby driver paths for Lenovo are getting ridiculous. Some of them for the T14 Gen3 are 230 characters long once extracted, which doesn't leave much room for UNC paths. I've tried making my path \\?\UNC\<servershare> but that didn't work. I've resorted to using a local mapped drive for now and then changing the package path manually before distributing.

Jeroen-J-Bakker commented 2 months ago

I have the same issue with some models, it is not solved yet. What I would like is at least a warning in the process log. Currently the WIM package creation continues and does not indicate in any way (Warnings/ Errors No) that there are any errors. The end result is a WIM package with some random files missing. Either there should be a very clear warning or even better the package creation is aborted. I have been able to create a package with the following workaround:


Workaround

  1. Delete the "corrupt" package from SCCM and the SCCM content source.

  2. Open the extraction directory in explorer

  3. Manually shorten the longest file paths by renaming some folders. Powershell oneliner for finding folder paths: get-childitem -Path (read-host -Prompt "Path") -Recurse -File|Select-Object fullname, @{label="length";Expression={$_.fullname.length}}|Sort-Object -Descending -Property length|ogv

  4. Restart download/ extraction/ package creation. The script will both detect that content has already been downloaded and extracted:

    • ConfigMgr: Calling content download function
    • ConfigMgr: Skipping .....exe. Content previously downloaded.
    • ConfigMgr: Calling driver extract function
    • [Skipping] - Drivers already extracted.

### Example of the long path error (with version 7.2.3): Copy-Item : Could not find a part of the path 'C:\Program Files\MSEndpointMgr\Driver Automation Tool\Temp\WimDriverFiles\Windows11-22H2-x64-202403\Audio\R29AO07W\Dolby\dax3\ext_realtek_lenovo_thinkpad\ext_thinkpad_AIO_rtk_20h1_21h2_22h2_v8.524.937.49\DEV_0257_SUBSYS_17AA22E8_PCI_SUBSYS_22E817AA_settings.xml'. At line:7023 char:6