6

I want to generate a .cab File

How can I do it?

I am developing in C# (visual studio 2008, .NET Framework 3.5) I can ganerate the .exe file, but how can I generate the .cab?

Jean
  • 593
  • 2
  • 6
  • 19
  • 5
    Maybe you can tell us what you are trying to achieve. Building a cab file on it#s own is not very useful and there is better solutions for most of the cases where it would be. – nvoigt Sep 26 '13 at 18:22
  • 2
    Easiest thing to do these days is to shell it out to `iexpress.exe`. – vcsjones Sep 26 '13 at 18:23
  • What do you exactly want to do?? you can Deploy CAB Files Using ClickOnce Deployment – KF2 Sep 26 '13 at 18:29
  • 4
    Call [makecab](http://technet.microsoft.com/en-us/library/hh875545(v=ws.10).aspx) via MSBuild (if part of build) or `Process.Start` if it is from your code. – Alexei Levenkov Sep 26 '13 at 18:30
  • I have already my app but I want to install it on a barcode reader. I Can't put a `.exe` file there. I need a `.cab` How Can I do it? I read [it][1] [1]:http://msdn.microsoft.com/en-us/library/1b8fd8ss(v=vs.80).aspx but I don't understand so much – Jean Sep 26 '13 at 19:04
  • 2
    @vcsjones I did it! Thank You so much! You Rule! [look it] (http://yolosolucionoasi.blogspot.mx/2010/04/crearmodificar-archivo-cab.html) – Jean Sep 26 '13 at 20:54
  • I followed the steps [here](http://yolosolucionoasi.blogspot.mx/2010/04/crearmodificar-archivo-cab.html) It really helps. It's very useful – Jean Sep 27 '13 at 14:36

1 Answers1

0

Microsoft has example C++ code to generate a .CAB file at https://msdn.microsoft.com/en-us/library/ff797926(v=vs.85).aspx. This sample uses Win32 Cabinet API functions (FCICreate, FCIAddFile, etc)...you can P/Invoke from C# to call these same APIs.

ReflexiveCode
  • 256
  • 3
  • 7