0

I have a simple c# project that contains a form, a button and an axWindowsMediaPlayer that shows a video.

My video file is in bin/debug folder. Now, i want to create an exe file and run it on other machines without install.

How can i merge or embed all dlls and exe and video files in simple exe file and run it on other machines?

my debug folder image :

enter image description here

Thanks in advance

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
saedbfd
  • 39
  • 2
  • 9
  • Possible duplicate of [Creating portable (non-installing) windows applications in C#](http://stackoverflow.com/questions/1873231/creating-portable-non-installing-windows-applications-in-c-sharp) – M.kazem Akhgary Oct 16 '16 at 17:56
  • @M.kazem Akhgary no duplicate because i want to merge dlls, exe and other files similar to video. but ILMerge embed just dll and exe – saedbfd Oct 16 '16 at 18:04

1 Answers1

0

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. 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.

ddrjca
  • 472
  • 2
  • 15
  • thanks for answer. 'To do this, right click on a file in solution explore' . i should right click on which file in my solution? – saedbfd Oct 16 '16 at 18:13
  • Here's a link to an article on Loading DLLs from embedded resources. You may be able to find alternate instructions by searching similar topics. http://www.codeproject.com/Articles/528178/Load-DLL-From-Embedded-Resource – ddrjca Oct 16 '16 at 18:20