1

I have created winforms program and now I want to publish (build? deploy?) it. So far I published it with ClickOnce and installed it and here is the outcome: enter image description here Is it possible to have all these files except for the executable in other folder (can be Resources, bin or whatever)? Simply moving the files there throws me error, because I believe the executable has no access to them as the new path is not defined. So far my ideas were to either create a simple shortcut to the .exe or create new executable that will run the main .exe that will be in other folder, but that is not exactly what I am looking for.

I am using Visual Studio 2015 Community. I also came across program called Install Shield that allows me to create custom Setup but I could not find any information about my issue.

Edit. This is how my published with ClickOnce files look like: enter image description here

JanRad
  • 327
  • 2
  • 12
  • Is this your build directory? `ClickOnce` publish directories aren't this cluttered. – adv12 May 06 '16 at 18:02
  • Yes, this is exactly what I got from ClickOnce. – JanRad May 06 '16 at 18:03
  • You mean you clicked the "Publish Now" button on the "Publish" tab page of the main project's Properties page and this is what got dumped to the directory labeled "Publishing Location"? Or you mean you did a build, then looked in the "bin/Release" or "bin/Debug" subdirectory of your project directory and this is what you saw? – adv12 May 06 '16 at 18:05
  • I made a mistake, the first picture shows how my folder looks like after using Setup file made with ClickOnce. 2nd picture for reference. – JanRad May 06 '16 at 18:08
  • ClickOnce apps aren't really designed to be run from the installation directory. If the user runs this from the web or the Start Menu, he/she won't see any of this. – adv12 May 06 '16 at 18:09
  • You better try this answer [Windows application setup utility](http://stackoverflow.com/a/43253266/6863414) – Gayan Chinthaka Dharmarathna Apr 06 '17 at 11:03

1 Answers1

1

Yes, you can have dlls in a subfolder with ClickOnce, but you can't just move the files around. This is because ClickOnce applications use .manifest files that describe EVERY file that is deployed. If the manifest does not match the deployment directory then ClickOnce will freak out. It's a security issue.

I don't know any way of doing this automatically through Visual Studio's Publish interface, but after you build your application, look into the Mage.exe and MageUI.exe tools so you can edit your manifests to include the files in subfolders.

spectacularbob
  • 3,080
  • 2
  • 20
  • 41