Skip to content

Request: Auto-detect Oscdimg.exe from Windows ADK #310

@forderud

Description

@forderud

There seem to be logic in this repo for calling Oscdimg.exe for ISO-file creation on Windows when the cd_files command is used. This is good, but seem to require that Oscdimg.exe is already in PATH - or else packer will fail.

Request: Could it be possible to somehow auto-detect Windows ADK installations with Oscdimg.exe, so that users doesn't need to add the tool to PATH before calling packer?

Locating Oscdimg

Oscdimg.exe is installed to C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg on my Win11 machine. However, the "Windows Kits" path prefix may differ between machines, so you probably don't want to hardcode it. There's fortunately a HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot10 registry key that seem to contain the "Windows Kits" installation path prefix. Combining the "KitsRoot10" registry key with "Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg" will likely be a fairly robust way of locating the Oscdimg installation path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions