The main difference between a setup project and any other project is that you never write any actual programming code for a setup project. All of the possible setup project 'procedures' have been decided in advance by Microsoft. In fact, you can see a nice view of the processing "flowchart" in the User Interface Editor - one of six functional areas that are called "designers' where the setup can be customized to your exact specifications.
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------
The key concept is that that there is just one basic "program" for setup projects and you don't write any code to create it. You can use the User Interface Editor to add or delete dialog windows to accomplish the unique requirements of your setup, but the procedural code to make it happen has already been written by Microsoft.
In this article, I'll start easy with the first setup project: a standard Windows application that you just want to be able to deploy and run on other machines. In fact, I'll use one that is almost the same as the one used in the ClickOnce article. I'm also installing this from a network share on a Windows 2000 computer that does not have the .NET Framework on it to show you how that is handled.
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------
Although for more complex systems, you will probably create a 'stand alone' setup project and then include the Windows application and other required files in it, the easiest way to install a simple system is to add the setup project to the solution. See the next illustration.
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------
One of the things that happens "automagically" is that Visual Studio can check to see if a whole list of dependencies are satisfied during the install. To view (or change) the prerequisites for your project, right click the setup project in Solution Explorer and select Properties. Then click the Prerequisites button. You'll see a window like the next illustration.
Tip: The default configuration will download .NET Framework 2.0 from Microsoft because they are the "component vendor". But in actual use, you may get an error message: "Error: Setup has detected that the file has changed since it was initially published." A workaround might be to select the second option, "Download prerequisites from the same location as my application."
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------
The setup project is empty at this point. At a minimum, you need to add the Windows application as a "Primary Output". In this case, it's named AboutSetupProj. As always in Visual Studio, there are several ways to do this. One is to add it using the File System Editor "designer" for the setup project.
There are seven "designers" that are all represented by icons in the toolbar at the top of Solution Explorer when the setup project is selected. We looked at the User Interface Editor earlier. The File System Editor is the second one from the left.
Or you can right-click the setup project, just named AboutSetup here, and select Add, then Project Output .... The Windows application, AboutSetupProj should be preselected in the Primary Output textbox. Click OK to add it as the Primary Output.
Then simply right-click the setup project and select Build to create your setup project.
Since the application is being installed from a network share on a Windows 2000 computer that doesn't have .NET Framework 2.0 installed, the first thing that happens is that Microsoft detects this and starts an Internet download. This requires that the user accept the Microsoft End User License Agreement (EULA). See the next illustration:
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------

