-3

I'm writing updater program in C++, i need extract files from them. I'm using Microsoft Visual Studio.

What I'd like the achieve:

  1. User runs exe
  2. exe unpacks files
  3. exe runs one of extracted files

Can anyone recommend a good solution?

Thanks!

Kuma s.r.o
  • 62
  • 2
  • 10
  • 2
    The best solution is to open your favorite text editor, and write the code to do this. – Sam Varshavchik Sep 04 '16 at 01:35
  • i dont know how to extract resources from my program – Kuma s.r.o Sep 04 '16 at 01:37
  • 1
    see http://nsis.sourceforge.net/Zip2Exe, for example – Serge Sep 04 '16 at 01:37
  • can i extract resources from C++ program ? – Kuma s.r.o Sep 04 '16 at 02:00
  • 1
    Yes, you certainly can. You can do pretty much anything from a C++ program. You just have to write the code to do it. `stackoverflow.com` is not a code-writing service with instant gratification. It's for asking specific questions, on technical topics. If you want to learn how to unpack files from an archive, I'm sure there's plenty of reading material that you can search in Google, for software libraries that will let you do that. – Sam Varshavchik Sep 04 '16 at 02:17
  • thank you so much !!! kappa – Kuma s.r.o Sep 04 '16 at 02:24

2 Answers2

2

Extracting resources from a file with C++:

Extract file from resource in Windows module

Self-Extracting Executable C++

http://www.codeproject.com/Articles/4221/Adding-and-extracting-binary-resources

Community
  • 1
  • 1
PhilDW
  • 20,260
  • 1
  • 18
  • 28
1

You're writing an updater.

  • User runs exe
  • exe unpacks files
  • exe runs one of extracted files

So your program should:

  • Download the patch from the server (use a networking library like winsock or something higher-level)
  • Unzip the archive (depending on the format in question, there should be libraries for that, like zlib)
  • Move the new files and overwrite the old ones (use win32 or something higher-level like MFC or Qt)
Ivan Rubinson
  • 3,001
  • 4
  • 19
  • 48