ZeroInstall.Publish.EntryPoints.WindowsExe.Analyze C# (CSharp) Method

Analyze() private method

private Analyze ( DirectoryInfo baseDirectory, FileInfo file ) : bool
baseDirectory System.IO.DirectoryInfo
file System.IO.FileInfo
return bool
        internal override bool Analyze(DirectoryInfo baseDirectory, FileInfo file)
        {
            if (!base.Analyze(baseDirectory, file)) return false;
            if (!StringUtils.EqualsIgnoreCase(file.Extension, @".exe")) return false;

            try
            {
                Parse(FileVersionInfo.GetVersionInfo(file.FullName));
                return Parse(new PEHeader(file.FullName));
            }
                #region Error handling
            catch (IOException)
            {
                return false;
            }
            #endregion
        }

Usage Example

 public void NotExe()
 {
     var candidate = new WindowsExe();
     Assert.IsFalse(candidate.Analyze(
         baseDirectory: Directory,
         file: Deploy(PosixScriptTest.Reference, xbit: false)));
 }
All Usage Examples Of ZeroInstall.Publish.EntryPoints.WindowsExe::Analyze