With recent changes to vapor windows projects (both in main branch and VAPOR_3_0)  Vapor builds and runs using Visual Studio 2015.  This is however not compatible with Visual Studio 2010 so several changes are needed for building the code on windows, as well as building the windows installers.

Installation:  Install Visual Studio 2015, as well as "Visual Studio Installer Projects Extension".  Note that these are free but you will need to register an account with microsoft.com if you continue to use these longer than a month.

Building vapor:  First you need to download and unzip the files vaporwin64deps.zip and Vapor3rdParty2015.zip from /glade/p/DASG/VAPOR/third-party/apps-2014/Windows/.  The following environment variables point into the directories where these are installed:

Environment Variables:

IDL_INC_PATH points to Vapor3rdParty2015/include/IDLexternal

PYTHON64ROOT points to Vapor3rdParty2015/Python-2.7.12 (Or wherever you have installed the Python you are using)

VAPOR_PYTHONHOME also points to Vapor3rdParty2015/Python-2.7.12 (Or wherever you have installed the Python you are using)

QTDIR64 points to vaporwin64deps2015/Qt/4.8.6

QTDIR is set to QTDIR64

VAPOR_WIN64_RELEASE_LIB_PATH is set to Vapor3rdParty2015/releaseLib64

VAPOR_WIN64_DEBUG_LIB_PATH is only used in the debug build and currently can be set to VAPOR_WIN64_RELEASE_LIB_PATH

VAPORDEPS_INC_DIR is set to Vapor3rdParty2015/include

In order to execute vaporgui in visual studio, you need to set VAPOR_HOME to the root of the source tree you are using for development, and to put vaporwin64deps2015/vapordlls/ in your Path.  It is also useful to set VAPOR_PREFS_DIR to where you keep the latest preferences file.  If you are executing VAPOR 3, you should set VAPOR3_HOME and VAPOR3_PREFS_DIR. For experimenting with different Python installations, set VAPOR_PYTHONHOME to the root of the python tree that you want to run with.  This will override the default location, which is $VAPOR_HOME/lib/python2.7 .

Building third-party Libraries Documentation

Further notes on third-party libs on VS2015:

Stas has provided build software and libraries at 

/glade/p/DASG/VAPOR/third-party/VaporLibraries_2015.tar.gz
/glade/p/DASG/VAPOR/third-party/VaporLibraries_build_2015.tar.gz
His instructions for building these libraries is at
/glade/p/DASG/VAPOR/third-party/2015_notes.md
Stas's third-party libraries work OK, except that you need to also obtain a version of Python that was built with visual studio 2015 (e.g. as provided by Anaconda).  You will need to obtain all the HDF-related libraries (hdf*, szip, zlib)  from the HDF website. You may also need to rename his assimp library.
Building an installer:
Whenever the Python version changes, the best way I know how to get an installer is to construct it from scratch, since it is extremely difficult (for me) to remove the changed Python files from an installer and insert the new ones.  Other changes to the installer are easier, for example it's pretty easy to change a dependent library or add some new files into an existing installer.

To build a new installer from scratch, it's easiest to create a new installer project while retaining the previous installer, so that you can see all the settings, files, etc. of the previous installer.  When you are satisfied that the new installer works OK you can delete the old one from the solution.
Prior to building the installer, you should make sure the Python directory is not too bloated, but has all the modules that are needed.  If you are using Anaconda then you can use  mini-conda to select the modules you need, and then use pip to install seedMe. Note that you won't be able to easily change the Python directory without rebuilding the installer.

The steps are as follows:

1.  Create a new installer setup project.   In the project settings, select the name of the installer .msi output file (which goes into targets/win64/installer/ )  Additional settings can be postponed until you have specified the location of files in the target machine.  Let's say this installer project is named "myInstaller"
2.  Open the file system editor for the new installer project.  You may also want to open the file system editor for the previous installer for comparison.
2.1  Specify top level directories (NCAR/VAPOR/{bin, include, share, lib} in the Program Files (64-bit) folder.  Also specify System folder, User's desktop, and User's Programs menu.
2.2 Copy all of the 3rd party dlls (from vapordlls directory) into the bin directory.  You can just drag and drop them into the installer.
2.3 Copy all of the outputs of various projects (executables and dlls) to the bin directory.  Don't copy the files, right click on the bin directory in the VS2015 file system editor, and select "Add project output".
2.4 Additional files that go into the bin directory:  getWMSImage.sh , libidf_vdfmodule.dlm , vdfbkup.plvdfcp.pl, python.exe, vapor-setup-win32.sh, vapor-setup-win32.csh .  The vapor-setup-win32.* files in the bin directory should be renamed, removing the "-win32" from the names.
2.5 In the share directory:
2.5.1 Drag and drop the examples, fonts, grib_api, image, palettes, python, shaders, and udunits subdirectories from the source share directory into the share directory in the installer.  This will take some time because there are lots of files.
2.5.2 Drag and drop the proj directory from Vapor3rdParty into the installer share directory.  
2.5.3 Create a doc subdirectory of the installer share directory, and copy the two html files from share/doc/help into that directory.
2.6.  Create a python2.7 subdirectory of the VAPOR/lib directory.  Drag the three subdirectories DLLs, Lib, and Libraries from the Vapor3rdParty/Python-2.x.x/ directory into the python2.7 directory. (this will take some time)
2.7 Drag and drop the include/vapor directory into the VAPOR/include directory of the installer.
2.8 Copy uninstallVapor64.vbs and installVapor.vbs into the make/win32/myInstaller directory in your source tree.  you will want to git-add these files as well as myInstaller.vdproj to the source tree.  Then copy these files into the NCAR directory in the installer.
2.9 Copy the image and icon files splashwide.jpg, vapor-win-icon.ico, VDCWizard.ico from the Images directory into the NCAR/VAPOR directory in the installer.
2.10 Copy vapor-setup.bat to the System folder.
2.11 Make shortcuts to the project outputs of VDCWizard and vaporgui in the bin directory (use the right mouse button on these files)   Then move the shortcuts to the User's Programs Menu.  Rename the shortcuts to "vaporgui" and VDCWizard".  For each of the two shortcuts specify the appropriate icon from the NCAR/VAPOR directory.
3. Bring up the File Types Editor.  Create a file type for Vapor Metadata File (.vdf) and Vapor session file (.vss).  Specify the icon and the command for each file type.  Compare with the settings for the previous installer.
4. Bring up the user interface editor.  At each step (10 total) specify splashwide.jpg as the BannerBitmap.
5. Bring up the launch conditions editor.  Create two searches on target machine, one for 32-bit vaporgui.exe and the other for 64-bit vaporgui.exe.  32-bit should reside at depth 5 in the [ProgramFilesFolder]\NCAR\VAPOR resulting in FILEEXISTS1, and 64 bit should be at depth 5 in the [ProgramFiles64Folder]\NCAR\VAPOR, resulting in FILEEXISTS2.  Create a launch condition for each of these conditions.  If either one is true, the message specifies that the user must uninstall vapor before proceeding.
6.  Bring up the custom actions editor.  Create a custom action on install, using installVapor64.vbs, with customActionData being [ALLUSERS]<>[TARGETDIR], and another custom action on uninstall using uninstallVapor64.vbs with the same CustomActionData.
7.  In the deployment project properties for myInstaller, specify the AddRemovePrograms Icon to be the vapor icon.  Also specify description, URL, product name and version number.

Once the above is complete you can build the installer.  Before you build it, it is a good idea to make sure that no vapor dll's are in your path, since otherwise the installer may decide to include them too. Also check the installer sub folder "Detected Dependencies" and make sure it does not include any of the dll's you are installing. Right click on myInstaller to build the installer, which will build all the needed projects first.

  • No labels