How can I work with CAB files

P

Pohihihi

Hello NG,

I have few assemblies that I want them to be in a cab file while deployed. Those asms are referenced in the program. How can I use cab files while running the program or in other words what should I do so that my program still runs when my distributed assemblies are combined in a cab file?

Thx,
Po
 
M

Michael Nemtsev

Hello Pohihihi,

you can managed CAB like zip archives or use CAB SDK http://download.microsoft.com/download/FlightSim2002/Install/sdk02/W982KMeXP/EN-US/Cabfile_SDK.exe
But in both cases you need to exctract you assemblies and load them dynamically

P> Hello NG,
P> I have few assemblies that I want them to be in a cab file while
P> deployed. Those asms are referenced in the program. How can I use cab
P> files while running the program or in other words what should I do so
P> that my program still runs when my distributed assemblies are
P> combined in a cab file?
P>
P> Thx,
P> Po
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
P

Pohihihi

Thanks for the reply Michael,
so what I understand is that there is no way to use those files without
extracting out from cab!!
 
N

Nicholas Paldino [.NET/C# MVP]

Not necessarily. You could create a custom host that will look in the
cab for the assemblies and load them from there. However, you should
understand that this is NOT a trivial undertaking.

There is a great example in the book "Customizing the Microsoft .NET
Framework Common Language Runtime", located at (watch for line wrap):

http://www.amazon.com/gp/product/07...ref=sr_1_1/102-1923771-6198568?_encoding=UTF8

In this example, the author shows how to store assemblies in a OLE
structured file, and load them from there when needed. As a matter of fact,
this is similar to how SQL Server now hosts the CLR and loads the assemblies
from the database itself.

The book was written for .NET 1.1, and I don't believe it was updated
for 2.0 (it's possible that it was, considering the gestation period for
2.0), but if you want to keep your assemblies in a CAB file and load them
from there, this is definitely the way you want to go.

Hope this helps.
 
P

Pohihihi

thank you.



Nicholas Paldino said:
Not necessarily. You could create a custom host that will look in the
cab for the assemblies and load them from there. However, you should
understand that this is NOT a trivial undertaking.

There is a great example in the book "Customizing the Microsoft .NET
Framework Common Language Runtime", located at (watch for line wrap):

http://www.amazon.com/gp/product/07...ref=sr_1_1/102-1923771-6198568?_encoding=UTF8

In this example, the author shows how to store assemblies in a OLE
structured file, and load them from there when needed. As a matter of
fact, this is similar to how SQL Server now hosts the CLR and loads the
assemblies from the database itself.

The book was written for .NET 1.1, and I don't believe it was updated
for 2.0 (it's possible that it was, considering the gestation period for
2.0), but if you want to keep your assemblies in a CAB file and load them
from there, this is definitely the way you want to go.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Pohihihi said:
Thanks for the reply Michael,
so what I understand is that there is no way to use those files without
extracting out from cab!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top