I’m creating an installer and there are some resource files (.xmls, .zip files, a .jar file, etc) that must be read during installation, but I’d like to pack them into a custom file (i.e., a .dat file) so that when distributed, users don’t get to mess around with them too much. The problem is that the installer must be written in Java and I’ve never done this sort of thing before in any programming language. Is it even possible? If so, how can I pack it in a way that can be read by my Java app afterwards and how can I make my Java app read it?
I’m creating an installer and there are some resource files (.xmls, .zip files, a
Share
The extension usually have very little to do with how the file is interpreted.
If you’d like to have just
config.datinstead ofconfig.xmlyou just rename the file. (You’d typically give an xml-parser anInputStreamor aReaderas input, which may read any file, regardless of extension)If the problem you’re describing is about combining multiple files, (.zip, .jar, etc) into a single .dat file, you could for instance zip them together, and name the zip file with a .dat extension. Java has good support for zip-files and can handle the zip file regardless of filename / extension.