Previous Next
Deployment Guide for .NET Chapter 1 -Deploying Standalone .NET Application

Chapter 1 - Deploying Standalone .NET Application

DB Visual ARCHITECT (DB-VA) can generate all .NET code for accessing database, you do not need to write any SQL to insert, query, update or delete the record, hence you can develop quality Standalone .NET Application much faster, better and cheaper. In this chapter we focus on deploying standalone .NET application. If you want to know how to develop a quality standalone .NET application, you can reference the Programmer's Guide for .NET -Chapter 1 Developing Standalone .NET Application.

In this chapter:

Creating the Setup Project for Standalone .NET Application

After you have developed the standalone .NET application in Visual Studio .NET, you may wonder how to deploy the application to another computer. Visual Studio provides an excellent feature to create setup file (installer) so you can install the application on other machines easily. You can download the example of the Programmer's Guide for .NET -Chapter 4 Developing Standalone .NET Application and follow the steps below to create the setup file and install it.

  1. Open the Chapter 4 example in Visual Studio .NET.
  2. Figure 1.1 - Open a project
  3. Change the Active Solution Configuration from Debug to Release.
  4. Figure 1.2 - The Release button
    Debug and Release are different configurations for building your project. As the name implies, you generally use the Debug mode for debugging your project and the Release mode for the final build for end user. The Debug mode does not optimize the binary it produces (as optimizations can greatly complicate debugging) and generates additional data to aid debugging. The Release mode enables optimizations and generates less extra debug data.
  5. From the main menu, select Build > Build Solution to compile the code.
  6. Figure 1.3 - To build solution
  7. The Release folder is created in bin folder of the project path. It contains all the referenced libraries and executable file.
  8. Figure 1.4 - The bin folder
    Figure 1.5 - The release folder
  9. Copy the configuration file (hibernate.cfg.xml) from DB-VA generated C# project to the Release folder. The configuration file contains the connect database information. The application will fail when execution if this file is missing.
  10. Figure 1.6 - The hibernate.cfg.xml files in the release folder
  11. Right Click the Solution, select Add > New Project from menu.
  12. Figure 1.7 - Create a new project
  13. Select Setup and Deployment Project in Project Types, and the select Setup Wizard in Templates. Click OK to create the Setup and Deployment Project.
  14. Figure 1.8 - Select the template
  15. The Setup Project Wizard is shown.
  16. Figure 1.9 - setup Wizard
  17. Select Create a setup for a Windows application and then click Next >.
  18. Figure 1.10 - Choose a project type
  19. Choose the Primary output from Standalone School System, this option will help you to add all the DLL or EXE file to the setup file. You must select a correct project for primary output in solution. After that, click Finish. You can also click Next> to follow the wizard to add readme file to the setup file.
  20. Figure 1.11 - Select the project output
  21. The Setup project is created.
  22. Figure 1.12 - Project created
  23. Open the File System (Setup) of the Setup project. Right click the Application Folder, select Add > File to add the hibernate.cfg.xml manually.
  24. Figure 1.13 - To add file to project
    Figure 1.14 - The files in the folder
  25. Right click Primary output from Standalone School System and then select Create Shortcut to Primary output from Standalone School System.
  26. Figure 1.15 - To create shortcut to primary output
  27. The shortcut is created on the Application Folder. You can change the properties of the shortcut.
  28. For Name -School System

    For Folder -User's Desktop

    This shortcut will be created on the user's desktop when user installs this application.

    Figure 1.16 - The Project properties
  29. Right Click the School System Setup project and select Build to create the installer.
  30. Figure 1.17 - To build the application
  31. The setup file is created in School Project Setup\Release folder.
  32. Figure 1.18 - The Installer are created

Installing the Application

The setup file is created in School Project Setup\Release folder. Now, you can copy the School Project Setup.msi file to another machine and install it.

  1. Double click the School Project Setup.msi file to start install, and then click Next >.
  2. Figure 1.19 - Setup welcome page
  3. Select the path to install the application. By default, application install in the Program File. Click Next>.
  4. Figure 1.20 - Select the install directory
  5. Confirm to install then the application will be installed on your selected path. Click Close to finish the installation.
  6. Figure 1.23 - Install complete message

    The installer created shortcut of School System on the Desktop and installed the application on selected path. User can double-click this shortcut to execute the standalone .NET application.

    Figure 1.24 - Desktop shortcut are created

Previous Next
Visual Paradigm International Limited
Website: www.visual-paradigm.com
E-mail: support@visual-paradigm.com