Exemplo n.º 1
0
 private static bool hasIcons(string exeFilename)
 {
     // Console.WriteLine($"Checking for icons in {exeFilename}");
     using PortableExecutableImage exeFile = PortableExecutableImage.FromFile(exeFilename);
     try {
         ResourceCollection?resourceCollection = ResourceCollection.Get(exeFile);
         return(resourceCollection?.Any(type => type.Id == ResourceType.GroupIcon) ?? false);
     } catch (TargetInvocationException) {
         Console.WriteLine($"Failed to parse icon resources in {exeFilename}");
         return(false);
     }
 }