EC2 Windows Sysprep Failure: Notepad++ AppX Package Residue
EC2 Windows Sysprep Failure: Notepad++ AppX Package Residue
Windows instances fail Sysprep when creating an AMI, reporting error 0x80073cf2. The cause is an AppX package registered by Notepad++ 8.9+ that remains even after uninstalling the desktop version.
Symptom
Three Windows instances failed sysprep. The log at C:\Windows\System32\Sysprep\Panther\setuperr.log shows:
Error SYSPRP Package NotepadPlusPlus_1.0.0.0_neutral__2247w0b46hfww was installed for a user, but not provisioned for all users.
Error SYSPRP Failed to remove apps for the current user: 0x80073cf2.The customer had already uninstalled the Notepad++ desktop version, but sysprep still failed.
Root Cause
Notepad++ 8.9 and later register an AppX package (NotepadPlusPlus_1.0.0.0_neutral__2247w0b46hfww). Uninstalling only the desktop version does not remove the AppX package, so sysprep cannot remove the user app.
This is a known Notepad++ issue (GitHub Issue #13775).
Resolution
1. Remove the AppX package
# Remove the Notepad++ AppX package for all users
Get-AppxPackage -AllUsers *NotepadPlusPlus* | ForEach-Object {
Remove-AppxPackage -Package $_.PackageFullName -AllUsers -ErrorAction SilentlyContinue
}
# Remove the provisioned AppX package
Get-AppxProvisionedPackage -Online | Where-Object {$_.DisplayName -like "*NotepadPlusPlus*"} |
Remove-AppxProvisionedPackage -Online2. Run Sysprep
Run sysprep with EC2Launch v2 using default settings. After removing the AppX package, sysprep succeeds.
& "C:\Program Files\Amazon\EC2Launch\EC2Launch.exe" sysprepSummary
- Uninstalling only the Notepad++ desktop version does not fix the issue; the AppX package must be removed
- Avoid installing Notepad++ 8.9+ before creating a custom AMI, or validate sysprep compatibility beforehand
- Create an AMI or snapshot backup before running sysprep
