Microsoft MVP성태의 닷넷 이야기
Windows: 201. Windows - INF 파일을 이용한 장치 제거 방법 [링크 복사], [링크+제목 복사]
조회: 6761
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

Windows - INF 파일을 이용한 장치 제거 방법

Windows 11로 업데이트를 하는 중에, "C:\$WINDOWS.~BT\Sources\Panther" 디렉터리에 생성되는 "CompatData_[날짜_시간].xml" 파일에 다음의 내용이 있습니다.

<?xml version="1.0" encoding="utf-8"?>
<CompatReport xmlns="http://www.microsoft.com/ApplicationExperience/UpgradeAdvisor/01012009" MigXmlFile="FIuAiWjNpESBtTb8.9.24.0.0_APPRAISER_Migration.xml"><System X64Capable="True" X64Running="True"/><Hardware><HardwareItem HardwareType="Setup_BitlockerNoTargetSupport"><CompatibilityInfo BlockingType="None"/></HardwareItem><HardwareItem HardwareType="Setup_TargetIsNonStagedBuild"><CompatibilityInfo BlockingType="None"/></HardwareItem><HardwareItem HardwareType="Setup_LanguagePackDetected"><CompatibilityInfo BlockingType="None"/></HardwareItem><HardwareItem HardwareType="Setup_LicenseActivation"><CompatibilityInfo BlockingType="None"/></HardwareItem><HardwareItem HardwareType="Setup_FeaturesOnDemandDetected"><CompatibilityInfo BlockingType="None"/></HardwareItem><HardwareItem HardwareType="Setup_FlightSigningEnabled"><CompatibilityInfo BlockingType="None"/></HardwareItem><HardwareItem HardwareType="Setup_SecureBoot"><CompatibilityInfo BlockingType="None"/></HardwareItem><HardwareItem HardwareType="Generic">
            <CompatibilityInfo BlockingType="Hard" Message="Your PC has hardware that isn't ready for this version of Windows. Windows Update will automatically offer you this version of Windows once the issue has been resolved." Title="This PC can't be upgraded to this version of Windows."/>
            <Link Target="https://go.microsoft.com/fwlink/?LinkId=2183543" Value="Learn More"/>
        </HardwareItem>
    </Hardware><SystemInfo UplevelEdition="Windows 10" OSMajorVersion="10" OSMinorVersion="0"/>
    <Devices/>
    <DriverPackages>
        <DriverPackage Inf="oem51.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem50.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem6.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem38.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem37.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem49.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem17.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem19.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem53.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem52.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem26.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem40.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem11.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem1.inf" BlockMigration="True" HasSignedBinaries="False"/>
        <DriverPackage Inf="oem0.inf" BlockMigration="True" HasSignedBinaries="False"/>
        <DriverPackage Inf="oem33.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem7.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem41.inf" BlockMigration="False" HasSignedBinaries="True"/>
        <DriverPackage Inf="oem10.inf" BlockMigration="False" HasSignedBinaries="True"/>
    </DriverPackages>
    <Programs/>
</CompatReport>

해당 INF 장치를 확인해 보면, 각각 "Microsoft Print To PDF", "Microsoft XPS Document Writer v4"로 별거 아닌 듯합니다. 하지만 그래도 BlockMigration 조건에 걸린다고 하니 찝찝해서 제거를 하고 싶었는데요, 검색해보면 아래의 글이 나옵니다.

Uninstalling inf files related to a driver file
; https://www.codeproject.com/Articles/440648/Uninstalling-inf-files-related-to-a-driver-file

setupapi.dll을 이용하는 방법인데요, 가령 다음과 같이 실행했더니,

c:\temp> RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultUninstall 132 C:\Windows\INF\oem0.inf

"Installation failed." 창이 뜹니다. 음... 가만 보니까 일반 사용자 권한으로 했군요. ^^ 다시 "관리자 권한"의 cmd.exe에서 실행하면 아무런 오류 메시지 없이, 그렇다고 성공 메시지도 없이 끝났습니다.

그런데, 실제로 해당 INF 파일은 그대로 있습니다. 게다가 윈도우 11 업그레이드를 다시 시도했더니 여전히 compat xml 파일에는 저 내용이 그대로 있었습니다. 그래서 다른 방법을 찾아봤는데요, pnputil.exe 사용법이 나오는군요. ^^

pnputil
; https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/pnputil

그래서 2개의 inf 파일을 다음의 명령어로 삭제했습니다.

C:\Windows\System32> pnputil -f -d oem0.inf
Microsoft PnP Utility

Driver package deleted successfully.


C:\Windows\System32> pnputil -f -d oem1.inf
Microsoft PnP Utility

Driver package deleted successfully.

이후로 compat xml에 저 항목은 더 이상 보이지 않는 걸로 봐서 삭제는 잘 되었습니다. 그래도 윈도우 11 업그레이드는 실패하는데요, 일단 INF 파일을 이용한 장치 제거를 할 수 있다는 것에 만족해야겠습니다. ^^





[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 3/31/2022]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




1  2  [3]  4  5  6  7  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13556정성태2/17/20241826Windows: 257. Windows - Symbolic (hard/soft) Link 및 Junction 차이점
13555정성태2/15/20241969닷넷: 2216. C# - SemaphoreSlim 사용 시 주의점
13554정성태2/15/20241714VS.NET IDE: 189. Visual Studio - 닷넷 소스코드 디컴파일 찾기가 안 될 때
13553정성태2/14/20241786닷넷: 2215. windbg - thin/fat lock 없이 동작하는 Monitor.Wait + Pulse
13552정성태2/13/20241742닷넷: 2214. windbg - Monitor.Enter의 thin lock과 fat lock
13551정성태2/12/20242060닷넷: 2213. ASP.NET/Core 웹 응용 프로그램 - 2차 스레드의 예외로 인한 비정상 종료
13550정성태2/11/20242157Windows: 256. C# - Server socket이 닫히면 Accept 시켰던 자식 소켓이 닫힐까요?
13549정성태2/3/20242486개발 환경 구성: 706. C# - 컨테이너에서 실행하기 위한 (소켓) 콘솔 프로젝트 구성
13548정성태2/1/20242317개발 환경 구성: 705. "Docker Desktop for Windows" - ASP.NET Core 응용 프로그램의 소켓 주소 바인딩(IPv4/IPv6 loopback, Any)
13547정성태1/31/20242063개발 환경 구성: 704. Visual Studio - .NET 8 프로젝트부터 dockerfile에 추가된 "USER app" 설정
13546정성태1/30/20241920Windows: 255. (디버거의 영향 등으로) 대상 프로세스가 멈추면 Socket KeepAlive로 연결이 끊길까요?
13545정성태1/30/20241839닷넷: 2212. ASP.NET Core - 우선순위에 따른 HTTP/HTTPS 호스트:포트 바인딩 방법
13544정성태1/30/20241851오류 유형: 894. Microsoft.Data.SqlClient - Could not load file or assembly 'System.Security.Permissions, ...'
13543정성태1/30/20241847Windows: 254. Windows - 기본 사용 중인 5357 포트 비활성화는 방법
13542정성태1/30/20241880오류 유형: 893. Visual Studio - Web Application을 실행하지 못하는 IISExpress - 두 번째 이야기
13541정성태1/29/20241927VS.NET IDE: 188. launchSettings.json의 useSSL 옵션
13540정성태1/29/20242056Linux: 69. 리눅스 - "Docker Desktop for Windows" Container 환경에서 IPv6 Loopback Address 바인딩 오류
13539정성태1/26/20242151개발 환경 구성: 703. Visual Studio - launchSettings.json을 이용한 HTTP/HTTPS 포트 바인딩
13538정성태1/25/20242218닷넷: 2211. C# - NonGC(FOH) 영역에 .NET 개체를 생성파일 다운로드1
13537정성태1/24/20242272닷넷: 2210. C# - Native 메모리에 .NET 개체를 생성파일 다운로드1
13536정성태1/23/20242381닷넷: 2209. .NET 8 - NonGC Heap / FOH (Frozen Object Heap) [1]
13535정성태1/22/20242215닷넷: 2208. C# - GCHandle 구조체의 메모리 분석
13534정성태1/21/20242066닷넷: 2207. C# - SQL Server DB를 bacpac으로 Export/Import파일 다운로드1
13533정성태1/18/20242272닷넷: 2206. C# - TCP KeepAlive의 서버 측 구현파일 다운로드1
13532정성태1/17/20242171닷넷: 2205. C# - SuperSimpleTcp 사용 시 주의할 점파일 다운로드1
13531정성태1/16/20242058닷넷: 2204. C# - TCP KeepAlive에 새로 추가된 Retry 옵션파일 다운로드1
1  2  [3]  4  5  6  7  8  9  10  11  12  13  14  15  ...