Posted By: NeoNeper
Unzip or Unrar - how? - 03/09/13 02:50
Anyone know any way for me extract files and folders from a zip or rar?
I created a AutoUpdate system for my game but after he download of the FTP file, i do not know how I could extract the file from the zip or rar.
If anyone knows of a way to do this I would be very grateful!
Posted By: Uhrwerk
Re: Unzip or Unrar - how? - 03/09/13 03:27
I'd suggest including the 7zip executable into your project and calling it with exec.
http://www.conitec.net/beta/ain-exec.htmhttp://www.7-zip.org/download.html
Posted By: WretchedSid
Re: Unzip or Unrar - how? - 03/09/13 20:35
I know that NeoNeper is going to ignore this post, but I have some hopes that other users will find this when they search for a similar problem: Updating is not easy!
The basic rule is that you shall never ever trust any third party input, in this case the update package becomes the third party input. Do yourself a favour and validate what you get over the wire. You might think "nah, fuck off JustSid, I only load data from a URL that I know belongs to me", but if you do that, you just make yourself vulnerable to DNS poisoning or man in the middle attacks. Please use HTTPS for the transfer and validate the certificate! You know what the certificate is supposed to look like, make sure that you get that exact certificate and don't accept anything else! If you can't use HTTPS, for whatever reason, at the very least sign the downloaded data and verify the signature. Do this using a known crypto algorithm and use a tested crypto library, under no circumstances do you ever roll your own crypto! (Now you are going to say "but JustSid, RSA is really simple, I surely can implement it myself". Yes, but don't fucking use it in production code until you understand how cache-based timing and other side channel attacks work and how to counter them).
Crypto is not easy! Just because the underlying mathematical function appears to be easy and you understand the Wikipedia page about it, doesn't mean that you are a crypto expert and can implement these things yourself. Whenever you do something with crypto, get a well known, well tested open source library which has been extensively peer reviewed.
Remember; You are downloading executable data on behalf of the user, don't fuck that up! Believe me, you don't your game to become an attack vector into a users system, so make sure that you get it right. If you have doubts that you can do that in a secure manner, don't even bother integrating an updater (and don't pay someone else if you can't peer review their code).
Posted By: NeoNeper
Re: Unzip or Unrar - how? - 03/10/13 02:19
JustSid:His argument is very valid, I completely understand what you mean!
My time is very limited and I am working on my project without help from other friends!. At the moment I'm focusing the game development and the auto update is only one way to facilitate testing for friends who have a TEST version need not get the new version on the SITE, every time I update the project.
Lack much so that it is a version COMMERCIAL. And of course that if i getting the necessary Subsidies, these implementations will be made.
I will not stop producing my project just because something is very difficult. Agree?
Uhrwerk:
His hint was pretty cool!
This will serve to Moment!
TANKS.
Posted By: MasterQ32
Re: Unzip or Unrar - how? - 03/10/13 10:34
Lack much so that it is a version COMMERCIAL.
I don't know what problem you have with the commercial version. I never used any pro features until now, all of the stuff is possible with commercial or some custom made libraries
Posted By: Quad
Re: Unzip or Unrar - how? - 03/12/13 00:18
you can always use zip files and unzip with zlib.
Posted By: NeoNeper
Re: Unzip or Unrar - how? - 03/12/13 22:31
7zsd.sfx was the best solution!. I managed to do my silent SelfExtract perfect.
http://7zsfx.info/en/