Network and Local Configurations

We are going through a large PC refresh and a significant number of our new machines will be laptops. We are trying to work how to have the configuration (cfg) available to the laptop machines when offline. We have set up a sync from the network to the local machine for the cfg. and I have edited the ConfigurationSetup.cfg as follows;

[General]
_PDT_nDrv = M:/
_PDT_lDrv = C:/
_PDT_locCFG = PennDOT_CE_Configuration/

%if exists ($(_PDT_nDrv)$(_PDT_locCFG)*.cfg)
   _PDT_Drv = $(_PDT_nDrv)
%else
   %if exists ($(_PDT_lDrv)$(_PDT_locCFG)*.cfg)
      _PDT_Drv = $(_PDT_lDrv)
   %else
      error Exiting, No network or local Configuration found
   %endif
%endif

_USTN_CUSTOM_CONFIGURATION = $(_PDT_Drv)$(_PDT_locCFG)

[SetConfiguration]
%if !defined (_USTN_USER_CONFIGURATION)
%if defined (_USTN_CUSTOM_CONFIGURATION) && ($(_USTN_CUSTOM_CONFIGURATION) != "") && exists ($(_USTN_CUSTOM_CONFIGURATION))
_USTN_CONFIGURATION = M:/PennDOT_CE_Configuration/
%endif
%endif

Unfortunately line 21 doesn't seem to like being redefined to a new value.

Here is my debug for this section, note line 9 and 10;

    Processing macro file [C:\ProgramData\Bentley\MicroStation CONNECT Edition\Configuration\ConfigurationSetup.cfg]
      (System): _PDT_nDrv=M:\ [M:\]
      (System): _PDT_lDrv=C:\ [C:\]
      (System): _PDT_locCFG=PennDOT_CE_Configuration\ [PennDOT_CE_Configuration\]
      Starting skip to endif, [C:\ProgramData\Bentley\MicroStation CONNECT Edition\Configuration\ConfigurationSetup.cfg], line 27, depth = 0.
      (System): _PDT_Drv=$(_PDT_lDrv) [C:\]
      Starting skip to endif, [C:\ProgramData\Bentley\MicroStation CONNECT Edition\Configuration\ConfigurationSetup.cfg], line 32, depth = 0.
      endif, [C:\ProgramData\Bentley\MicroStation CONNECT Edition\Configuration\ConfigurationSetup.cfg], line 34, depth = 0.
      (System): _USTN_CUSTOM_CONFIGURATION=$(_PDT_Drv)$(_PDT_locCFG) [C:\PennDOT_CE_Configuration\]
      (System): _USTN_CONFIGURATION=M:\PennDOT_CE_Configuration\ [M:\PennDOT_CE_Configuration\]
    End of macro file [C:\ProgramData\Bentley\MicroStation CONNECT Edition\Configuration\ConfigurationSetup.cfg]
 

I have also tried to defining line 21 to use a variable and not be hard coded but that doesn't seem to work.

_USTN_CONFIGURATION = $(_USTN_CUSTOM_CONFIGURATION)

Any help on how others would be handling configurations for laptops would be helpful. I would prefer to not use different icons for Network and Local configurations.

Parents
  • what does the debug look like when you have 

    _USTN_CONFIGURATION = $(_USTN_CUSTOM_CONFIGURATION)

    Timothy Hickman

    CADD Manager | CADD Department

    timothy.hickman@colliersengineering.com

    Main: 877 627 3772| 

    1000 Waterview Drive Suite 201 | Hamilton, New Jersey 08691

  • Tim,

    What I was noticing is that _ustn_configuration was getting the hard coded path and was sticking to that path and not being redefined upon launch each time. And then now Monday all is fine. Friday gremlins I guess.

    Thanks Kevin. What you and I are doing is very similar so I guess I am on the right path.

    What I ended up with was.

    [General]
    _PDT_nDrv = M:/
    _PDT_lDrv = C:/
    _PDT_CFGroot = PennDOT_CE_Configuration/
    
    %if exists ($(_PDT_nDrv)$(_PDT_CFGroot))
       _PDT_Drv = $(_PDT_nDrv)
    %else
       %if exists ($(_PDT_lDrv)$(_PDT_CFGroot))
          _PDT_Drv = $(_PDT_lDrv)
       %else
          %error Exiting, No network or local Configuration found. Please contact CADD support!
       %endif
    %endif
    
    _USTN_CUSTOM_CONFIGURATION = $(_PDT_Drv)$(_PDT_CFGroot)
    
    [SetConfiguration]
    %if !defined (_USTN_USER_CONFIGURATION)
    %if defined (_USTN_CUSTOM_CONFIGURATION) && ($(_USTN_CUSTOM_CONFIGURATION) != "") && exists ($(_USTN_CUSTOM_CONFIGURATION))
    _USTN_CONFIGURATION = $(_USTN_CUSTOM_CONFIGURATION)
    %endif
    %endif

    It seems to be working ok for now. I did remove the *.cfg as my test and just look for the directory but I may change that back as it needs the cfg file to work correctly.

    ~HTH

    John.

    yep

Reply
  • Tim,

    What I was noticing is that _ustn_configuration was getting the hard coded path and was sticking to that path and not being redefined upon launch each time. And then now Monday all is fine. Friday gremlins I guess.

    Thanks Kevin. What you and I are doing is very similar so I guess I am on the right path.

    What I ended up with was.

    [General]
    _PDT_nDrv = M:/
    _PDT_lDrv = C:/
    _PDT_CFGroot = PennDOT_CE_Configuration/
    
    %if exists ($(_PDT_nDrv)$(_PDT_CFGroot))
       _PDT_Drv = $(_PDT_nDrv)
    %else
       %if exists ($(_PDT_lDrv)$(_PDT_CFGroot))
          _PDT_Drv = $(_PDT_lDrv)
       %else
          %error Exiting, No network or local Configuration found. Please contact CADD support!
       %endif
    %endif
    
    _USTN_CUSTOM_CONFIGURATION = $(_PDT_Drv)$(_PDT_CFGroot)
    
    [SetConfiguration]
    %if !defined (_USTN_USER_CONFIGURATION)
    %if defined (_USTN_CUSTOM_CONFIGURATION) && ($(_USTN_CUSTOM_CONFIGURATION) != "") && exists ($(_USTN_CUSTOM_CONFIGURATION))
    _USTN_CONFIGURATION = $(_USTN_CUSTOM_CONFIGURATION)
    %endif
    %endif

    It seems to be working ok for now. I did remove the *.cfg as my test and just look for the directory but I may change that back as it needs the cfg file to work correctly.

    ~HTH

    John.

    yep

Children
No Data