4 Replies - 769 Views - Last Post: 29 May 2012 - 03:48 PM Rate Topic: -----

#1 Ibrahim.ABBAS  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 15-July 11

Release mode, how to add .exe files to the output

Posted 28 May 2012 - 07:09 AM

Hello,

I have a folder in my bin which contains many executable files ".exe"; I want them to be copied when the project is in the release mode. So clients would be able to run these external app from my main app.

To do that through VS I used "Copy to Output Directory = Copy always && Build action = Content" but it doesnt work. So how can i make sure that when building these files will be copied to the release output?

Please see a screenshot from one example:
Attached Image

Is This A Good Question/Topic? 0
  • +

Replies To: Release mode, how to add .exe files to the output

#2 negligible  Icon User is offline

  • D.I.C Regular

Reputation: 62
  • View blog
  • Posts: 302
  • Joined: 02-December 10

Re: Release mode, how to add .exe files to the output

Posted 28 May 2012 - 07:29 AM

I use a batch command with Visual Studios macros in the build events menu.

Go to your Project Properties > Build Events > Post-build Event Command Line
(post = after, so this command will be executed after successful builds only.)

Click "Edit post-build" and a new window will pop up. Click "Macros" and you'll see the shortcuts Visual Studio puts in there for you, so you can set up commands like scripts.

copy /y "$(SolutionDir)/LibraryForUse.dll" "$(TargetDir)/LibraryForUse.dll"

For example this would copy the "LibraryForUse.dll" from my solution directory to my "/Debug" or "/Release" folder depending on the build mode I have set.

Here is a list of all the macros
Was This Post Helpful? 0
  • +
  • -

#3 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5436
  • View blog
  • Posts: 11,656
  • Joined: 02-June 10

Re: Release mode, how to add .exe files to the output

Posted 28 May 2012 - 07:52 AM

So you guys are saying you don't build an actual installer for your client that includes these things? Maybe with InstalShield or Advanced Installer?
Was This Post Helpful? 0
  • +
  • -

#4 negligible  Icon User is offline

  • D.I.C Regular

Reputation: 62
  • View blog
  • Posts: 302
  • Joined: 02-December 10

Re: Release mode, how to add .exe files to the output

Posted 28 May 2012 - 08:51 AM

We use InstallAware, but I don't bother obfuscating and creating an installer each time I make a new build.

I thought OP was trying to avoid having DLLs go missing (or conflicting version issues) from their release/debug directories when they are debugging in VS.
For example making your class library Projects place their DLLs in the WinForms project release folder so the EXE is using the up to date libraries.
Was This Post Helpful? 0
  • +
  • -

#5 Ibrahim.ABBAS  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 15-July 11

Re: Release mode, how to add .exe files to the output

Posted 29 May 2012 - 03:48 PM

Hello again,
the batch command does't help me because I am doing an installer.....I had a problem with the output build...and I used the VS installer project to add these assemblies ".exe" files and it worked but every time I do get latest from TFS I had to delete the bin and obj files....any info could help?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1