简体   繁体   English

如何将exe文件与dll和其他文件合并?

[英]How can i merge exe file with dlls and other files?

I have a simple c# project that contains a form, a button and an axWindowsMediaPlayer that shows a video. 我有一个简单的c#项目,其中包含一个表单,一个按钮和一个显示视频的axWindowsMediaPlayer。

My video file is in bin/debug folder. 我的视频文件位于bin / debug文件夹中。 Now, i want to create an exe file and run it on other machines without install. 现在,我想创建一个exe文件并在没有安装的其他计算机上运行它。

How can i merge or embed all dlls and exe and video files in simple exe file and run it on other machines? 如何将所有dll,exe和视频文件合并或嵌入到简单的exe文件中,然后在其他计算机上运行它?

my debug folder image : 我的调试文件夹图像:

在此处输入图片说明

Thanks in advance 提前致谢

A self-extracting exe will give you a single file for distributing your application to other machines, however, if your goal is to end up with a single exe file after installation, then you could embed the dlls and video files as embedded resources in the main exe. 自解压exe将为您提供一个文件,用于将您的应用程序分发到其他计算机,但是,如果您的目标是在安装后最终得到一个exe文件,则可以将dll和视频文件作为嵌入式资源嵌入到主要执行 To do this, right click on a file in solution explorer and in the properties tab select Embedded Resource for the Build Action. 为此,请在解决方案资源管理器中右键单击一个文件,然后在属性选项卡中为“构建操作”选择“嵌入式资源”。 Depending on the type of resource you're embedding you may need to modify your code to access it. 根据您要嵌入的资源类型,您可能需要修改代码才能访问它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM