Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# to extract

C# to extract

Scheduled Pinned Locked Moved C#
csharphelpquestion
10 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    ziczaczoom2004
    wrote on last edited by
    #1

    Can anyone help in extracting the exe files in such a way that the exe file does not install but extracts the all the files in a separate folder?

    S Z 2 Replies Last reply
    0
    • Z ziczaczoom2004

      Can anyone help in extracting the exe files in such a way that the exe file does not install but extracts the all the files in a separate folder?

      S Offline
      S Offline
      Stefan Prodan
      wrote on last edited by
      #2

      I gues you need a Zip like utility. There is a free zip lib made in C# here icsharpcode.net

      Z 1 Reply Last reply
      0
      • S Stefan Prodan

        I gues you need a Zip like utility. There is a free zip lib made in C# here icsharpcode.net

        Z Offline
        Z Offline
        ziczaczoom2004
        wrote on last edited by
        #3

        thanks for ur response. No i don't want any zip like utility. if i use diagonostics.process...,start(),waitforexit(), the exe file is extracted to install, but i want the exe file to extract to be unzipped or stored & not installing the exe package.

        D 1 Reply Last reply
        0
        • Z ziczaczoom2004

          thanks for ur response. No i don't want any zip like utility. if i use diagonostics.process...,start(),waitforexit(), the exe file is extracted to install, but i want the exe file to extract to be unzipped or stored & not installing the exe package.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          You'll have to find out what the command line parameters are for the file you want to unpack. If the .EXE supports the functionality you want, you're in business, all you have to do is use the correct commandline parameters to tell the .EXE to unpack itself but not run its setup. If not, oh well... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          1 Reply Last reply
          0
          • Z ziczaczoom2004

            Can anyone help in extracting the exe files in such a way that the exe file does not install but extracts the all the files in a separate folder?

            Z Offline
            Z Offline
            ziczaczoom2004
            wrote on last edited by
            #5

            system.diagnostics.process.start("filename.zip"); will extract the file (if it is an exe file , it starts to install)...all i need is to unzip the filename.zip, so that i can store the unzipped contents in another folder. thanks

            D 1 Reply Last reply
            0
            • Z ziczaczoom2004

              system.diagnostics.process.start("filename.zip"); will extract the file (if it is an exe file , it starts to install)...all i need is to unzip the filename.zip, so that i can store the unzipped contents in another folder. thanks

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              If you start a .ZIP file, it'll open in whatever application is registered to handle .ZIP files. It won't unpack the thing unless you give the correct command line parameters. An .EXE is a different story. Not every .EXE self installer uses the same compression engine, so the command line parameters are going to be different from .EXE to .EXE. Herein lies your problem. You can attempt to use launch WinZip, or whatever .ZIP application your using, with the .EXE name in place of the .ZIP filename you would normally use. For example, a hypothetical command line for unzipping a .ZIP file might be:

              WinZip -u -s myfile.zip c:\myfolder

              You can replace the .ZIP filename with the selfextracting .EXE to unpack it:

              WinZip -u -s mysetup.exe c:\myfolder

              The problem with launching an .EXE and getting it to unpack itself is you don't know ahead of time if the .EXE supports unpacking with launching, unpacking to a traget folder, or what the proper command line parameters are to get it to unpack. You can only guess at this stuff. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

              Z 1 Reply Last reply
              0
              • D Dave Kreskowiak

                If you start a .ZIP file, it'll open in whatever application is registered to handle .ZIP files. It won't unpack the thing unless you give the correct command line parameters. An .EXE is a different story. Not every .EXE self installer uses the same compression engine, so the command line parameters are going to be different from .EXE to .EXE. Herein lies your problem. You can attempt to use launch WinZip, or whatever .ZIP application your using, with the .EXE name in place of the .ZIP filename you would normally use. For example, a hypothetical command line for unzipping a .ZIP file might be:

                WinZip -u -s myfile.zip c:\myfolder

                You can replace the .ZIP filename with the selfextracting .EXE to unpack it:

                WinZip -u -s mysetup.exe c:\myfolder

                The problem with launching an .EXE and getting it to unpack itself is you don't know ahead of time if the .EXE supports unpacking with launching, unpacking to a traget folder, or what the proper command line parameters are to get it to unpack. You can only guess at this stuff. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                Z Offline
                Z Offline
                ziczaczoom2004
                wrote on last edited by
                #7

                Hi, I am curious abt how to unzip the exe file (without extracting)in a C# program

                D 1 Reply Last reply
                0
                • Z ziczaczoom2004

                  Hi, I am curious abt how to unzip the exe file (without extracting)in a C# program

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  Read my previous post. It's got all the information you need and the pitfalls you're looking at. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                  Z 1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    Read my previous post. It's got all the information you need and the pitfalls you're looking at. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                    Z Offline
                    Z Offline
                    ziczaczoom2004
                    wrote on last edited by
                    #9

                    ok yeah i tried by ur method as wzunzip c:\filename.zip c:\folder\ it really unzipped. wow but if i replace it for a cabinet extractor exe file, it asks for password what am i to do to unzip the exe file? suggestions please......

                    D 1 Reply Last reply
                    0
                    • Z ziczaczoom2004

                      ok yeah i tried by ur method as wzunzip c:\filename.zip c:\folder\ it really unzipped. wow but if i replace it for a cabinet extractor exe file, it asks for password what am i to do to unzip the exe file? suggestions please......

                      D Offline
                      D Offline
                      Dave Kreskowiak
                      wrote on last edited by
                      #10

                      Only you can answer that question since your the one holding the .EXE. Have you tried Whatever.EXE /? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups