问题
i am making a windows installer , i need to put some files in my program and then extract them to some folder when program runs , lets say i am going to put 3 files in single exe file .
thanks a lot for your help in advance , love ya Stackoverflow members :)
回答1:
Have a read here : http://support.microsoft.com/kb/319292
This shows how to extract the resource into a Stream, you can then write this stream to disk.
回答2:
There exist two options: (1) add files as resources, and (2) append the whole package with files to the end of your EXE and mark it in some way (with magic numbers) and then open EXE for reading and read the data. Second approach is how self-extracting ZIP or PGP archives usually work and this approach works just fine.
来源:https://stackoverflow.com/questions/6349004/add-files-to-exe-and-then-extract-them