.Cab files.. is there an answer
Hi
I was wondering if anyone out there could give me a firm poke in the right direction for what I am trying to do.
I am trying to simply unpack, edit and then put files back into .cab files
I have had a good look online and everything appears to be quite confusing on the matter and also quite dated and was wondering if I have missed a trick somewhere along the way
Many thanks
Ben
Kirtan PatelPosted Nov 17, 2009, 7:21 AM
please check "do you like this answer check box " if my answer helps you :)
Download wix3.0 and Install it
then you will have new dll
Microsoft.Deployment.Compression
and Microsoft.Deployment.Compression.Cab
in Project>>Add Refernce>>.net tab
add reference to those dll 's in your application and then
Write Code like below
using Microsoft.Deployment.Compression.Cab;
//Create cab files
CabInfo cab = new CabInfo(@"C:\Work\Files\My.cab");
cab.Pack(@"C:\Work\Cab");
//Extract cab files
CabInfo cabInfo = new CabInfo(@"C:\Work\cab");
foreach (CabFileInfo fileInfo in cabInfo.GetFiles())
{
MessageBox.Show(String.Format("File Name = {0}, Size = {1}",fileInfo.Name, fileInfo.Length));
}ben gotchPosted Nov 17, 2009, 4:20 AM
Thus its not actually a deployment file I am after, I need to actively work with many different instances of .cab files removing and adding different files to them :)
many thanks Ben
Sam HobbsPosted Nov 16, 2009, 9:11 PM
- Visual Studio: Deploying Applications and Components
- .NET Framework Developer's Guide: Deploying .NET Framework Applications
- Visual C#: Deploying C# Applications
- SDK: Windows Installer
It depends on what you need the cabinet file for. When you create a deployment project, the project output might include a cabinet file. I forget the details, but it might be as simple as creating a deployment project and VS will do the rest for you.If that does not help then there more places to look but it would take more time to find them. let me know if you need more assistance.