CREATING A STAND-ALONE EXECUTABLE


Up to this point in the book, you have executed all the Visual Basic applications that you have worked on within the Visual Basic IDE. This version of your application is sometimes referred to as the design or debug version. However, what you really want to do is create a standalone program that can be run by itself, outside of the IDE. This requires that you generate a run-time or release version of your application.

To locate the debug version of your applications, click on the Show All Files icon in Solution Explorer and drill down into obj and then Debug, where you'll see the executable program that Visual Basic has created, as demonstrated in Figure 3.24.

image from book
Figure 3.24: Examining the debug version of your Visual Basic application.

Trick 

The executable file that Visual Basic creates and stores in obj\Debug is not optimized for normal execution. It includes unnecessary code that Visual Basic used to debug your program. So while you can distribute this executable file, you would be a lot better off going through the following build procedure in order to create a more efficient and faster executing application.

The release version is smaller in size and runs more efficiently than the debug version. The following process outlines the steps required to generate a release version of your Visual Basic application.

  1. Finish creating and testing your Visual Basic application.

  2. Click on File and select Save All.

  3. Click on the Build menu and select the name of your application from the menu item list that will appear. In response, Visual Basic will automatically generate an executable file (.exe) for you, assigning it the name that you assigned to your solution file.

  4. To locate this new file, click on the Show All Files icon in Solution Explorer. This will display additional file information. Drill down into obj and then Release to see the executable program that Visual Basic has created, as demonstrated in Figure 3.25.

image from book
Figure 3.25: Examining the release build version of your Visual Basic application.

You can run your new application by double-clicking on it in Windows Explorer or by clicking on Start and then selecting Run and specifying the name and path of your application's executable file, as demonstrated in Figure 3.26. At this point, if you wish to share your application with someone else, all that you have to do is provide the user with a copy of your executable file.

image from book
Figure 3.26: Locating and running the release build version of your Visual Basic application.

Trick 

As a precaution, it is always a good idea to retest your standalone application once you have created it. In fact, it is also a good idea to let somebody else test it as well, before you begin passing it around.




Microsoft Visual Basic 2005 Express Edition Programming for the Absolute Beginner
Microsoft Visual Basic 2005 Express Edition Programming for the Absolute Beginner
ISBN: 1592008143
EAN: 2147483647
Year: 2006
Pages: 126

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net