Results 1 to 9 of 9

Thread: [RESOLVED] How to unzip and zip files, without importing a dll or custom software?

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2013
    Location
    Norway; Haugesund
    Posts
    39

    Resolved [RESOLVED] How to unzip and zip files, without importing a dll or custom software?

    Hello!

    I've been working with creating a simple zip addon for my softwares the past months, but not getting anywhere to a useful level. I've been trying to add dlls in the past, but they only worked at my computer. (Yes, I copied the dll with the .exe in the same folder at targeted computer). I also noted that I had to import the project (Visual Studio) in order to make the software even work on others than my main PC. So basicly, I have a very dark vision on dlls.

    What I'm looking for is for a function in VB code which can zip and unzip my files, without relying on other files other than the .exe itself.

    I tried to make my own zip format, and it worked well. The only issue is it consumes way to much memory, and is not reliable enough.

    Is there any easier methods I have overseen? Thanks in advance, and thanks for reading.
    Last edited by Frekvens1; Jan 29th, 2015 at 03:53 AM. Reason: More details

  2. #2
    Frenzied Member IanRyder's Avatar
    Join Date
    Jan 2013
    Location
    Healing, UK
    Posts
    1,232

    Re: How to unzip and zip files, without importing a dll or custom software?

    Hi,

    Try not to get too despondent with your lack of success with DLL’s. It’s what they are designed for and your current experience suggests to me that you did something wrong somewhere along the line.

    Regardless of that, have you looked at the GZipStream Class that is part of the System.IO.Compression Namespace which comes with the .NET Framework? It not have a look at this:-

    GZipStream Class

    Hope that helps.

    Cheers,

    Ian

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2013
    Location
    Norway; Haugesund
    Posts
    39

    Re: How to unzip and zip files, without importing a dll or custom software?

    @IanRyder,

    Hopefully I will be able to look more deeply into the DLL's as my experience is growing. If I get them to work, they can be a powerful tool.

    Anyway, I checked the GZipStream Class you recommended. With some fast Google searches I found it promising, and it will probably do the job efficient! So thanks for information, it really helps out. I can mark this thread resolved thanks to you.

    Cheers,

    Frek

  4. #4
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,657

    Re: [RESOLVED] How to unzip and zip files, without importing a dll or custom software

    Hopefully I will be able to look more deeply into the DLL's as my experience is growing. If I get them to work, they can be a powerful tool.
    Dll's will become an essential part of how you work once you figure them out.

    One thing i would say is just copying your exe and dll's across to another computer is not necessarily enough.

    You should be making an Installer (which you can do using a Visual Studio Setup Project). Creating an Installer correctly will ensure that you have ALL the files necessary to run your program, and should ensure smooth running of your application on other computers.
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2013
    Location
    Norway; Haugesund
    Posts
    39

    Re: [RESOLVED] How to unzip and zip files, without importing a dll or custom software

    Quote Originally Posted by NeedSomeAnswers View Post
    Dll's will become an essential part of how you work once you figure them out.

    One thing i would say is just copying your exe and dll's across to another computer is not necessarily enough.

    You should be making an Installer (which you can do using a Visual Studio Setup Project). Creating an Installer correctly will ensure that you have ALL the files necessary to run your program, and should ensure smooth running of your application on other computers.
    If I catch this right, the DLL's needs to be installed somewhere in a system folder?

    A installer can simply be as this:

    Code:
    My.Computer.FileSystem.WriteAllBytes("C:\File.exe", fileBytes, False)
    But the problem is where to install it.

    I tried to use the MySQL DLL some time ago, and it only worked for me. The DLL used their software in order to function, and I found it a little annoying as it's mainly developers who use this software. The conclusion is that people needed to install this software in order to use my software. I've done much research on the DLL's, but I'm not able to see what I do wrong.

    Any clues?

  6. #6
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    Re: [RESOLVED] How to unzip and zip files, without importing a dll or custom software

    The DLL used their software in order to function
    That's kinda the point. Exes depend on dlls which depend on other dlls which depend on other dlls and so on. They're components that depend on each other and must all be in place to work correctly. This is a very powerful concept because it allow you to use functionality that others have created without having to rewrite it for yourself - you get to stand on the shoulders of giants.

    What you're experiencing is the pain of trying to get all those unruly giants lined up and standing on the right spots in the first place. If your copying your exe onto someone else's machine and there are a lot of dependencies that can me quite onerous but the good news is that you don't need to do it at all. That's what Installer projects are for. If you add the installer project template to visual studio you can simply tell it to "detect all dependencies" and it will go away and line up all the giants for you. What it will spit out is an msi which will have all the dependencies wrapped up in it so your end user can just double click and sit back.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  7. #7
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,657

    Re: [RESOLVED] How to unzip and zip files, without importing a dll or custom software

    If I catch this right, the DLL's needs to be installed somewhere in a system folder?
    You shouldn't even worry about where they should install, its not your problem that's for the Installer to do.

    What you're experiencing is the pain of trying to get all those unruly giants lined up and standing on the right spots in the first place. If your copying your exe onto someone else's machine and there are a lot of dependencies that can me quite onerous but the good news is that you don't need to do it at all. That's what Installer projects are for.
    Exactly, don't even attempt to do this all yourself, The Visual Studio Installer Project will do it for you, and create a nice .msi file at the end of it which you can then use to install on other machines.

    You may want to read this on Setup Projects
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  8. #8

    Thread Starter
    Member
    Join Date
    Oct 2013
    Location
    Norway; Haugesund
    Posts
    39

    Thumbs up Re: [RESOLVED] How to unzip and zip files, without importing a dll or custom software

    Quote Originally Posted by FunkyDexter View Post
    That's kinda the point. Exes depend on dlls which depend on other dlls which depend on other dlls and so on. They're components that depend on each other and must all be in place to work correctly. This is a very powerful concept because it allow you to use functionality that others have created without having to rewrite it for yourself - you get to stand on the shoulders of giants.

    What you're experiencing is the pain of trying to get all those unruly giants lined up and standing on the right spots in the first place. If your copying your exe onto someone else's machine and there are a lot of dependencies that can me quite onerous but the good news is that you don't need to do it at all. That's what Installer projects are for. If you add the installer project template to visual studio you can simply tell it to "detect all dependencies" and it will go away and line up all the giants for you. What it will spit out is an msi which will have all the dependencies wrapped up in it so your end user can just double click and sit back.

    Quote Originally Posted by NeedSomeAnswers View Post
    You shouldn't even worry about where they should install, its not your problem that's for the Installer to do.



    Exactly, don't even attempt to do this all yourself, The Visual Studio Installer Project will do it for you, and create a nice .msi file at the end of it which you can then use to install on other machines.

    You may want to read this on Setup Projects
    Woah. I can't believe I haven't seen this heaven before now! This feature of making a msi installer for the project... I've only seen third parties of it. If this works like I think, it will add all my references and DLL's to the msi, installing them on the selected computer with ease. This is the solution I've been looking for the past year, and it was in front of my very eyes! Still shocked tho, you have my best thanks @FunkyDexter @NeedSomeAnswers! You gained my respect.

    Finally I can start using my DLL's!



    With kind regards,

    Frek

  9. #9
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    Re: [RESOLVED] How to unzip and zip files, without importing a dll or custom software

    it will add all my references and DLL's to the msi, installing them on the selected computer with ease
    Bingo! Glad to be of help.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width