Add files to exe and then extract them

不想你离开。 提交于 2019-12-30 07:47:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!