memstechtips/Winhance · error · FileNotFoundException
UEFI boot file not found: {efisysPath}
Error message
UEFI boot file not found: {efisysPath} What it means
FileNotFoundException thrown during bootable ISO creation when efi\microsoft\boot\efisys.bin is missing from the working directory. efisys.bin is the UEFI El Torito boot image (the EFI System Partition fat image) embedded via the `#pEF,e,b` oscdimg segment; without it the ISO cannot boot under UEFI firmware.
Source
Thrown at src/Winhance.Infrastructure/Features/AdvancedTools/Services/IsoService.cs:311
var requiredSpace = workingDirSize + (2L * 1024 * 1024 * 1024);
await _dismProcessRunner.CheckDiskSpaceAsync(outputPath, requiredSpace, "ISO creation").ConfigureAwait(false);
progress?.Report(new TaskProgressDetail
{
StatusText = _localization.GetString("Progress_CreatingBootableIso"),
TerminalOutput = $"Output: {outputPath}"
});
var efisysPath = _fileSystemService.CombinePath(workingDirectory, "efi", "microsoft", "boot", "efisys.bin");
var etfsbootPath = _fileSystemService.CombinePath(workingDirectory, "boot", "etfsboot.com");
if (!_fileSystemService.FileExists(etfsbootPath))
throw new FileNotFoundException($"Boot file not found: {etfsbootPath}");
if (!_fileSystemService.FileExists(efisysPath))
throw new FileNotFoundException($"UEFI boot file not found: {efisysPath}");
var outputDir = _fileSystemService.GetDirectoryName(outputPath);
if (!string.IsNullOrEmpty(outputDir) && !_fileSystemService.DirectoryExists(outputDir))
_fileSystemService.CreateDirectory(outputDir);
if (_fileSystemService.FileExists(outputPath))
{
_fileSystemService.DeleteFile(outputPath);
_logService.LogInformation("Removed existing ISO file");
}
var arguments = $"-m -o -u2 -udfver102 -bootdata:2#p0,e,b\"{etfsbootPath}\"#pEF,e,b\"{efisysPath}\" \"{workingDirectory}\" \"{outputPath}\"";
progress?.Report(new TaskProgressDetail
{
TerminalOutput = "Running oscdimg.exe...\nThis may take several minutes..."
});
View on GitHub (pinned to f23d554eb2)
Solutions
- Confirm the source media has \efi\microsoft\boot\efisys.bin and re-stage including the whole \efi tree.
- Copy efisys.bin from a matching-architecture Windows ISO into <workingDirectory>/efi/microsoft/boot/.
- If you only need legacy boot, switch to a single-boot oscdimg command (drop the #pEF segment) instead of failing.
- For ARM64 builds, locate the correct efisys file for that architecture and point the command at it.
- Check antivirus quarantine for efisys.bin.
Example fix
// before
if (!_fileSystemService.FileExists(efisysPath))
throw new FileNotFoundException($"UEFI boot file not found: {efisysPath}");
// after: fall back to a legacy-only bootable ISO when UEFI file is absent
var useUefi = _fileSystemService.FileExists(efisysPath);
var bootData = useUefi
? $"2#p0,e,b\"{etfsbootPath}\"#pEF,e,b\"{efisysPath}\""
: $"1#pEF,e,b\"{etfsbootPath}\""; Defensive patterns
Strategy: validation
Validate before calling
bool HasUefiBoot(string workingDirectory)
{
var efisys = _fileSystemService.CombinePath(workingDirectory, "efi", "microsoft", "boot", "efisys.bin");
return _fileSystemService.FileExists(efisys);
} Try / catch
catch (System.IO.FileNotFoundException ex) when (ex.Message.Contains("efisys.bin"))
{
// Offer the user a legacy-only ISO (drop the #pEF oscdimg segment) or re-stage including the \\efi tree.
} Prevention
- Copy the entire source \efi tree into the working directory during staging.
- For ARM64 builds, locate the architecture-appropriate efisys file rather than assuming efisys.bin.
- Add the staging folder to antivirus exclusions so efisys.bin is not quarantined.
When it happens
Trigger: CreateBootableIsoAsync runs after staging, but efi\microsoft\boot\efisys.bin was not copied. Source media is a legacy-BIOS-only install, the EFI folder was excluded during staging, or the architecture (e.g. ARM64) uses a different efisys filename.
Common situations: Source media predates UEFI or is a custom WIM that dropped the efi tree. Staging step copied only \sources and \boot, omitting \efi. User targeted an ARM64/ARM64X build where the file is named efisys_*.bin. Antivirus flagged efisys.bin.
Related errors
- Boot file not found: {etfsbootPath}
- Could not delete the existing working directory '{workingDir
- oscdimg.exe failed with exit code: {exitCode}
- DISM failed with exit code: {exitCode}
- Insufficient disk space on {driveName} for {operationName}.
AI-assisted analysis of memstechtips/Winhance@f23d554eb2 (2026-08-13).
Data as JSON: /api/errors/6ea6e35513242e4c.
Report an issue: GitHub.