Jump to content

Packaging Application

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Zer033

Zer033

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts
Hi everyone, I have to make a program that will take a bunch of different file types and put them all into one package. For instance if I have a .txt, .wav, .jpg, .bmp, and .x then I need to package them into a .pkg file then be able to open that .pkg file up in a separate program that will display the contents of the .pkg and let the user have access to those contents.

I was thinking about designing it so that the final .exe would be put in the location with 2 other folders. One folder named "base" and one named "packaged". The base folder would have all the files that the person wanted to package and the packaged folder would be filled by the program with a .pkg which contained all the files from the "base" folder. To me this seemed like the most simple design.

The problem I am having is knowing how to package multiple files like this into my own file type.

Once I am able to make my own file type that contains all those different file types I need to make some application that will load .pkg files and allow the user to see what the .pkg contains. I think I'll be able to do that its just I'm not sure how to package multiple files into one like mentioned above.

#2
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
You need a two part file. At the beginning of the file, is a info structure and a list structure. After that, the binary data.

IE:
version{
    int major;// The three values that make the version info. <major>.<minor>.<alpha>. Some sort of version info is needed to tell the app reading it how it is stored, say if theres different revisions.
    int minor;
    int alpha;
    int filecount;//The number of files.
    char creator[255];
}
//For every file, there is an "entry" structure that helps you recreate it on the extracting machine.
entry{
   char filename[255];
   char filetype[4]; //4-character tag, IE: IMGE,TEXT,BINY.
   unsigned int length; //Length in bytes
}

After this is the contents of every file. You read them in using the length from the entry structure.


#3
Zer033

Zer033

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts
Thank you. I am going to try to get something put together, but I might need to repost to ask some more questions.

#4
Zer033

Zer033

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts
Well this assignment was changed at the last minute for my class. We no longer have to do a packaging application. I think this was done because the class never really dealt with anything like this so the students weren't prepared. I am still curious as to how to do something like this though if anyone wants to add anything it would be very informative. I am going to continue working on it myself even though it isn't an assignment any longer once I finish the assignment that replaced it which is just an essay.