What does the prebuild application do?

The prebuild application is a console application that is launched by Visual Studio before the NodeConfigTool project is built. It's job is to verify and prepare the Phoenix web application and database scripts, so that they can be stored as Resources within the final binary of the NodeConfigTool application.

Note:
prebuild is implemented as a Pre-Build event on the NodeConfigTool project and is launched when that project is being built. For more information, see Build the NodeConfigTool tool.

The following is a list of everything prebuild does.

1. Delete Unecessary Files

2. Sanitize the appSettings.config file

3. Sanitize the web.config file

4. Archive the files of the web application

5. Prepare the SQL scripts for storage

This step has two main purposes:

  1. Ensure that the concatenated SQL files are up to date based on the time-stamps of each script in it's source folder.

    The table below shows the source folder that was used to create each concatenated SQL script. For example, the timestamp of 2functions.sql is compared with every *.sql file in \Phoenix.Database\_Functions. If any source files are more recent than the concatenated script file, a warning is displayed in the console.

    Caution:
    If the concatenated scripts are out-of-date, you will have to execute the joinscripts.bat file manually. Refer to the section on how to Concatenate the Database scripts.
    SQL Script file Source Folder
    2functions.sql \Phoenix.Database\_Functions
    3views.sql \Phoenix.Database\_Tables and Views
    4sprocs.sql \Phoenix.Database\Admin,
    \Phoenix.Database\Library,
    \Phoenix.Database\MapEngine,
    \Phoenix.Database\Metadata,
    \Phoenix.Database\Providers,
    \Phoenix.Database\Registry,
    \Phoenix.Database\Reporting,
    \Phoenix.Database\SAGA
  2. Compress and encrypt the concatenated SQL files into a binary resource.

    Compression of the script files is handled by the ICSharpZip library which shrinks the content of each text file, resulting in a binary file. As added security, and to thwart possible attempts to reverse engineer the database scripts, each binary is then encrypted using the DES standard. See Zip..::.CompressToFile for more information on this.

The illustration below shows what tools are involved to ensure that the SQL scripts are accurately packaged into the final executable.

Figure:How the SQL scripts end up in the final executable

Back to Top

See Also