如何使用所有使用的文件导出Visual Studio中的exe文件 [英] How To Export exe files in Visual Studio With All Used Files

查看:157
本文介绍了如何使用所有使用的文件导出Visual Studio中的exe文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我一直在使用Visual Studio C ++中的文件中的音频和图像来从事一些项目.到目前为止,它们只是测试项目,但我现在将朝着使用SFML和一些其他音频库制作2D游戏的目的迈进.问题是,我想将我的游戏分发给其他人,以便他们可以玩和测试它们,我可能会尝试为某些人开发某种多人游戏,从而增加了将其分发给其他人的愿望,但是我不愿意知道如何为他们提供包含所有文件的游戏.我以前只是能够从debug或release文件夹中获取exe文件,但是这些项目都有它们依赖的文件.

So I have been working on a few projects using audio and images from files in Visual Studio C++. As of now they are just test projects, but I am going to be moving now towards making 2D games for fun using SFML and a few different audio libraries. The problem is this, I want to give out my games to others so they can play and test them, and I may try to develop some sort of Multiplayer for some, thus increasing my desire to give it out to others, however I do not know how I can give them the games with all the files included. I used to just be able to grab the exe files out of the debug or release folder, but these projects have files they rely on.

所以这是我的问题,是否可以导出包含所有其他文件(wav,jpg等)的exe文件?如果这个问题听起来非常愚蠢,请告诉我,因为我对exe是什么以及它是否可以容纳这些文件一无所知(我习惯于Java,在Java中,您可以将某些东西简单地导出到可运行的jar中,因为存档,所有资源都预先打包在其中,我不知道exe是否具有这些特征).如果这是不可能的,或者有更好的选择,它们是什么?我已经看过东西,并且知道如何从数据数组中加载声音,这会是一个更好的解决方案吗?还是还有其他选择?最重要的是,在debug和release文件夹中,有几个我需要运行该项目的DLL文件,有没有一种方法可以将这些文件压缩到exe中,或者无论如何,它们都必须与exe放在同一文件夹中?

So here is my question, is it possible to export an exe file that contains all the other files (wav's, jpg's etc.)? If this question sounds overwhelmingly stupid then tell me, because I have very little idea of what an exe is, and whether it can hold those files (I am used to java, where u can simply export something into a runnable jar and because it is an archive, with all of the resources prepackaged in there, I don't know if an exe shares these traits). If this is not possible, or there are better alternatives, what are they? I have seen things and know how to load sounds from arrays of data, would that be a better solution? Or are there other options? On top of that, in the debug and release folder there are several DLL files which I need to run the project, is there a way to compress these into the exe or will those have to be in the same folder as the exe no matter what?

这里的真正问题是,导出项目的exe文件的最佳方法是什么,以便我可以将所有声音和图像资源以及dll都利用到易于分发的副本中?预先感谢您的任何建议.

The real question here is what is the best way to export an exe file of my project so that I can utilize all of my sound and image resources as well as the dll's into an easy to distribute copy? Thank you in advance to any advice.

推荐答案

不可能导出包含您的exe和其他多个文件的exe .您可以使用安装程序(例如免费的 InnoSetup ),也可以将多余的文件捆绑到资源并在运行时从资源加载它们. (第一个优点是可以询问用户安装位置,创建快捷方式和文件夹,开始"菜单项等).

It's not possible to export an exe that contains your exe and multiple other files. You can use an installer (such as InnoSetup, which is free), or bundle the extra files into a resource and load them from resource at runtime. (The first has the benefit of being able to ask the user where to install, create shortcuts and folders, Start Menu items, etc.).

这篇关于如何使用所有使用的文件导出Visual Studio中的exe文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆