I have a Setup Project in Visual Studio 2010. The primary output of another project is in the application folder. I am having trouble creating a shortcut to this output. I have done some research, and everything I found said to simply right click on the primary output and choose to create a shortcut. However, when I right click on the primary output I am only given the options "Dependencies", "ExcludeFilter", and "Outputs". How can I create a shortcut to a file in this output?
4 Answers
I found this article, http://geekanddo.wordpress.com/2012/02/20/visual-studio-setup-projects-wont-make-a-shortcut-to-the-primary-output/.
Basically the problem I was experiencing boils down to the output path for the project being invalid. In my case my output path contained $(SolutionDir)\bin. The '\' after $(SolutionDir) actually gives a double '\' in the path ('MySolutionDir\\bin' for example). Removing the extra '\' giving $(SolutionDir)bin fixed my problems.
The trickiest part with tracking this down is that VS will build the output to the expected location silently if it is invalid because of a double '\'
Im having trouble with this also
Try to rebuild your project one time before you add the shortcuts
the "project output"'s icon will change, and you wont be able to add shortcuts anymore.
if you add the shortcut before building, i get an error that the target is invalid on build (and the project output's icon changes also.)
Supposed your project name is MyApplication1
Follow this Steps
Right Click on your ApplicationFolder > Add > Project Output
On Project output group select MyApplication1
this will create [Primary Ouput from MyApplication1(Active) | Active on Application folder
To create shortcut , just right click [Primary Ouput from MyApplication1(Active) | Active then select Create Shortcut to Primary Ouput from MyApplication1(Active).
To Add an icon just right click the shortcut. On properties toolbox go to icon and select the image you want.
Then Build your Setup Project.
Regards
I encountered this problem when converting a VS2008 solution to a VS2010 solution. The VS solution contains just over 70 C++ projects. I found two conditions which produced this error. The first was reported in an MSDN forum (see http://social.msdn.microsoft.com/Forums/en-CA/winformssetup/thread/884b7d69-8aa6-47f6-8261-30770a45eb09).
The second condition is that VS2010 does not appear to properly update a VS2008 project .vcproj file when a linker option uses a particular macro (i.e. the project linker option [project property pages][Configuration Properties][Linker][General][Output File]). Specifically, the setup ‘shortcut’ problem occurred when this option was defined using the $(OutDir) macro. I will explain in a bit more detail.
I found that the setup ‘shortcut’ problem occurred only for those few projects in which the Output File option was defined using the $OutDir macro. In contrast, all other projects defined the Output File option using the $(SolutionDir)$(Configuration) macros - and for these projects, the setup ‘shortcut’ problem did not occur. I simply replaced $OutDir with the $(SolutionDir)$(Configuration), resaved the project, and found this corrected the setup ‘shortcut’ problem.
I believe that replacing $OutDir with $(SolutionDir)$(Configuration) caused the VS2010 IDE to update the project .vcproj file and it was this process of updating .vcproj that corrected the setup ‘shortcut’ problem. The reason I say this is because I re-defined the Output File option using the $OutDir macro and this did NOT cause the setup ‘shortcut’ problem to return. I did not investigate any further because I had already wasted a good deal of time in finding a solution to the problem.