File Version and other details not preserved on RAR extraction #443

Open
opened 2026-01-29 22:12:10 +00:00 by claunia · 1 comment
Owner

Originally created by @noeltupas on GitHub (Mar 20, 2021).

	static void Main(string[] args)
	{
		string rarFile = @"\\myserver\D\at\Builds\61.1.21078.1\test.rar";
		string dllTargetFilePath = @"\\myserver\D\at\Builds\61.1.21078.1\target.dll";

		using (var archive = RarArchive.Open(rarFile))
		{
			foreach(var entry in archive.Entries.Where(entry => !entry.IsDirectory && entry.Key.EndsWith("target.dll")))
			{
				entry.WriteToFile(dllTargetFilePath, new ExtractionOptions { ExtractFullPath = false });
			}
		}

		FileVersionInfo dllInfo = FileVersionInfo.GetVersionInfo(dllTargetFilePath);

		Console.WriteLine(dllInfo.FileVersion);
		Console.WriteLine(dllInfo.ToString());
		Console.WriteLine(dllInfo.FileDescription);
	}

image

But when I manually extract the file and examine its details:

image

I am in need of the file version....

Originally created by @noeltupas on GitHub (Mar 20, 2021). static void Main(string[] args) { string rarFile = @"\\myserver\D\at\Builds\61.1.21078.1\test.rar"; string dllTargetFilePath = @"\\myserver\D\at\Builds\61.1.21078.1\target.dll"; using (var archive = RarArchive.Open(rarFile)) { foreach(var entry in archive.Entries.Where(entry => !entry.IsDirectory && entry.Key.EndsWith("target.dll"))) { entry.WriteToFile(dllTargetFilePath, new ExtractionOptions { ExtractFullPath = false }); } } FileVersionInfo dllInfo = FileVersionInfo.GetVersionInfo(dllTargetFilePath); Console.WriteLine(dllInfo.FileVersion); Console.WriteLine(dllInfo.ToString()); Console.WriteLine(dllInfo.FileDescription); } ![image](https://user-images.githubusercontent.com/7140799/111887272-11fd2c80-8991-11eb-9276-38d09ad50847.png) But when I manually extract the file and examine its details: ![image](https://user-images.githubusercontent.com/7140799/111887309-643e4d80-8991-11eb-80d5-b927724e9f23.png) I am in need of the file version....
Author
Owner

@adamhathcock commented on GitHub (Mar 31, 2021):

Can you see the information you need on the Entry objects and manually set them?

If the information is there, it can be added as a PR.

@adamhathcock commented on GitHub (Mar 31, 2021): Can you see the information you need on the Entry objects and manually set them? If the information is there, it can be added as a PR.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#443