Skip to content

Instantly share code, notes, and snippets.

@beeradmoore
Created January 15, 2023 05:02
Show Gist options
  • Save beeradmoore/bcaa63879b453c5ce824c0394d38a360 to your computer and use it in GitHub Desktop.
Save beeradmoore/bcaa63879b453c5ce824c0394d38a360 to your computer and use it in GitHub Desktop.
Parse DLL info and output as CSV. Made to look at data of DLSS dlls.
var dlssPath = "S:\\Dump\\DLSS\\DLSS zips\\";
var dlssFiles = Directory.GetFiles(dlssPath, "*.dll", SearchOption.AllDirectories);
var stringBuilder = new StringBuilder();
stringBuilder.AppendLine("Comments,CompanyName,FileBuildPart,FileDescription,FileMajorPart,FileMinorPart,FileName,FilePrivatePart,FileVersion,InternalName,IsDebug,IsPatched,IsPrivateBuild,IsPreRelease,IsSpecialBuild,Language,LegalCopyright,LegalTrademarks,OriginalFilename,PrivateBuild,ProductBuildPart,ProductMajorPart,ProductMinorPart,ProductName,ProductPrivatePart,ProductVersion,SpecialBuild");
foreach (var dlssFile in dlssFiles)
{
var fileVersionInfo = FileVersionInfo.GetVersionInfo(dlssFile);
stringBuilder.AppendLine($"{fileVersionInfo.Comments},{fileVersionInfo.CompanyName},{fileVersionInfo.FileBuildPart},{fileVersionInfo.FileDescription},{fileVersionInfo.FileMajorPart},{fileVersionInfo.FileMinorPart},{fileVersionInfo.FileName},{fileVersionInfo.FilePrivatePart},\"{fileVersionInfo.FileVersion}\",{fileVersionInfo.InternalName},{fileVersionInfo.IsDebug},{fileVersionInfo.IsPatched},{fileVersionInfo.IsPrivateBuild},{fileVersionInfo.IsPreRelease},{fileVersionInfo.IsSpecialBuild},{fileVersionInfo.Language},{fileVersionInfo.LegalCopyright},{fileVersionInfo.LegalTrademarks},{fileVersionInfo.OriginalFilename},{fileVersionInfo.PrivateBuild},{fileVersionInfo.ProductBuildPart},{fileVersionInfo.ProductMajorPart},{fileVersionInfo.ProductMinorPart},{fileVersionInfo.ProductName},{fileVersionInfo.ProductPrivatePart},\"{fileVersionInfo.ProductVersion}\",{fileVersionInfo.SpecialBuild}");
}
File.WriteAllText("test.csv", stringBuilder.ToString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment