简体   繁体   中英

Windows cabinet file for sub directories

I've a java project which has set of libraries and xml files in separate directories. But when I see cabinet file which I created it has all the files in one place (with out sub directories though I can see files). Can I create a cabinet file which includes sub folders?

If it is not possible to include directories in cabinet file, once I release cabinet file to my end user for his installation then should I need to provide INF file to him along with cabinet file?

Can any one provide sample INF file for this problem?

What is the immediate step an end user will perform once he receive cabinet file? Will he open it with IE?

To answer your first question: Yes cabints do support directores. See this blog post for example. If you use makecab as tool you can create a directive file which controls which files are zipped and into which directories (may be different ones) they are extracted. Example:

C:\temp>type files.txt
C:\temp\test1\files.txt
.Set DestinationDir=TestDir1
C:\temp\test1\test2\2.txt
.Set DestinationDir=TestDir2
C:\temp\test1\test3\2.txt

With the following command I could create the cab file

makecab /d "CabinetName1=test.cab" /f files.txt

When I open the cab with 7-Zip I can see that the file 2.txt will go to TestDir1 and TestDir2 as expected. That said why do you bother with a cab file? I your application does not need an installer you could use a zip file with much less hassle.

But if you need to create some installer I would recommend to use the WIX toolkit where you "only" need to declare what gets installed to which location in an xml file. For more infos please consult the manual . The WIX toolkit also creates the cab files needed by msi for you.

You want to distribute a java application which may be largely OS independant but the installer, if you need one, is not. Please use for each target platform the preferred installation mechanism to ensure the least amount of problems to your customers.

Yes I know this advice sucks. But deployment is also an important development activity which always was (and I fear always will be) much more complex and error prone than one might initially hope.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM