Solved

Visual Studio 2003 Setup and Deployment Project

Posted on 2006-06-21
12
15,975 Views
Last Modified: 2013-12-04
Question about what I thought would be a simply process, namely to create a setup project for a small application I wrote in C#/.NET 1.1.  So I've created a setup and deployment project and added the "Primary output..." to the Application Folder as well as all the dependencies and merge modules needed by the application.  All that is fine and the application installs and works.

So the problem is that I'd like to have a shortcut to the main exe file from the desktop as well as the Start Menu.  I followed the instructions as best I can, since the instructions to exactly match reality...  The MSDN docs say:

To add a shortcut to a file or folder

In the File System Editor, select the file or folder to which you want to create a shortcut.
Note   When adding a shortcut to a special folder, you must set the AlwaysCreate property of the folder to true.
On the Action menu, click Create Shortcut to <Name>. The shortcut appears in the File List.
Select the shortcut, and choose Cut from the Edit menu.
In the Folder List, select the folder where you want the shortcut to appear on the target computer, and choose Paste from the Edit menu.
Tip   You can also drag shortcuts from one place to another.

Ok so first of all there is no "Create Shortcut to <Name>." option in the menu.  There is only one that says:

"Create Shortcut to Primary output from Name of my project (.NET Release)"

So if I do that it does create what says it is a shortcut and I can copy that to the Desktop and Programs Menu.  When I run the setup shortcuts DO get created but they don't run the application, they run the INSTALLER again and then run the application.

Can someone tell me what I'm doing wrong or how to create a shortcut properly?

Thanks.
0
Comment
Question by:jhance
  • 5
  • 5
  • 2
12 Comments
 
LVL 48

Expert Comment

by:AlexFM
Comment Utility
What happens if you run program from Windows Explorer after installation? Does it run installer before or directly the program?
What do you see in the shortcut properties after installation?

Creating shortcut in the Setip project is so easy that doesn't require any instructions. Like in Windows Explorer, you can right-click your program, select "Create Shortcut", them move it to any other place in the project (like Desktop), change it's name etc.
0
 
LVL 32

Author Comment

by:jhance
Comment Utility
I agree that this is something that should be simple.  What is an installer without a desktop or start menu shortcut?

If I navigate to the installation folder and run the .exe installed by the setup project, the application runs normally.  It's only if I run the shortcut that is runs the installer again.

As far as the properties, that's confusing also.  It is a shortcut but the "Target" not what I expect.  See:

http://img227.imageshack.us/img227/9990/cdprops1ug.jpg
0
 
LVL 48

Expert Comment

by:AlexFM
Comment Utility
Are you sure that you made shortcut to executable file and not to something else? What do you see in the shortcut properties in the setup project?
Try to make it again using the way from my first post - right-click on your executable, select "Create Shortcut" etc.
BTW, it is difficult to see details in your jpg image.
0
 
LVL 32

Author Comment

by:jhance
Comment Utility
Make your browser larger and you can see the image better.

When I right click on the Project output I get:

http://img93.imageshack.us/img93/3543/desktop39gt.jpg

Then I drag that to the User's Desktop folder.

Here are images of the VS desktop:

http://img150.imageshack.us/img150/7348/desktop19gv.jpg
http://img217.imageshack.us/img217/5623/desktop25jr.jpg
0
 
LVL 48

Expert Comment

by:AlexFM
Comment Utility
What is "Primary output from ClubDirectory"? This should be executable file, like MyProgram.exe.
0
 
LVL 48

Expert Comment

by:AlexFM
Comment Utility
Well, I see that Primary output is created by Project Wizard. I prefer to add files manually to the Application Folder: right-click, Add, File. Add all exe, Dll and other required files. Having files list you can create shortcut to executable.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 32

Author Comment

by:jhance
Comment Utility
It makes no difference whether I add the Primary Output (which is added semi-automatically by VS) or if I add the .exe file (there is only one) specifically and create the link to it.  The installer runs again no matter what.

I'm baffled!!
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 250 total points
Comment Utility
Cannot reproduce this, my shortcut runs successfully in both cases - with Primary Output and with .exe file. But I have VS 2005. Maybe there is something else in your project that I don't know.
I have two suggestions:
1) Create new Setup project (empty), add one exe file to it and make shortcut. Does it happen again? Where does it happen - on the development computer or other computer?
2) Post link to this question in .NET area.
0
 
LVL 32

Author Comment

by:jhance
Comment Utility
I'm using VS 2003 but this is pretty basic.  If such a fundamental flaw existed in VS 2003 surely someone else would have noticed...
0
 
LVL 32

Author Comment

by:jhance
Comment Utility
Very strange.  I deleted the setup project I was working with and started over from scratch.  All is well...

Go figure.  Thanks for listening.
0
 

Expert Comment

by:CSDII
Comment Utility
I am trying to create a shortcut also. However, my primary output contains two files. One is the "app.exe" the other is the "app.exe.config" file. I have no idea why the config file is being included. Should the "app.exe" file be the only one in the primary output?
0
 

Expert Comment

by:CSDII
Comment Utility
I just found out why the "app.exe.config" file is in the primary output. It includes keys to the server, database, and other data needed to work with the data for the app. The question now becomes: If I create a shortcut to the primary output, will it only point to the "app.exe" file? I would try it and see except it takes forever to build the deployment files.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now