Practical Learning Logo

Creating an Executable

 

Introduction

An executable is an application that can be used on a computer that doesn't have the programming environment that was used to create the application. Microsoft Visual Studio .NET makes it particularly easy to create an executable. In the past, there were issues about DLLs or missing libraries. With the new features, since the user (or you) must make that the target computer has the Microsoft .NET Framework installed, this reduces concern on your part. In fact, this is so easily taken care of on new versions of Microsoft Windows that, since they ship with the framework, after creating your application, you can simply copy it to a floppy disk and install it on the target computer. There is not more to do than that.

Practical Learning: Creating an Executable

  1. Start Microsoft Visual Studio .NET and, to create a new application, on the main menu, click File -> New -> Project...
  2. In the Project Types section, click Visual C++ Projects
  3. In the Templates section, click Empty Project (.NET)
  4. In the Name box, type BodyTag then specify the Location and click OK
  5.  
  6. On the menu, click Project -> Add Resource...
  7. In the Add Resource dialog box, double-click Icon
  8. In the Properties window, change the Filename of the icon to bodytag.ico
  9. Design the 32x32 icon as follows:
     
  10. On the main menu, click Image -> New Image Type...
  11. Select 16x16, 16 colors and click OK
  12. Design the icon as follows:
     
  13. On the main menu, click Project -> Add New Item...
  14. In the Templates section, click C++ File (.cpp)
  15. In the Name box, type Exercise and click Open
  16. In the empty file, enter the code for the application
  17. To create a release version, on the Standard toolbar, click the arrow of the Solution Configurations combo box and select Release
  18. To create the executable, on the main menu, click Debug -> Start Without Debugging or press Ctrl + F5
  19. When asked to save the project, click Yes
  20. After viewing the application, click it
  21. To get the executable, open My Computer or Windows Explorer and open the Release folder of the current project. You can then copy it to floppy disk and install it on a computer that has the Microsoft .NET Framework.

 

Deployment Preparation

A more professional way to install an application on a computer consists of creating a project on its own that will take care of installing the necessary files in the right folder(s) of the user's computer. This process is also referred to as deploying an application.

As obvious as it appears, before distributing your application, you must first have it. Therefore, you can start by creating a complete application and executing it to create an executable file. Once you have a project that contains the ready-made application, to create its deployment, on the main menu of Visual Studio .NET, you can click File -> Add Project -> New Project... In the Project Types list of the Add New Project dialog box, you can click Setup And Deployment Projects. In the Templates section, you can click one of the icons. In the Name text box, give a name to the project and click OK.

 

 

Practical Learning: Creating a Deployment

  1. On the main menu of Visual Studio .NET, click File -> Add Project -> New Project...
  2. In the Project Types list of the Add New Project dialog box, click Setup And Deployment Projects
  3. In the Templates section, click Setup Wizard
  4. In the Name text box, replace the Setup1 name with Body Tag Formatter
     
    Add New Project
  5. Click OK.
  6. In the first page of the wizard, click Next
     
  7. In the second page, accept to Create A Setup For A Windows Application and click Next
  8. In the third page, click the Primary Output From BodyTag and the Content Files From BodyTag check boxes
     
  9. Click Next
  10. In the fourth page, leave the list empty and click Next
  11. Click Finish to create the project
  12. In the Solution Explorer, click BTFormatter
  13. In the Properties window, click Manufacturer. Type the name of the folder that will be created in Program Files. This folder will be automatically created during setup and your application will be installed in it. You can use the name of a/your company 
  14. Click Title. Type The Body Tag Formatter and press Enter
  15. To build the project, on the main menu, click Build -> Build Body Tag Formatter
  16. After the project has been built, open My Computer or Windows and open the Release folder of Body Tag Formatter
     
  17. Copy the contents of the folder to a floppy disk, CD, or DVD

Application Deployment

After creating a deployment project, also called an installer, you can distribute it. Those who want to install it would double-click the name of the application. This would launch the installation process, which is a routine most users are familiar with.

Practical Learning: Installing an Application

  1. In the target computer, put the floppy or other disc in the drive and locate it in either My Computer or Windows Explorer
     
  2. Double-click Body Tag Formatter
     
  3. Follow the instructions to install the application
     
  4. When it has been installed, locate its folder in Program Files and double-click it to launch it
 

Home Copyright © 2004-2010 FunctionX, Inc.