BSPPack - ending your packaging worries? [UPDATED]

Forum for Skins, Maps, Configs etc.

Moderators: Moderators, Mappers

NRGizeR
feels some chest pain
Posts: 695
Joined: Mon Aug 30, 2004 1:00 am
Location: fi
Contact:

Post by NRGizeR »

Hmm... just had a look at the code, and I can't really see how to do this differently, and I also tried to compare the listings of a "regular" .zip file and one created with bsppack, and they both look identical to me (both have entries for folders as well, and not only files) I guess the directory entries could, in principal, be removed, but if I remember correctly, I tried this and it doesn't work.

This is the actual function that compresses the files...

oh, and to you coders, before you say anything, I know, I know, big no no to have files as a classglobal variable :) I was still learning code design when writing this :) then again, I still am ;)

Code: Select all

   protected void compressFiles(File zip) throws IOException
   {
      ZipOutputStream zo = new ZipOutputStream(new FileOutputStream(zip));

      for (int i = 0; i<files.size(); i++)
      {
         byte b[] = new byte[512];
         FileHolder fh = (FileHolder) files.get(i);
         fh.setName(fh.getName().replace(File.separatorChar, '/'));

         /* NOTE!!!!! it seems as if linux doesn't search for the correct cased names after
          * all, but tried to find the lower case versions of the needed files... therefore,
          * the .toLowerCase() will make sure that the all files in the .zip are in  lowercase...
          */

         ZipEntry ze = new ZipEntry(fh.getName().toLowerCase());
         zo.putNextEntry(ze);
         if (!ze.isDirectory())
         {
            int len = 0;
            try
            {
               InputStream in = new FileInputStream(fh.getFile());
               while ((len = in.read(b)) != -1)
               {
                  zo.write(b,0,len);
               }
            }
            catch (IOException e)
            {
               e.printStackTrace();
            }
         }
         zo.closeEntry();

         if (ze.getSize() > 0) sysout.print("Deflated ("+((ze.getCompressedSize()*100)/ze.getSize())+"%):\t"+fh.getName()+"...");
      }
      zo.close();
      sysout.print("Done...");
   }
Then again, if windows explorer is the only program that fucks up, I'm very prone to write this off as a windows explorer problem. (I trust winzip and unzip more than windows explorer any day :P )
NRGizeR
feels some chest pain
Posts: 695
Joined: Mon Aug 30, 2004 1:00 am
Location: fi
Contact:

Post by NRGizeR »

Hey,

I have another (small) update to BSPPack, that should fix the problem that people are experiencing with newer WinZip versions (as well as the integrated .zip support in winxp) It's still weird that not all .zip applications choke (or alternatively work) on the old bsppacked files. Oh well, here it is, hope it works and do tell if it doesn't.

http://www.abo.fi/~cbjorkel/apps/BSPPack.zip

P.S. Read the first post in this thread for usage information if you don't know how to use it.
NRGizeR
feels some chest pain
Posts: 695
Joined: Mon Aug 30, 2004 1:00 am
Location: fi
Contact:

Post by NRGizeR »

Hmm... this fix made another bug come into the limelight, and I've yet to fix that one, since I cannot reproduce this error myself. It's tedious work trying different fixes, and then repackaging, sending out to the tester, and then redoing the bughunt, but I'll try to get this done asap. In the meantime, do check the .zip files before releasing them, as some .zip applications still seem to have problems with the bsppackaged files :(
NRGizeR
feels some chest pain
Posts: 695
Joined: Mon Aug 30, 2004 1:00 am
Location: fi
Contact:

Post by NRGizeR »

Now everything seems to be working again. Haven't gotten hold of anyone using winzip to confirm that the new version still works ok on winzip, but I haven't touched that code again, so I hope that no freak of nature (code?) messed that one up again. Get the new version 1.33 at the same place, the .zip has been replaced.

http://www.abo.fi/~cbjorkel/apps/BSPPack.zip
skmz
didn't throw its grenade far enough
Posts: 324
Joined: Thu Mar 03, 2005 4:59 pm
Location: se

Post by skmz »

Oops, it has passed over 2 years since the last post in this thread. Since it's already sticky, there's no need for any free bump, but I'd like to say that it's an awesome program, really. Greatly done!
PENSIONERAD cat
#AMF @ IRLNet - AMFpension.se[/b]
Image
Post Reply