Microsoft MVP성태의 닷넷 이야기
Windows: 201. Windows - INF 파일을 이용한 장치 제거 방법 [링크 복사], [링크+제목 복사]
조회: 6758
글쓴 사람
정성태 (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)
13276정성태3/5/20234402.NET Framework: 2102. C# 11 - ref struct/ref field를 위해 새롭게 도입된 scoped 예약어
13275정성태3/3/20234728.NET Framework: 2101. C# 11의 ref 필드 설명
13274정성태3/2/20234299.NET Framework: 2100. C# - ref 필드로 ref struct 타입을 허용하지 않는 이유
13273정성태2/28/20234015.NET Framework: 2099. C# - 관리 포인터로서의 ref 예약어 의미
13272정성태2/27/20234288오류 유형: 850. SSMS - mdf 파일을 Attach 시킬 때 Operating system error 5: "5(Access is denied.)" 에러
13271정성태2/25/20234201오류 유형: 849. Sql Server Configuration Manager가 시작 메뉴에 없는 경우
13270정성태2/24/20233826.NET Framework: 2098. dotnet build에 /p 옵션을 적용 시 유의점
13269정성태2/23/20234363스크립트: 46. 파이썬 - uvicorn의 콘솔 출력을 UDP로 전송
13268정성태2/22/20234915개발 환경 구성: 667. WSL 2 내부에서 열고 있는 UDP 서버를 호스트 측에서 접속하는 방법
13267정성태2/21/20234820.NET Framework: 2097. C# - 비동기 소켓 사용 시 메모리 해제가 finalizer 단계에서 발생하는 사례파일 다운로드1
13266정성태2/20/20234445오류 유형: 848. .NET Core/5+ - Process terminated. Couldn't find a valid ICU package installed on the system
13265정성태2/18/20234365.NET Framework: 2096. .NET Core/5+ - PublishSingleFile 유형에 대한 runtimeconfig.json 설정
13264정성태2/17/20235848스크립트: 45. 파이썬 - uvicorn 사용자 정의 Logger 작성
13263정성태2/16/20234008개발 환경 구성: 666. 최신 버전의 ilasm.exe/ildasm.exe 사용하는 방법
13262정성태2/15/20235073디버깅 기술: 191. dnSpy를 이용한 (소스 코드가 없는) 닷넷 응용 프로그램 디버깅 방법 [1]
13261정성태2/15/20234360Windows: 224. Visual Studio - 영문 폰트가 Fullwidth Latin Character로 바뀌는 문제
13260정성태2/14/20234153오류 유형: 847. ilasm.exe 컴파일 오류 - error : syntax error at token '-' in ... -inf
13259정성태2/14/20234291.NET Framework: 2095. C# - .NET5부터 도입된 CollectionsMarshal
13258정성태2/13/20234173오류 유형: 846. .NET Framework 4.8 Developer Pack 설치 실패 - 0x81f40001
13257정성태2/13/20234266.NET Framework: 2094. C# - Job에 Process 포함하는 방법 [1]파일 다운로드1
13256정성태2/10/20235100개발 환경 구성: 665. WSL 2의 네트워크 통신 방법 - 두 번째 이야기
13255정성태2/10/20234422오류 유형: 845. gihub - windows2022 이미지에서 .NET Framework 4.5.2 미만의 프로젝트에 대한 빌드 오류
13254정성태2/10/20234320Windows: 223. (WMI 쿼리를 위한) PowerShell 문자열 escape 처리
13253정성태2/9/20235107Windows: 222. C# - 다른 윈도우 프로그램이 실행되었음을 인식하는 방법파일 다운로드1
13252정성태2/9/20233919오류 유형: 844. ssh로 명령어 수행 시 멈춤 현상
13251정성태2/8/20234384스크립트: 44. 파이썬의 3가지 스레드 ID
1  2  3  4  5  6  7  8  9  10  11  12  13  [14]  15  ...