Files wont zip into exe

This is a discussion on Files wont zip into exe within the C Programming forums, part of the General Programming Boards category; Hello, I'm trying to run code to compress some files into an exe format. The files seem to convert into ...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    19

    Files wont zip into exe

    Hello,

    I'm trying to run code to compress some files into an exe format. The files seem to convert into a zip fine. But then they wont convert from zip into an exe. Then the program gets hung. I would appreciate any help.

    Code:
    fprintf(log_file,"Commands for Folder %s:\n",folder);
    if (strcmp(mode,"c") == 0)
    {
          sprintf(stemp, "del %s\\%s.bkp.exe", folder, filename); /*delete backup exe file that may have been created*/
          fprintf(log_file,"  %s\n",stemp);
          system(stemp);
          sprintf(stemp, "wzzip %s\\%s.zip %s\\%s.txt", folder, filename, folder, filename); /*create zip file*/
          fprintf(log_file,"  %s\n",stemp);
          system(stemp);
          sprintf(stemp, "wzipse32 %s\\%s.zip -d %s\\%s\\%s -y -auto",folder, filename, extr_loc_p1, c_file.name, extr_loc_p2); /*create self extracting executable*/
          fprintf(log_file,"  %s\n",stemp);
          system(stemp);
          sprintf(stemp, "del %s\\%s.txt", folder, filename);
          fprintf(log_file,"  %s\n",stemp);
          system(stemp);
          strcpy(folder, directory);
    }
    else if (strcmp(mode,"cs") == 0) 
    {
          sprintf(stemp, "del %s\\%s.bkp.exe", folder, filename); /*delete backup exe file that may have been created*/
          fprintf(log_file,"  %s\n",stemp);
          system(stemp);
          sprintf(stemp, "wzzip %s\\%s.zip %s\\%s.txt", folder, filename, folder, filename); /*create zip file*/
          fprintf(log_file,"  %s\n",stemp);
          system(stemp);
          sprintf(stemp, "wzipse32 %s\\%s.zip -d %s\\%s\\%s -y -auto",folder, filename, extr_loc_p1, c_file.name, extr_loc_p2); /*create self extracting executable*/
           fprintf(log_file,"  %s\n",stemp);
           system(stemp);
           sprintf(stemp, "del %s\\%s.txt", folder, filename);
          fprintf(log_file,"  %s\n",stemp);
          system(stemp);
          set_security();
           strcpy(folder, directory);
    Last edited by smarta_982002; 02-19-2008 at 02:28 PM.

  2. #2
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Katy, Texas
    Posts
    2,309
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

  3. #3
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    You have lines too long in your code
    What you could do - at least remove leading 4 tabs before posting
    (most editors will do it for you if you select several lines and press Shift-tab)
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  4. #4
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,823
    Ah, but you shouldn't remove all indentation. Vart merely suggested you remove superfluous indentation.
    Code:
    				my code
    Unnecessary. Could be:
    Code:
    My code
    But this...
    Code:
    if (x)
    // do x
    Is not so very good because it makes it hard to read, so it's perfectly fine to indent:
    Code:
    if (x)
    	// do x
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  2. fopen vs. _open (for BIG image files)
    By reversaflex in forum C Programming
    Replies: 3
    Last Post: 04-01-2007, 12:52 AM
  3. Using files in side a zip of cab
    By Skeptic in forum Windows Programming
    Replies: 2
    Last Post: 03-14-2003, 01:38 AM
  4. How to link bpl files into exe?
    By Unregistered in forum C++ Programming
    Replies: 0
    Last Post: 06-22-2002, 10:38 AM
  5. EXE files...
    By Brian in forum C Programming
    Replies: 7
    Last Post: 02-18-2002, 11:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21