어떤 MSI가 내 시스템에 파일을 생성했는지 알 수 있는 방법이 있나요?

어떤 MSI가 내 시스템에 파일을 생성했는지 알 수 있는 방법이 있나요?

내 시스템에 Windows 설치 프로그램을 통해 저장한 파일이 있지만 어떤 파일인지 잘 모르겠습니다(이 경우에는 Microsoft SQL Server의 여러 하위 설치 프로그램 중 하나였습니다).

해당 파일을 설치 프로그램에 다시 연결하여 제거할 수 있도록 쿼리할 수 있는 것이 있습니까?

답변1

MSI 설치 프로그램에 대한 모든 개별 파일을 추적할 수는 없다고 생각합니다. 그러나 MSI가 이 레지스트리 키에 입력한 경우 설치 위치를 추적할 수 있습니다.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]

여기에 도움이 될 수 있는 스크립트가 있습니다.

#Get MOF File Method
$mof = @'
#PRAGMA AUTORECOVER

[dynamic, provider("RegProv"),
ProviderClsid("{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}"),ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall")]
class InstalledProducts {
[key] string KeyName;
[read, propertycontext("DisplayName")] string DisplayName;
[read, propertycontext("DisplayVersion")] string DisplayVersion;
[read, propertycontext("InstallDate")] string InstallDate;
[read, propertycontext("InstallLocation")] string InstallLocation;
[read, propertycontext("InstallSource")] string InstallSource;
[read, propertycontext("Publisher")] string Publisher;
[read, propertycontext("EstimatedSize")] string EstimatedSize;
[read, propertycontext("UninstallString")] string UninstallString;
[read, propertycontext("WindowsInstaller")] string WindowsInstaller;
};

[dynamic, provider("RegProv"),
ProviderClsid("{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}"),ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432node\\Microsoft\\Windows\\CurrentVersion\\Uninstall")]
class InstalledProducts32 {
[key] string KeyName;
[read, propertycontext("DisplayName")] string DisplayName;
[read, propertycontext("DisplayVersion")] string DisplayVersion;
[read, propertycontext("InstallDate")] string InstallDate;
[read, propertycontext("InstallLocation")] string InstallLocation;
[read, propertycontext("InstallSource")] string InstallSource;
[read, propertycontext("Publisher")] string Publisher;
[read, propertycontext("EstimatedSize")] string EstimatedSize;
[read, propertycontext("UninstallString")] string UninstallString;
[read, propertycontext("WindowsInstaller")] string WindowsInstaller;
};
'@
$mof | Out-file -encoding ascii $env:TMP\InstalledProductsMof.txt -Force
mofcomp.exe $env:TMP\InstalledProductsMof.txt 

Get-WmiObject -Namespace root\default -class InstalledProducts | Select DisplayName,DisplayVersion,InstallDate,InstallLocation, InstallSource,Publisher,EstimatedSize,UninstallString,WindowsInstaller 

# CLEAN-UP: Remove the WMI Classes you just created

Remove-WmiObject -Namespace root\default -class InstalledProducts 
Remove-WmiObject -Namespace root\default -class InstalledProducts32 

관련 정보