Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oscdimg does not support long path #80

Open
LaurentLouf opened this issue Sep 18, 2024 · 8 comments
Open

oscdimg does not support long path #80

LaurentLouf opened this issue Sep 18, 2024 · 8 comments

Comments

@LaurentLouf
Copy link

Hello,

First of all thanks for the great tool, it is really helpful !

I have however stumbled upon a limitation with one of the ADK executables, oscdimg, that does not seem to support long path (> 260 characters). As an easy fix, I've tried mapping the Apps folder as a drive using the command subst. But well, what should have happened has happened and I'm still stuck with another path that is too long.

Too bad as oscdimg is a nice one-liner but I'll try with https://github.com/TheDotSource/New-ISOFile and keep you posted here.

@rbalsleyMSFT
Copy link
Owner

Can you try setting LongPath support?

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

Set LongPathsEnabled = 1 (REG_DWORD)

Let me know if that works (preferably without a reboot). If it works without a reboot, we could make the change in the script to enable it and then set it back when finished. I've actually run into issues with long paths and driver downloads (can't remember the exact problem, think BITS didn't like the length of the path or something). So it's possible this fix could help a couple of things.

@LaurentLouf
Copy link
Author

LaurentLouf commented Sep 18, 2024 via email

@rbalsleyMSFT
Copy link
Owner

rbalsleyMSFT commented Sep 18, 2024 via email

@LaurentLouf
Copy link
Author

LaurentLouf commented Sep 18, 2024 via email

@rbalsleyMSFT
Copy link
Owner

rbalsleyMSFT commented Sep 18, 2024

I think we need to do two things.

  1. Enable Long Path support
  2. Use \\?\ in front of the apps path

With just Long Path support enabled in the registry, I can get a script to create a path longer than 300 characters, but oscdimg fails to create the ISO. If I don't add the long path support, it doesn't create the complete directory path

image

If I add \\?\ in front of the directory path to generate the ISO, it works.

image

Can you try modifying the New-AppsISO function by adding:

$appsPath = "\\?\" + $appsPath #Add the \\?\ prefix to the path to allow for long file names

before

Invoke-Process $OSCDIMG "-n -m -d $Appspath $AppsISO"

Seems to create the ISO for me without an issue. I don't have any apps though with the pathing issues you do, so it'd be good to know if this works for you. If it does, I'll need to add Long Path support plus this fix.

@LaurentLouf
Copy link
Author

Well I didn't know this trick with ? but that seems to work.

By the way, I noticed that sometimes when settings $OSCDIMG, you check if we're on an amd64 architecture or ARM64, but not when creatings the Apps ISO, I guess you missed that one !

@rbalsleyMSFT rbalsleyMSFT mentioned this issue Sep 19, 2024
@rbalsleyMSFT
Copy link
Owner

Thanks, glad to hear it's working.

Are you building on ARM64 devices?

@LaurentLouf
Copy link
Author

No, just amd64

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

No branches or pull requests

2 participants