The Ultimate Portable Build - Part 2 - The appl.cfg

Hard part done. By using the location of CADmanage.hta as a start point, we've now been able to go ahead and set the variables for our critical locations, but what does this mean for the config files we've been using to date? Well the first of these that will need to be edited is the appl.cfg file that we use to trigger the location of _USTN_SITE. To date we've been setting a few hard coded locations at the top of the cfg file so we could set the site location:

build_drv = R:/_CADmanage/Bentley/Standard/
local_bld = C:/_CADmanage/Bentley/Standard/
base_dir = R:/_CADmanage/Bentley/

#---------------------------------------------------------------------------
# Set standard configuration based upon MicroStation version
#---------------------------------------------------------------------------
%if exists ($(build_drv)$(MS_VER)/Standards/.)
_USTN_SITE = $(build_drv)$(MS_VER)/Standards/
%endif

Now that we have set all these locations using the relative pathing in the hta file, these hard coded location can be removed and while the version call ups remain the same, the process environment variable we set:
Bentley_Root = DRV_Root + "\Bentley\"
oEnv("hta_sBentley") = Replace(BENTLEY_ROOT, "/", "\")
'msgbox Bentley_Root
can now be carried through to the appl.cfg so that we end up with:
%if exists ($(hta_sBentley)$(MS_VER)/Standards/.)
_USTN_SITE = $(hta_sBentley)$(MS_VER)/Standards/
%endif
We can also remove the reference to the local build:
%if exists ($(local_bld)$(MS_VER)/Standards/.)
_USTN_SITE = $(local_bld)$(MS_VER)/Standards/
%endif
as the relative pathing now means we can have the site location set by having the build in any location possible. All we have to do to get this build to run off C drive is to copy it locally. Once CADmanage.hta has been started, the hta picks up where the hta file is located and all relative paths are then set.
All up our new appl.cfg files looks like:
#---------------------------------------------------------------------------
# Determine MicroStation Version
#---------------------------------------------------------------------------


MS_VER = MS89

%if defined (_VERSION70)
MS_VER = MS70
%endif

%if defined (_VERSION80)
MS_VER = MS85
%endif

%if defined (_VERSION_8_11)
MS_VER = MS811_SS3
%endif

#---------------------------------------------------------------------------
# Set standard configuration based upon MicroStation version
#---------------------------------------------------------------------------

%if exists ($(hta_sBentley)$(MS_VER)/Standards/.)
_USTN_SITE = $(hta_sBentley)$(MS_VER)/Standards/
%endif

More soon.