uupdump

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssembleISO

func AssembleISO(_ context.Context, esdPath string, cfg AssembleConfig) error

AssembleISO converts an ESD file into a bootable Windows installer ISO.

UUP dump ESDs typically contain 3 images:

image 1: "Windows Setup Media"   → extract to staging dir (boot files)
image 2: "WinRE / WinPE"         → export to boot.wim (boot environment)
image 3: "Windows 11 Pro" (etc.) → export to install.wim (OS image)

boot.wim gets two images (matching CrystalFetch converter):

image 1: "Microsoft Windows PE"     — WinPE recovery environment
image 2: "Microsoft Windows Setup"  — installer with setup.exe (bootable)

Traditional install ESDs may have 4+ images (images 2-3 boot, 4+ editions).

func FetchWindowsISO

func FetchWindowsISO(ctx context.Context, cfg FetchConfig) (string, error)

func SummarizeSkipped

func SummarizeSkipped(files map[string]File, keepExt string) string

SummarizeSkipped describes the files a fetch discarded, grouped by extension.

FetchWindowsISO downloads only `.esd` and drops the rest. That is consistent with what AssembleISO can consume — it turns an ESD into a bootable installer and speaks nothing else — but for the current ARM64 build it means discarding 45 of 65 files and 4.2 GB, *more than it keeps*: the cumulative update, the WSL2 prerequisite (HyperV-OptionalFeature-VirtualMachinePlatform), .NET 4.8.1, WebView2, and the FoD metadata cabs.

The decision is defensible; being silent about it is not. Without this line a build produces an image missing those payloads and says nothing, so the gap surfaces hours later inside a guest as `0x80070002 — cannot find the file specified`, which reads like a missing file path rather than a payload that was never downloaded.

Types

type APIError

type APIError struct {
	Message string
}

func (*APIError) Error

func (e *APIError) Error() string

type AssembleConfig

type AssembleConfig struct {
	WorkDir string
	ISOPath string
	Label   string
	RefESDs []string // glob patterns for reference ESD files (e.g. "/path/to/*.esd")
	LogFunc func(format string, args ...any)
}

type Build

type Build struct {
	Title   string `json:"title"`
	Build   string `json:"build"`
	Arch    string `json:"arch"`
	Created int64  `json:"created"`
	UUID    string `json:"uuid"`
}

type BuildsResponse

type BuildsResponse struct {
	APIVersion string  `json:"apiVersion"`
	Builds     []Build `json:"-"`
}

func (*BuildsResponse) UnmarshalJSON

func (br *BuildsResponse) UnmarshalJSON(data []byte) error

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opts ...Option) *Client

func (*Client) FindLatestARM64

func (c *Client) FindLatestARM64(ctx context.Context) (*Build, error)

func (*Client) GetPackage

func (c *Client) GetPackage(ctx context.Context, uuid, lang string, editions []string) (*PackageResponse, error)

func (*Client) ListBuilds

func (c *Client) ListBuilds(ctx context.Context, search string) ([]Build, error)

func (*Client) ListEditions

func (c *Client) ListEditions(ctx context.Context, uuid, lang string) (*EditionsResponse, error)

func (*Client) ListLanguages

func (c *Client) ListLanguages(ctx context.Context, uuid string) (*DetailsResponse, error)

type DetailsResponse

type DetailsResponse struct {
	APIVersion string   `json:"apiVersion"`
	UpdateName string   `json:"updateName"`
	Arch       string   `json:"arch"`
	Build      string   `json:"build"`
	LangList   []string `json:"langList"`
}

type DownloadConfig

type DownloadConfig struct {
	Dir         string
	Concurrency int
	OnProgress  ProgressFunc
	HTTPClient  *http.Client
}

type DownloadResult

type DownloadResult struct {
	Filename string
	Path     string
	Size     int64
	Err      error
}

func DownloadFiles

func DownloadFiles(ctx context.Context, files map[string]File, cfg DownloadConfig) ([]DownloadResult, error)

type EditionsResponse

type EditionsResponse struct {
	APIVersion    string   `json:"apiVersion"`
	UpdateName    string   `json:"updateName"`
	Arch          string   `json:"arch"`
	Build         string   `json:"build"`
	EditionList   []string `json:"editionList"`
	LangFancyName string   `json:"langFancyName"`
}

type FetchConfig

type FetchConfig struct {
	CacheDir    string
	Language    string
	Edition     string
	Concurrency int
	OnProgress  ProgressFunc
	LogFunc     func(format string, args ...any)
}

type File

type File struct {
	SHA1   string `json:"sha1"`
	SHA256 string `json:"sha256,omitempty"`
	Size   int64  `json:"-"`
	URL    string `json:"url"`
	UUID   string `json:"uuid"`
	Expire int64  `json:"expire"`
	Debug  string `json:"debug,omitempty"`
}

func (*File) UnmarshalJSON

func (f *File) UnmarshalJSON(data []byte) error

type Option

type Option func(*Client)

func WithBaseURL

func WithBaseURL(u string) Option

func WithHTTPClient

func WithHTTPClient(hc *http.Client) Option

type PackageResponse

type PackageResponse struct {
	APIVersion string          `json:"apiVersion"`
	UpdateName string          `json:"updateName"`
	Arch       string          `json:"arch"`
	Build      string          `json:"build"`
	SKU        int             `json:"sku"`
	HasUpdates bool            `json:"hasUpdates"`
	Files      map[string]File `json:"files"`
}

type ProgressFunc

type ProgressFunc func(filename string, bytesDownloaded, totalBytes int64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL