hashicorp / hashicorp/packer-plugin-sdk

Request: Auto-detect Oscdimg.exe from Windows ADK

Open
#310 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
42
Forks
62
Avg merge
29m
Merged PRs (30d)
2

Description

There seem to be logic in this repo for [calling Oscdimg.exe](https://github.com/hashicorp/packer-plugin-sdk/blob/main/multistep/commonsteps/step_create_cdrom.go#L172) for ISO-file creation on Windows when the [`cd_files`](https://developer.hashicorp.com/packer/integrations/hashicorp/hyperv/latest/components/builder/iso#cd-configuration-reference) 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.