|
these were simple changes to make.
we added the m_strFileVersion member to the TlbImpOptions class, just implemented it to use the same File Version number from the source file:
We made modifications to the ParseArguments function in tlbimp.cs:
// if the fileversion wasn't given, use the version number of the input file
if (Options.m_strFileVersion == null)
{
// get the fileversion
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(Options.m_strTypeLibName);
Options.m_strFileVersion = versionInfo.FileVersion;
}
We also modified the DoImport function in tlbimpcode.cs to pass the file version string, and generate the new attribute:
if (!String.IsNullOrEmpty(strFileVersion))
{
CustomAttributeBuilder wb = new CustomAttributeBuilder(typeof(System.Reflection.AssemblyFileVersionAttribute).GetConstructor(new Type[] { typeof(string) }), new object[] { strFileVersion });
AsmBldr.SetCustomAttribute(wb);
}
the same could be done for the product number, and i guess you could implement it to accept a value on the command line. this was beyond what we needed to do, so we didn't!
Tim.
|