Configuring the Copying of rti_workspace
RTI Connext DDS 5.2.0 introduced rti_workspace, a directory containing examples and user configuration files that is automatically copied into the users' home or My Documents folder when the first RTI application is launched (e.g., RTI Launcher, rtiddsgen, or rtipkginstall).
This solution explains the contents of the rti_workspace and how to configure the copying mechanism to:
- Disable copying the examples.
- Disable the copy of the whole rti_workspace directory.
- Change the default location of the rti_workspace directory.
It also describes how to automate the installation of RTI Connext DDS with the desired copying behavior.
Contents of rti_workspace
The skeleton for rti_workspace is located under rti_connext_dds-x.y.z/resource/template/rti_workspace. It includes two subdirectories:
- examples/, which contains code in different languages illustrating several features of RTI Connext DDS.
- user_config/, which contains user configuration files for different tools, services, and utilities that bundled with RTI Connext DDS.
The skeleton is copied into the users' home or My Documents directory when the first RTI application is run. The mechanism that triggers the copy is implemented in rti_connext_dds-x.y.z/resource/scripts/rticommon.[sh|bat], which is invoked by all the scripts under rti_connext_dds-x.y.z/bin that launch RTI applications. By default the rti_workspace folder is copied into the following locations:
- On Mac OS X systems: /Users/your user name/rti_workspace/x.y.z.
- On Linux and the rest of UNIX-based systems: /home/your user name/rti_workspace/x.y.z.
- Windows systems: <your Windows documents folder>\rti_workspace\x.y.z.
Where <your Windows documents folder> depends on your version of Windows. For example, on Windows 7, the folder is C:\Users\your user name\Documents; on Windows Server 2003, the folder is C:\Documents and Settings\your user name\Documents.
Applications such as RTI Launcher require the rti_workspace to be present, but in general most of the RTI services and utilities do not require the rti_workspace to be present in the users' home or My Documents directory. Consequently, RTI Connext DDS implements different options to disable copying the copy of the whole rti_workspace directory, the example it contains, and the location of the rti_workspace directory.
Configuring the Copying of rti_workspace
To configure the copy behavior of rti_workspace for all the users of the RTI installation you can edit or overwrite rticommon_config.[sh|bat] with the following options right after installing RTI Connext DDS (i.e., right before running any RTI application—including rtipkginstall).
- On Unix systems modify or overwrite rti_connext_dds-x.y.z/resource/scripts/rticommon_config.sh:
# rticommon_config.sh # ------------------- # copy_workspace enables copying the whole rti_workspace folder. Set to false to disable this. # copy_workspace=false # copy_examples enables copying the examples directory. Set to false to disable this. # copy_examples=false # workspace_dir configures where the rti_workspace directory is copied over. # workspace_dir="$HOME/my/custom/path"
- On Windows systems modify or overwrite rti_connext_dds-x.y.z/resource/scripts/rticommon_config.bat:
@REM rticommon_config.bat @REM -------------------- @REM copyWorkspace enables copying the whole rti_workspace folder. Set to false to disable this. @REM set copyWorkspace=false @REM copyExamples enables copying the examples directory. Set to false to isable this. @REM set copyExamples=false @REM workspaceDir configures where the rti_workspace directory is copied over. @REM "workspaceDir=C:\Users\%USERNAME%\My\Custom\Dir"
Alternatively, you can disable the automatic copy for just the current user by creating an rticommon_config.[sh|.bat] configuration file with the desired contents under:
- On Unix systems: $HOME/.rti/rticommon_config.sh.
- On Windows systems: <your home directory>\rti\rticommon_config.bat.
Note that this latter option takes precedence.
Automating RTI Connext DDS Installation with the Desired Copying Behavior
To automate the installation of RTI Connext DDS with the appropriate copy behavior, users benefit from the unattended installation mode of the RTI Connext DDS installer and a customized rticommon_config.[sh|bat] file.
For example, to create an RTI Connext DDS installation where the copying the rti_workspace is disabled, follow these steps.
On Unix Systems
First, create a custom rticommon_config.sh file that disables copying the rti_workspace:
# rticommon_config.sh # ------------------- copy_workspace=false
Next, install RTI Connext DDS using the unattended mode.
$ ./rti_connext_dds-x.y.z-pro-host-x64Linux.run --mode unattended --prefix $HOME/rti_connext_dds-x.y.z
Finally replace the default rticommon_config.sh file with your custom configuration file:
$ cp rticommon_config.sh $HOME/rti_connext_dds-x.y.z/resource/scripts/rticommon_config.sh
On Windows Systems
First, create a custom rticommon_config.bat file that disables copying the rti_workspace:
@REM rticommon_config.bat @REM -------------------- copyWorkspace=false
Next, install RTI Connext DDS using the unattended mode.
% rti_connext_dds-x.y.z-pro-host-i86Win32.exe --mode unattendedui minimalWithDialogs --prefix C:\Program Files\rti_connext_dds-x.y.z
Finally replace the default rticommon_config.bat file with your custom configuration file:
% copy rticommon_config.bat C:\Program Files\rti_connext_dds-x.y.z\resource\scripts\rticommon_config.bat
Comments
persan
Tue, 05/09/2017 - 07:52
Permalink
A small note
By copying the file ${root}/rti_connext_dds-x.y.z/resource/scripts/rticommon_config.sh to ${HOME}/.rti/rticommon_config.sh things could be set per user when using a system installation.