private static bool SetProductVersionDWORD(VS_VERSIONINFO versionInfo, Version version) { var versionMS = version.GetVersionMS(); var versionLS = version.GetVersionLS(); if (versionInfo.Value.dwProductVersionMS == versionMS && versionInfo.Value.dwProductVersionLS == versionLS) return false; versionInfo.Value.dwProductVersionMS = versionMS; versionInfo.Value.dwProductVersionLS = versionLS; return true; }
private static bool SetProductVersionDWORD(VS_VERSIONINFO versionInfo, Version version) { var versionMS = version.GetVersionMS(); var versionLS = version.GetVersionLS(); if (versionInfo.Value.dwProductVersionMS == versionMS && versionInfo.Value.dwProductVersionLS == versionLS) { return(false); } versionInfo.Value.dwProductVersionMS = versionMS; versionInfo.Value.dwProductVersionLS = versionLS; return(true); }
public VS_VERSIONINFO(BinaryReader reader) { VS_VERSIONINFO hdr = new VS_VERSIONINFO(); this = hdr; byte[] buffer = new byte[Marshal.SizeOf(this)]; reader.Read(buffer, 0, buffer.Length); hdr = buffer.ToStructure <VS_VERSIONINFO>(); //hdr.Value.FileVersion = hdr.Value.FileVersion.ReverseBytes(); //hdr.Value.ProductVersion = hdr.Value.ProductVersion.ReverseBytes(); //hdr.Value.TimeStamp =hdr.Value.TimeStamp.ReverseBytes(); this = hdr; }
private void ClearLengths(VS_VERSIONINFO i) { ClearHeader(i); foreach (var c in i.Children) { var sfi = c as StringFileInfo; if (sfi != null) { ClearLengths(sfi); } var vsfi = c as VarFileInfo; if (vsfi != null) { ClearLengths(vsfi); } } }
public FileVersionInfo(byte[] buffer) { // Constructor _ms = new MemoryStream(buffer); // VS_VERSION_INFO byte[] pattern = Encoding.Unicode.GetBytes("VS_VERSION_INFO"); long pos = Search.IndexOf(buffer, pattern); if (pos == -1) { return; // No VersionInfo found } _ms.Position = pos - 6; // setup the correct offset vi = new VS_VERSIONINFO(new BinaryReader(_ms)); //_ms.Position -= 6; //VarFileInfo sfi = new VarFileInfo(new BinaryReader(_ms)); }
private static bool SetVersionString(VS_VERSIONINFO versionInfo, string versionName, string value) { return versionInfo.Children.OfType<StringFileInfo>().Select(f => SetVersionString(f, versionName, value)).AnyOfAll(); }
private static bool SetVersionString(VS_VERSIONINFO versionInfo, string versionName, string value) { return(versionInfo.Children.OfType <StringFileInfo>().Select(f => SetVersionString(f, versionName, value)).AnyOfAll()); }
private static bool ProcessStringsInVersion(VS_VERSIONINFO version, Func<string, string> process) { return version.Children.OfType<StringFileInfo>().Select(info => ProcessStringsInStringFileInfo(info, process)).AnyOfAll(); }
private static bool ProcessStringsInVersion(VS_VERSIONINFO version, Func <string, string> process) { return(version.Children.OfType <StringFileInfo>().Select(info => ProcessStringsInStringFileInfo(info, process)).AnyOfAll()); }