fwInstallation  8.4.1
Functions | Variables
fwInstallation.ctl File Reference

Functions

int fwInstallation_getComponentFilesForHashCalculation (string component, dyn_string &componentFiles)
 
int fwInstallation_calculateComponentSourceFilesHashes (string component)
 
int fwInstallation_storeComponentSourceFilesHashes (string component, dyn_string fileNames, dyn_string baseFileHashes, dyn_string alternativeFileHashes)
 
string fwInstallation_formatComponentSourceFileHashString (string fileName, string baseFileHash, string alternativeFileHash="")
 
int fwInstallation_getComponentSourceFilesHashes (string component, dyn_string &fileNames, dyn_string &baseFileHashes, dyn_string &alternativeFileHashes)
 
int fwInstallation_setAlternativeComponentFileHash (string component, string fileName, string directory="")
 
int fwInstallation_resetAlternativeComponentFileHash (string component, string fileName)
 
int fwInstallation_getComponentFilesWithAlternativeHash (string component, dyn_string &filesWithAlternativeHash)
 
int fwInstallation_getProjectFileIssues (dyn_dyn_mixed &fileIssues)
 
int fwInstallation_getComponentFilesIssues (string component, dyn_mapping &errorFiles, bool getOverparameterized=true, bool getHash=true, bool getHashCompNotPossible=true, bool useAlternativeHash=true)
 
int fwInstallation_installComponentSet (dyn_string componentFiles, string &dontRestartProject)
 
int fwInstallation_deleteComponentSet (dyn_string dynComponentsNames, bool deleteFiles)
 
int fwInstallation_stopManagersForInstallation ()
 
int fwInstallation_parseHostPortConfigEntry (string configHostEntry, dyn_dyn_string &hostAliases, dyn_dyn_int &ports)
 
void _fwInstallation_parseDistPeer (string distPeer, string &host, string &reduHost, string &port)
 
int fwInstallation_deleteProjectPaths (dyn_string paths)
 
int fwInstallation_addProjectPaths (dyn_string dbPaths)
 
dyn_string fwInstallation_getHostPvssVersions ()
 
private dyn_string fwInstallation_getPvssVersionsFromWinRegKey (string key)
 
string fwInstallation_getWinRegKey (string key)
 
dyn_string fwInstallation_getComponentPendingPostInstalls (string component, int reduHostNum=0)
 
dyn_string fwInstallation_getProjectPendingPostInstalls (int reduHostNum=0)
 
void fwInstallation_resetLog ()
 
string fwInstallation_getWCCOAExecutable (string type)
 
void fwInstallation_appendLog (string msg, string severity)
 
bool fwInstallation_isPatchInstalled (string patch)
 
int fwInstallation_checkPvssVersion (string reqVersion)
 
int fwInstallation_checkToolVersion (string reqVersion)
 
float fwInstallation_pvssVersionAsFloat (string reqVersion, int &major, int &minor, int &sp)
 
int fwInstallation_getPvssSystemProperties (string systemName, dyn_mixed &pvssSystem)
 
void fwInstallation_throw (string msg, string severity="ERROR", int code=1)
 
string fwInstallation_getAfterInitRestartNeededDpElem ()
 
string fwInstallation_getAfterInitRestartRequesterDpElem ()
 
int fwInstallation_requestProjectRestartAfterInit (string requester)
 
int fwInstallation_clearProjectRestartAfterInit ()
 
int fwInstallation_isProjectRestartAfterInitPending ()
 
dyn_string fwInstallation_orderDplFiles (dyn_string files, dyn_int attribs)
 
int fwInstallation_closePanel (bool closeIfConnected=false)
 
string fwInstallation_getHostname (string hostName="")
 
string fwInstallation_getInstallationDp ()
 
string fwInstallation_getFileIssuesSyncDpElem ()
 
bool fwInstallation_deleteFromConfigFile ()
 
void fwInstallation_flagDeprecated (string deprecated, string toBeUsed="")
 
string fwInstallation_findFileForPvssVersion (string baseFileName, dyn_string targetVersions=makeDynString(), bool considerSpLevel=FALSE)
 
int _fwInstallation_getStringFromSystemCommand (string command, string &systemExecResult, bool trim=false)
 
int fwInstallation_getHostMemorySize (string &memSizeInBytes)
 
int fwInstallation_getHostCpuInfo (string &cpuInfo)
 
int fwInstallation_getLinuxInstalledPackages (string grepExpression, string &packages)
 
int fwInstallation_getFMCInstalledPackages (string &packages)
 
int fwInstallation_getWCCOAInstalledPackages (string &packages)
 
int fwInstallation_getHostProperties (string hostname, dyn_mixed &pvssHostInfo)
 
int fwInstallation_sendToTrash (string filename, string trashPath="")
 
int fwInstallation_emptyTrash (string path="")
 
int fwInstallation_moveFile (string source, string target, bool overwriteFile=false)
 
bool fwInstallation_fileCompareBinary (string filename1, string filename2)
 
int fwInstallation_safeFileOverwrite (string source, string destination, string trashPath="", bool compare=true)
 
int fwInstallation_copyFile (string source, string destination, string trashPath="", bool compare=true)
 
private int fwInstallation_copyFile_handleFileOverwriting (string source, string destination, string trashPath="")
 
private int fwInstallation_copyFile_windowsCmd (string source, string target)
 
int fwInstallation_registerProjectPath (string sPath)
 
string fwInstallation_getComponentVersion (string component, int reduHostNum=0)
 
bool fwInstallation_isComponentInstalled (string component, string &version, int reduHostNum=0)
 
int fwInstallation_getComponentSourceDir (string component, string &sourceDir)
 
string fwInstallation_dp2name (string dp)
 
void fwInstallation_setToolStatus (bool status)
 
int fwInstallation_executePostInstallScripts ()
 
int fwInstallation_createTrash (string sourceDir)
 
int fwInstallation_getToolVersion (string &version, string systemName="")
 
void fwInstallation_getToolVersionLocal (string &version)
 
int fwInstallation_getToolVersionFromDp (string &version, string systemName="")
 
string fwInstallation_getAgentDp ()
 
string fwInstallation_getAgentRequestsDp (int localReduHostNum=0)
 
int fwInstallation_getProjPaths (dyn_string &projPaths, bool adjustScattered=false)
 
private int fwInstallation_getProjPathsRaw (dyn_string &projPathsRaw)
 
int fwInstallation_getPathMappingForScattered (string &nativePathToReplace, string &scatteredPathReplacement)
 
string _fwInstallation_getWCCOAApplicationDpName (string app)
 
int fwInstallation_getWCCOAApplications (dyn_dyn_mixed &wccoaApplications)
 
int fwInstallation_backupProjectConfigFile ()
 
int fwInstallation_setProjPaths (dyn_string projPaths)
 
int fwInstallation_isPathInConfigFile (string projPath, bool &isPathInConfig)
 
synchronized int fwInstallation_addProjPath (string projPath, int position)
 
synchronized int fwInstallation_removeProjPath (string projPathToRemove)
 
string fwInstallation_getComponentDp (string componentName, int reduHostNum=0)
 
int fwInstallation_getComponentInfo (string componentName, string componentProperty, dyn_anytype &componentInfo, int reduHostNum=0)
 
dyn_string fwInstallation_getInstalledComponentDps (int reduHostNum=0)
 
int fwInstallation_getInstalledComponents (dyn_dyn_string &componentsInfo, int reduHostNum=0)
 
int fwInstallation_getAvailableComponents (dyn_string componentPaths, dyn_dyn_string &componentsInfo, string component="*", bool scanRecursively=false)
 
int fwInstallation_popup (string popupText, string popupTitle=FW_INSTALLATION_POPUP_TITLE_ERROR)
 
string paGetProjName ()
 
void fwInstallation_getApplicationSystem (string applicationName, dyn_string &systemNames)
 
string fwInstallation_getPvssVersion (dyn_string &patches)
 
 fwInstallation_showHelpFile (string componentName, string systemName="")
 
 fwInstallation_showHelpForPanel (string panelFilePath)
 
int _fwInstallation_getConfigFile (dyn_string &configLines)
 
int fwInstallation_saveFile (dyn_string &configLines, string filename)
 
void _fwInstallation_GetComponentsWithPendingPostInstall (dyn_string &components, dyn_string &scripts)
 
void _fwInstallation_DeleteComponentFromConfig (string componentName)
 
dyn_string _fwInstallation_proposeInstallationDirs ()
 
int fwInstallation_getComponentsInfo (string tableName, string sourceWidget, string systemName="", bool scanRecursively=false)
 
void fwInstallation_componentInstalled (string componentName, string requestedComponentVersion, int &result, string systemName="", bool beStrict=false, bool caseSensitive=false, bool compareOnlyVersionNumber=false)
 
void fwInstallation_showFileIssues (string componentName, bool isSubComponent)
 
 fwInstallation_showMessage (dyn_string message)
 
 fwInstallation_evalScriptFile (string componentInitFile, int &iReturn)
 
private _fwInstallation_CompareVersions_parseVersionParts (string versionString, string &versionNumber, string &preReleaseTag, string &preReleaseNumber)
 
private int _fwInstallation_CompareVersions_compareVersionNumbers (string instCompVersionNumber, string reqCompVersionNumber)
 
private int _fwInstallation_CompareVersions_compareVersionNumberPart (string instCompVersionNumberPart, string reqCompVersionNumberPart)
 
private int _fwInstallation_CompareVersions_parseNumberAndModifierString (string versionNumberPart, string &modifierString)
 
private int _fwInstallation_CompareVersions_compareVersionStrings (string instCompVersionString, string reqCompVersionString)
 
int _fwInstallation_CompareVersions (string installedComponentVersion, string requestedComponentVersion, bool beStrict=false, bool caseSensitive=false, bool compareOnlyVersionNumber=false)
 
int fwInstallation_deleteFiles (const dyn_string &componentFiles, string installationDirectory)
 
int fwInstallation_uninstallBinaryFile (string binaryFilePath)
 
void fwInstallation_writeToMainLog (string message, bool addTimestamp=true)
 
private void fwInstallation_writeToLogFile (string logPath, string message, bool addTimestamp=true)
 
string fwInstallation_timestampString ()
 
string _fwInstallation_baseDir (string filePath)
 
string _fwInstallation_fileName (string filePath)
 
int fwInstallation_putComponentsInOrder_Install (dyn_string &componentsNames, dyn_string &componentsVersions, dyn_string &componentFiles, dyn_string &componentFilesInOrder)
 
 fwInstallation_readComponentRequirements (string descFile, dyn_string &dynRequiredComponents)
 
 fwInstallation_readSubcomponents (string descFile, dyn_string &dynSubcomponents)
 
int fwInstallation_getPmonInfo (string &user, string &pwd)
 
int fwInstallation_forceProjectRestart ()
 
string fwInstallation_getComponentPath (string componentFile)
 
int fwInstallation_getRegisterOnly (string destinationDir, string componentName, bool forceOverwriteFiles, bool isSilent)
 
private int fwInstallation_overwriteComponentFilesDialog (string componentName, string installedVersion)
 
private int fwInstallation_acceptComponentInstallationPathChangeDialog (string componentName, string installedVersion)
 
int fwInstallation_installRequiredComponents (string componentName, dyn_string dynRequiredComponents, string sourceDir, bool forceInstallRequired, bool forceOverwriteFiles, bool isSilent, int &requiredInstalled, bool &actionAborted)
 
int fwInstallation_verifyDestinationDirAndSourceFiles (string componentName, string sourceDir, string subPath, string destinationDir, const dyn_string &dynFileNames, const dyn_string &dynBinFiles, bool registerOnly, int isSilent, bool &actionAborted)
 
int fwInstallation_copyComponentFiles (string componentName, string sourceDir, string subPath, string destinationDir, const dyn_string &dynFileNames, bool registerOnly)
 
string fwInstallation_getImportAsciiManagerCommand (string inputFile, dyn_string extraOptions=makeDynString(), string stdoutFile="", string stderrFile="")
 
private string fwInstallation_getPathWithinQuotationMarks (const string &path)
 
private bool fwInstallation_doesPathContainSpace (const string &path)
 
private int fwInstallation_importComponentSingleAsciiFile (string componentName, string dplFilePath, string asciiImportCmd, string logFile, bool updateTypes=true, bool isSilent=true)
 
int fwInstallation_importComponentAsciiFiles (string componentName, string sourceDir, string subPath, dyn_string dynDpListFiles, bool updateTypes=true, bool isSilent=true)
 
int fwInstallation_importConfigFiles (string componentName, string sourceDir, string subPath, dyn_string dynConfigFiles_general, dyn_string dynConfigFiles_linux, dyn_string dynConfigFiles_windows)
 
int fwInstallation_importConfigFilesOfType (string componentName, string sourceDir, string subPath, const dyn_string &dynConfigFiles, string typeLabel)
 
int fwInstallation_copyComponentBinaries (string componentName, string sourceDir, string subPath, string destinationDir, const dyn_string &binaryFiles, dyn_string &componentFileList, bool registerOnly)
 
int fwInstallation_isDirNameMatchingWinccoaVersion (string dirPath, string winccoaVersion=VERSION_DISP)
 
int fwInstallation_executeComponentInitScripts (string componentName, string sourceDir, string subPath, dyn_string dynInitFiles, int isSilent)
 
int fwInstallation_storeComponentPostInstallScripts (const string &component, const dyn_string &dynPostInstallFiles_current)
 
int fwInstallation_createComponentInternalDp (string componentName, string componentVersion, string descFile, int isItSubComponent, string sourceDir, string date, string helpFile, dyn_string qtHelpFiles, string destinationDir, dyn_string dynComponentFiles, dyn_string dynConfigFiles_general, dyn_string dynConfigFiles_linux, dyn_string dynConfigFiles_windows, dyn_string dynInitFiles, dyn_string dynPostInstallFiles, dyn_string dynDeleteFiles, dyn_string dynPostDeleteFiles, dyn_string dynDplistFiles, dyn_string dynRequiredComponents, dyn_string dynSubComponents, dyn_string dynScriptsToBeAdded, int requiredInstalled, dyn_string comments, string description)
 
int fwInstallation_checkComponentBrokenDependencies ()
 
int fwInstallation_installComponent (string descFile, string sourceDir, bool isItSubComponent, string &componentName, bool &componentInstalled, string &dontRestartProject, string subPath="", bool forceInstallRequired=false, bool forceOverwriteFiles=false, bool isSilent=false, bool installSubComponents=true)
 
int fwInstallation_setComponentInstallationStatus (string componentName, bool ok)
 
 fwInstallation_getNotInstalledComponentsFromRequiredComponents (dyn_string &dynRequiredComponents, string &strNotInstalledNames)
 
 fwInstallation_AddComponentIntoConfig (string componentConfigFile, string componentName, bool addToReduConfig=false)
 
int fwInstallation_loadFileLines (string filePath, dyn_string &fileLines)
 
void fwInstallation_deleteComponentConfigEntries (dyn_string &configLines, string componentName)
 
int fwInstallation_parseConfigLine (string configLine, string &key, dyn_string &keyValues)
 
void fwInstallation_parseConfigFileLines (const dyn_string &configLines, dyn_string &configSections, dyn_dyn_string &configKeysArray, dyn_dyn_mixed &configValuesArray)
 
bool fwInstallation_config_entryExistsInMemory (string key, string value, const dyn_string &configKeys, const dyn_mixed &configValues)
 
void fwInstallation_config_addEntryIntoMemory (string key, dyn_string keyValues, dyn_string &configKeys, dyn_mixed &configValues)
 
int fwInstallation_config_setSectionInMemory (string section, dyn_string &configSections, dyn_dyn_string &configKeysArray, dyn_dyn_mixed &configValuesArray)
 
bool fwInstallation_config_isCommentLine (string configLine)
 
bool fwInstallation_config_isSectionDefinition (string configLine)
 
string fwInstallation_config_trimComment (string configLine)
 
int fwInstallation_config_getKeyValue (string configLine, string &key, dyn_string &values)
 
string fwInstallation_config_getConfigEntryParser (string key)
 
dyn_string fwInstallation_config_parse (string valueString)
 
dyn_string fwInstallation_config_parseLoadCtrlLibs (string valueString)
 
 fwInstallation_mergeComponentConfigIntoProject (dyn_string &projectConfigLines, const dyn_string &componentConfigLines, string componentName)
 
int fwInstallation_config_getSectionLineNum (const dyn_string &configLines, string sectionName)
 
void fwInstallation_config_insertComponentTag (dyn_string &configLines, int lineNumber, string componentName, string tagTypePattern)
 
int fwInstallation_addLinesIntoSection (dyn_string &configLines, string currentSection, dyn_string linesToAdd)
 
int fwInstallation_changeProjPaths (dyn_string projPaths)
 
int fwInstallation_createPath (string sPath, bool createDirectory=true)
 
 fwInstallation_getComponentDescriptionPVSSDB (string componentName, int reduHostNum=0)
 FVR: 29/03/2006. More...
 
 fwInstallation_putComponentsInOrder_Delete (dyn_string componentsNames, dyn_string &componentsNamesInOrder)
 
 fwInstallation_getListOfDependentComponents (string componentName, dyn_string &dependentComponentsList)
 
 fwInstallation_parseRequiredComponentNameVersion (string requiredComponentNameVersion, string &requiredComponentName, string &requiredComponentVersion)
 
int fwInstallation_deleteComponent (string componentName, bool &componentDeleted, bool deleteAllFiles=TRUE, bool deleteSubComponents=true, bool &deletionAborted)
 
int fwInstallation_storePostDeleteScripts (const dyn_string &dynPostDeleteFiles_current)
 
int fwInstallation_checkDistribution (string sourceDir, const dyn_string &requiredComponents, dyn_string &dsFileComponentName, dyn_string &dsFileVersions, dyn_string &dsFileComponent)
 
int fwInstallation_checkInstalledComponent (string componentName, string version="")
 
int fwInstallation_checkTargetDirectory (string destinationDir, string componentName, string &versionInstalled)
 
dyn_string fwInstallation_getFileNamesRec (string dir=".", string pattern="*")
 
 fwInstallation_recurserFileNames (string dir, string pattern, dyn_string &fileNames)
 
int fwInstallation_getDescriptionFile (string componentName, string componentVersion, string sourceDir, string &descriptionFile, bool &isItSubComponent)
 
int fwInstallation_isSubComponent (string xmlFile, bool &isSubComponent)
 
int fwInstallation_getDistPort ()
 
int fwInstallation_getReduPort ()
 
int fwInstallation_getSplitPort ()
 
string fwInstallation_getPmonUser ()
 
string fwInstallation_getPmonPwd ()
 
string fwInstallation_getPmonHostname ()
 
int fwInstallation_getProjectProperties (dyn_mixed &projectInfo)
 
int fwInstallation_createDbInitFile ()
 
int fwInstallation_isPmonProtected ()
 
int fwInstallation_postInstallToRun (dyn_string &allPostInstallFiles)
 
int fwInstallation_getSections (dyn_string &dsSectionList, string sPattern="")
 
int fwInstallation_getSection (string section, dyn_string &configEntry)
 
int fwInstallation_setSection (string section, dyn_string configEntry)
 
int fwInstallation_clearSection (string section)
 
int fwInstallation_addToSection (string section, dyn_string configEntry)
 
void fwInstallationXml_getComponentDescription (string descFile)
 
int fwInstallation_normalizePath (string &projPath, bool addTrailingSlash=false)
 
int fwInstallation_normalizePathList (dyn_string &projPaths, bool addTrailingSlash=false)
 
dyn_string fwInstallation_splitLines (string s)
 
string fwInstallation_formatPowershellCommandForWinCmd (string powershellCommand)
 
string fwInstallation_getVersionString (string version, string versionTag)
 
void fwInstallation_cleanupObsoleteFiles (string componentName, const dyn_string &obsoleteFiles, bool recursive=false)
 
void fwInstallation_cleanupObsoleteFilesFromPath (string componentName, string path, const dyn_string &obsoleteFiles, bool recursive=false)
 
int fwInstallation_removeEmptyDirectory (string dirPath)
 
dyn_string fwInstallation_getSubdirectories (string dir, string pattern="*")
 
int fwInstallation_trackDependency_register (string triggeringComponent, string requiredComponent)
 
void fwInstallation_trackDependency_unregister (string triggeringComponent)
 
 fwInstallation_trackDependency_clear ()
 
bool fwInstallation_trackDependency_isCircular (string triggeringComponent, string requiredComponent)
 
private bool fwInstallation_trackDependency_findCircularRecursively (string triggeringComponent, string requiredComponent, dyn_string &recursiveChain)
 
string _fwInstallation_getDevicesDpPattern (string deviceType, string &devicesDpt)
 
string fwInstallation_getDeviceNameFromDp (string deviceDp, string deviceType)
 
string fwInstallation_getAdditionalPlcInfo (string plcDp)
 
int fwInstallation_getDevices (string deviceType, string application, dyn_dyn_mixed &devices)
 
private int fwInstallation_ui_getInstalledComponentsInfo (dyn_dyn_mixed &installedComponentsToDisplay, bool &componentsIncorrectlyInstalled, bool &componentsBrokenDependencies, int reduHostNum)
 
private void fwInstallation_ui_getInstalledComponentsInfoRecursively (dyn_dyn_mixed &installedComponentsToDisplay, string componentDp, string parentComponent, int &index, dyn_string &pendingSubcomponents, bool &componentsIncorrectlyInstalled, bool &componentsBrokenDependencies, int reduHostNum)
 
private void fwInstallation_ui_updateInstalledComponentsStatusInfo (shape fileIssueLabelShape, shape fileIssueArrowShape, bool componentsIncorrectlyInstalled, bool componentsBrokenDependencies)
 
synchronized void fwInstallation_ui_displayInstalledComponents (shape tableShape, shape fileIssueLabelShape, shape fileIssueArrowShape, bool subcomponentsVisible, int reduHostNum=0)
 
private int fwInstallation_ui_getAvailableComponentsInfo (dyn_dyn_anytype &availableComponentsToDisplay, string sourceDirectory, bool scanRecursively=false, string systemName="")
 
void fwInstallation_ui_displayAvailableComponents (shape tableShape, string sourceDir, bool scanRecursively, bool subcomponentsVisible, bool hiddenComponentsVisible, string systemName="")
 
void fwInstallation_ui_filterComponentsTable (shape tableShape, bool subcomponentsVisible, bool hiddenComponentsVisible)
 
 fwInstallation_ui_getMarkedComponentsData (shape tableShape, const dyn_string &markLabels, const dyn_string &columnsToGet, dyn_dyn_mixed &componentsInfo)
 
dyn_mixed fwInstallation_ui_getColumnsInRow (shape tableShape, int row, const dyn_string &columnsToGet)
 
 fwInstallation_ui_componentsTableRightClickPopupMenu (shape tableShape, int row, string column)
 
private void fwInstallation_ui_copyComponentsListToClipboard (shape tableShape)
 
string fwInstallation_ui_getTableColumnsAsString (shape tableShape, dyn_string columns, bool addHeader=true, string colSeparator="\t", bool onlyVisible=true)
 
void fwInstallation_ui_setTableAlternatingRowColors (shape table)
 
void fwInstallation_ui_openReleaseNotes ()
 
void fwInstallation_reportInit (shape sh)
 
void fwInstallation_reportTeardown ()
 
private fwInstallation_reportSetReportShape (shape sh)
 
shape fwInstallation_reportGetReportShape ()
 
bool fwInstallation_reportReportShapeExists ()
 
private void fwInstallation_updateReport (string messageType, anytype value)
 
 fwInstallation_reportInstallationStartTime ()
 
 fwInstallation_reportSetTotalComponentsNumber (int componentsNumber)
 
 fwInstallation_reportUpdateTotalComponentsNumber (int additionalComponentsNumber)
 
 fwInstallation_reportComponentInstallationProgress (string componentName, int stage)
 
 fwInstallation_reportComponentInstallationFinished (string componentName)
 
 fwInstallation_reportInstallationMessage (errClass message)
 

Variables

const string csFwInstallationToolVersion = "8.4.1"
 
const string csFwInstallationToolTag = ""
 
const string csFwInstallationLibVersion = "8.4.1"
 
const string FW_INSTALLATION_SUPPORT_ADDRESS = "icecontrols.support@cern.ch"
 EN-ICE support line:
 
const string gFwInstallationComponentName = "fwInstallation"
 
const string gFwInstallationConfigFile = "fwInstallation.config"
 
const string gFwInstallationInitFile = "fwInstallationInit.config"
 
const int gFwInstallationError = -1
 
const int gFwInstallationOK = 0
 
bool gFwInstallationErrorShown = FALSE
 
bool gFwYesToAll = FALSE
 
string fwInstallation_VERSION_KEYWORD = "%VERSION%"
 
const string gFwTrashPath = PROJ_PATH + "/fwTrash/"
 
const string FW_INSTALLATION_RELEASE_NOTES = "fwInstallation/fwInstallationReleaseNotes.txt"
 
const string FW_INSTALLATION_LOG_FILE = "fwInstallation.log"
 
const string FW_INSTALLATION_REPORT_VARIABLE_INSTALATION_INFO_COMPONENT = "componentName"
 
const string FW_INSTALLATION_REPORT_MESSAGE_INSTALLATION_STARTED = "installationStarted"
 
const int FW_INSTALLATION_REPORT_STEP_STARTING_INSTALLATION = 1
 
fwInstallation.ctl: Definition of variables

The following variables are used by the fwInstallationManager.ctl library

dyn_bool gButtonsEnabled
 
string gUserName
 
string gPassword
 
string gDebugFlag
 
int gSelectedMan
 
int gManShifted
 
bool gRefreshManagerList
 
int gRefreshSec
 
int gRefreshMilli
 
int gRefreshTime
 
string gTcpHostName
 
int gTcpPortNumber
 
int gTcpFileDescriptor
 
int gTcpFileDescriptor2
 
string gTcpFifo
 
string gTestVariable
 
bool gShowLicenseWarning
 
int gErrorCounter
 
bool gCloseEnabled
 
dyn_string gParams
 
global string gFwInstallationPmonUser = "N/A"
 
global string gFwInstallationPmonPwd = "N/A"
 
global dyn_dyn_string gFwInstallationLog
 
global string gFwInstallationLogPost
 
mapping gFwInstallationTrackDependency
 
global string gFwInstallationCurrentComponent
 
global int gInstallationAgentUiNum
 

Detailed Description

This package contains general functions of the FW Component Installation tool

Author
Fernando Varela (EN-ICE)
Date
August 2010

Function Documentation

int fwInstallation_getComponentFilesForHashCalculation ( string  component,
dyn_string &  componentFiles 
)

Gets the list of component files for which hash calclulation should be done. It retreives list of all component files from internal component dp and filters out files for which hash calculation should not be performed.

Parameters
component(in) Component name, when subcomponent then must be provided without leading underscore
componentFiles(out) List of component files for which hash calculation should be done
Returns
0 in case when list was retreived successfully, -1 in case of error (component doesn't have any files)
int fwInstallation_calculateComponentSourceFilesHashes ( string  component)

This function calculates and stores sources files hashes. It gets list of component files, calculates their hashes and write them to a component installation dp: fwInstallation[componentName].sourceFilesHashes Data is stored as a list of formatted strings. Single string contains information about particular file, it has the following pattern: [baseHashValue]|[alternativeHashValue]|[relativePathToComponentFile].

  • baseHashValue is a hash of a file in component source directory
  • alternativeHashValue by default is the same as base hash value, however user can store there hash value of component file in different directory - it can be used to mask 'hash mismatch' file issue If source file is not accessible or it is not possible to calculate hash for the file then it is added to the list with empty hash. File issue 'Hash comparison not possible' will be detected in such case, user later can mask this error by setting an alternativeHashValue for file (as for 'hash mismatch' file issue)
    Parameters
    component(in) Component name, when subcomponent then must be provided without leading underscore
    Returns
    0 whem hashes were successfully calculated and stored, -1 in case of error (failed to retreive source directory or list of component files, failed to store hashes in a file)
int fwInstallation_storeComponentSourceFilesHashes ( string  component,
dyn_string  fileNames,
dyn_string  baseFileHashes,
dyn_string  alternativeFileHashes 
)

Store list of component files and list of corresponding hash values for given component in the component dp.

Parameters
component(in) Component name, when subcomponent then must be provided without leading underscore
fileNames(in) List of relative paths of component files for which the hash was calculated
baseFileHashes(in) List of base hash values of component files
alternativeFileHashes(in) List of alternative hash values of component files
Returns
0 if lists of files and hashes were saved successfully in dp, -1 in case of errors (provided lists are of different size, failed to set value of dp)
string fwInstallation_formatComponentSourceFileHashString ( string  fileName,
string  baseFileHash,
string  alternativeFileHash = "" 
)

This function formats string that contains information about particular component file, its hash value and hash comparison status

Parameters
fileName(in) Relative path to a component file
baseFileHash(in) Base hash value for component file (should be the one calculated for file in component source directory)
alternativeFileHash(in) Alternative hash value for component file, when empty (default) then baseFileHash is used here
Returns
Formatted string with component source file hash info
int fwInstallation_getComponentSourceFilesHashes ( string  component,
dyn_string &  fileNames,
dyn_string &  baseFileHashes,
dyn_string &  alternativeFileHashes 
)

Retrieves list of component files and list of corresponding hash values for given component.

Parameters
component(in) Component name, when subcomponent then must be provided without leading underscore
fileNames(out) List of relative paths of component files for which the hash was calculated
baseFileHashes(out) List of base hash values of component files
alternativeFileHashes(out) List of alternative hash values of component files
Returns
0 if lists of files and hashes were retreived successfully, -1 in case of errors (failed to get list of files and hashes from dp)
int fwInstallation_setAlternativeComponentFileHash ( string  component,
string  fileName,
string  directory = "" 
)

This function allows to set alternative hash value for file. It can be used to hide 'hash mismatch' file issues for given file.

Parameters
component(in) Component name, when subcomponent then must be provided without leading underscore
fileName(in) Relative path to a component file
directory(in) Flag that indicates if hash comparison should be enabled (true - default) or disabled
Returns
0 when file hash value was updated successfully, -1 in case of an error (error reading dp that contains component file hashes, given file is not a component file or failed to update dp with hashes)
int fwInstallation_resetAlternativeComponentFileHash ( string  component,
string  fileName 
)

This function resets alternative hash value for given file (set alternative hash same as base hash)

Parameters
component(in) Component name, when subcomponent then must be provided without leading underscore
fileName(in) Relative path to a component file
Returns
0 when file hash value was reset successfully, -1 in case of an error (error reading dp that contains component file hashes, given file is not a component file or failed to update dp with hashes)
int fwInstallation_getComponentFilesWithAlternativeHash ( string  component,
dyn_string &  filesWithAlternativeHash 
)

This function retrieves list of files that have set alternative hash value different than base hash value

Parameters
component(in) Component name, when subcomponent then must be provided without leading underscore
filesWithAlternativeHash(out) List of files that have set alternative hash value different than base hash value
Returns
0 when list was retrieved successfully, -1 in case of an error when reading dp that contains component file hashes
int fwInstallation_getProjectFileIssues ( dyn_dyn_mixed &  fileIssues)

Gets all the file issues for the project

Parameters
fileIssues(out) array of all file issues
int fwInstallation_getComponentFilesIssues ( string  component,
dyn_mapping &  errorFiles,
bool  getOverparameterized = true,
bool  getHash = true,
bool  getHashCompNotPossible = true,
bool  useAlternativeHash = true 
)

Gets all the file issues for a particular component in the project

Parameters
component(in) Name of the component, when subcomponent then must be provided without leading underscore
errorFiles(out) Array of all file issues. Each file issue is represented by a mapping with following fields: 'name' (absolute path to a file), 'error' (file issue type), 'size' (file size), 'time' (file modification time)
getOverparameterized(in) Indicates whether the method should include the overparameterized files in the result, default value is true
getHash(in) Indicates whether the method should include the files with hash issue in the result, default value is true
getHashCompNotPossible(in) Indicates whether the method should include the files for which hash comparasion is not possible in the result, default value is true
useAlternativeHash(in) Indicates whether file hash should be compared to the alternative hash value (true - default) or base hash value (false)
Returns
0 if OK, -1 if error (component is not installed, failed to get installation directory, failed to read file with source files hashes values, failed to calculate hash for component's file)
int fwInstallation_installComponentSet ( dyn_string  componentFiles,
string &  dontRestartProject 
)

fwInstallation_installComponentSet installs a set of components in the local project.

Parameters
componentNames(in) array of string containing the names of the components to be installed.
dontRestartProject(out) overall flag that specifies if project restart can be skipped at the end of the installation, "yes" means the project restart can be skipped and the post-installation scripts are launched.
Returns
0 if all components were installed succesfully, -2 if circular depnedencies detected, -3 if failed to back up config file, -1 if there were errors while installing compoents

end of components intallation

int fwInstallation_deleteComponentSet ( dyn_string  dynComponentsNames,
bool  deleteFiles 
)

fwInstallation_deleteComponentSet removes a set of components in the local project.

Parameters
dynComponentsNames(in) Array of string containing the names of the components to be removed.
deleteFiles(in) Indicates whether component files should be removed from the installation directory.
Returns
0 if OK, -1 if error
int fwInstallation_stopManagersForInstallation ( )

This function stops managers for the period of installation of components.

Returns
0 if OK, -1 if error
int fwInstallation_parseHostPortConfigEntry ( string  configHostEntry,
dyn_dyn_string &  hostAliases,
dyn_dyn_int &  ports 
)

This function parses the config entries that contains host name and port ('data', 'event', part of 'distPeer' within quotes). For redundant systems and in case of redundant connections it returns all host aliases and ports. Example entries: "host1[:port1]" "host1[:port1]$host2[:port2]" // redundant system "host1-1[:port1],host1-2[:port1]" // redundant network connections "host1-1[:port1],host1-2[:port1]$host2-1[:port2],host2-2[:port2]" // redundant system with redundant network connection

Parameters
configHostEntry(in) Config file entry as given in the above examples
hostAliases(out) Array of parsed hostnames/aliases
ports(out) List of corresponding ports, when port is not specified in config entry then it has value 0
Returns
0 when success, -1 in case of error (invalid config entry passed)
void _fwInstallation_parseDistPeer ( string  distPeer,
string &  host,
string &  reduHost,
string &  port 
)
This function parses the distPeer entry in order to retrieve the host and the distPort.
Note
So far this function does not consider redundancy
Parameters
distPeer(in) distPeer entry, as found in the config file
host(out)
reduHost(out)
distPort(out)
int fwInstallation_deleteProjectPaths ( dyn_string  paths)

This function removes the given project paths from the config file.

Parameters
(in)paths array of strings that contains the project paths to be removed from the config file.
Returns
0
int fwInstallation_addProjectPaths ( dyn_string  dbPaths)

This function adds the given project paths to the config file.

Parameters
(in)dbPaths array of strings that contains the project paths to be added to the config file.
Returns
0
dyn_string fwInstallation_getHostPvssVersions ( )

This function returns the list of all installed WinCC OA versions on current machine.

Returns
list of all installed WinCC OA versions in a dyn_string
private dyn_string fwInstallation_getPvssVersionsFromWinRegKey ( string  key)

This function returns the WinCC OA versions that are under given Windows registry key

Parameters
key(in) Windows registry key
Returns
List of WinCC OA versions
string fwInstallation_getWinRegKey ( string  key)

This function returns the next tier of subkeys of the specified key in the Windows registry.

Note
It returns a single string that contains subkeys separated with newline character ("\n").
Parameters
key(in) registry key that will be queried
Returns
string contains all subkeys of specified key
dyn_string fwInstallation_getComponentPendingPostInstalls ( string  component,
int  reduHostNum = 0 
)

This function returns the list of pending postInstall scripts of the given component.

Parameters
component(in) Name of the component.
reduHostNum(in) Local host redu number, default value (0) indicates that the number will be obtained automatically.
Returns
Array of strings that contains the names of pending postInstall scripts for the given component.
dyn_string fwInstallation_getProjectPendingPostInstalls ( int  reduHostNum = 0)

This function returns the list of pending postInstall scripts in the project.

Parameters
reduHostNum(in) Local host redu number, default value (0) indicates that the number will be obtained automatically.
Returns
Array of strings that contains the names of pending postInstall scripts.
void fwInstallation_resetLog ( )

This function clears the global array of stings that contains fwInstallation log messages.

string fwInstallation_getWCCOAExecutable ( string  type)

This function returns the name of WinCC OA manager executable file. Consider removing support for PVSS version older than 3.11 (PVSS00)

Parameters
type(in) Type of manager (UI, CTRL, dist, etc., case insensitive)
Returns
Name of WinCC OA executable file (PVSS00 - obsolete, WCCOA or WCCIL + type)
void fwInstallation_appendLog ( string  msg,
string  severity 
)

This function append a new log message to the fwInstallation log. Logs are appended to the global array of logs and, if there is a connection, stored in the DB

Parameters
msg(in) Log message
severity(in) Severity of the message
bool fwInstallation_isPatchInstalled ( string  patch)

This function deploys the crashAction script for the restart of the DB-Agent of the Installation Tool when it gets blocked

Returns
0 if OK, -1 if error This function checks and, if necessary, updates the crash action script of the Installation Tool
Parameters
filenamename of the crash action script as expected by PMON, including the full path
fw_installation_filenamename of the crash action script delievered with this version of the Installation Tool, including the full name
Returns
0 if OK, -1 if error This function returns the version of a crash action script
Parameters
filenamename of the file containing the crash action script
Returns
version of the script as a string Checks if a particular patch has been applied to the current installation
Parameters
patchpatch name
Returns
0 if the patch is not present 1 if the patch has been applied
int fwInstallation_checkPvssVersion ( string  reqVersion)

Check if the PVSS version is equal or newer than the required PVSS version passed as argument

Parameters
reqVersionrequired PVSS version
Returns
2 if current PVSS version is greater than the required one. 1 if current and required PVSS versions are equal. 0 if the required version is greater than the current one.
int fwInstallation_checkToolVersion ( string  reqVersion)

Checks if the version of the FW Component Installation Tool is equal or newer than the required PVSS version passed as argument

Parameters
reqVersionrequired version of the FW Component Installation Tool
Returns
2 if current Tool version is greater than the required one. 1 if current and required Tool versions are equal. 0 if the required version is greater than the current one.
float fwInstallation_pvssVersionAsFloat ( string  reqVersion,
int &  major,
int &  minor,
int &  sp 
)

Converts a PVSS version from string to float for easy comparison

Parameters
reqVersion- (in) name of the pvss version
major- (out) number corresponding to the major version of the release
minor- (out) number corresponding to the minor version of the release
sp- (out) number corresponding to the Service Pack of the release
Returns
pvss version as a float
int fwInstallation_getPvssSystemProperties ( string  systemName,
dyn_mixed &  pvssSystem 
)

Gets the properties of a particular PVSS system as a dyn_mixed

Parameters
systemName- (in) name of the pvss system
pvssSystem- (out) properties of the system
Returns
0 if everything OK, -1 if errors
void fwInstallation_throw ( string  msg,
string  severity = "ERROR",
int  code = 1 
)

Throws a PVSS error in the log

Parameters
msg- error message
severity- severity of the message: "ERROR", "WARNING", "INFO"
code- code of the error message in the fwInstallation catalog
string fwInstallation_getAfterInitRestartNeededDpElem ( )

Return data point for value indicating if restart is needed before running post install scripts.

Returns
value of type 'string' data point (element) if restart is needed.
string fwInstallation_getAfterInitRestartRequesterDpElem ( )

Return data point for value containing component that requested project restart. Data point contains only the last component requesting the restart.

Returns
value of type 'string' Data point pointing to project restart requester (component name).
int fwInstallation_requestProjectRestartAfterInit ( string  requester)

Request project restart after component installation, but before running postInstall scripts.

This function will set requester to a datapoint which later be used to issue a project request.

Parameters
requester(string) IN component requesting project restart.
Returns
value of type 'int' 0 if request is successful, otherwise -1.
int fwInstallation_clearProjectRestartAfterInit ( )

Clear data point that will cause project restart after init scripts (before post install scripts).

Returns
value of type 'int' 0 - success clearing project restart request, -1 - failure to clear restart request.
int fwInstallation_isProjectRestartAfterInitPending ( )

Return if project should be restarted after init scripts were executed.

Returns
value of type 'int' 1 - project should be restarted after init scripts, 0 - project should NOT be restarted after init scripts.
dyn_string fwInstallation_orderDplFiles ( dyn_string  files,
dyn_int  attribs 
)

Order the dpl files of a component according to the attributes defined in the XML file

Parameters
files- (in) files to the ordered as a dyn_string
attribs- (int) XML attributes for the files ordered as the 'files' argument
Returns
ordered list of the files according to the attribs values
int fwInstallation_closePanel ( bool  closeIfConnected = false)

This functions is to be called from the close event of a panel. It checks whether the connection with the event manager is established or not. If the connection is down, the function will call exit() to close the actual panel. If the connection is to the event manager is still up, the calling code can decide whether the panel must closed or not. This is done through the argument closeIfConnected. Typically the argument will be set to false in the cases where the developer wants to prevent that the user closes the panel by clicking on the top-right 'x' of the window.

Parameters
closeIfConnected,:(boolean) Defines whether the current panel has to be close if the connection to the event manager is still up. The default value is false (i.e. the function will not close the panel)
Returns
0 - success, -1 - error
Author
F. Varela
string fwInstallation_getHostname ( string  hostName = "")

Retrieves the name of a host without network domain

Parameters
hostNamename of the host to parse; when empty - the local host
Returns
name of the host as string
string fwInstallation_getInstallationDp ( )

Gets the name of the internal datapoint of the Installation Tool

Returns
dp name as string
string fwInstallation_getFileIssuesSyncDpElem ( )

Get file issues sychronization enable/disable data point element.

Returns
name of data point element for file issues synchronization enabled/disabled.
bool fwInstallation_deleteFromConfigFile ( )

Returns wether the DB-agent must delete or not from the project config file during synchronization with the System Configuration DB

Returns
True is deletions must be carried out, FALSE if deletion is inhibited.
void fwInstallation_flagDeprecated ( string  deprecated,
string  toBeUsed = "" 
)

Function used to flag deprecated functions in the library

Parameters
deprecatedname of the deprecated function
toBeUsedname of the function to be used instaed. If an empty argument is passed, a different message will be shown, telling that the user must report its usage.
string fwInstallation_findFileForPvssVersion ( string  baseFileName,
dyn_string  targetVersions = makeDynString(),
bool  considerSpLevel = FALSE 
)

Function during the installation of the components to resolve the right name for a file depending on the current PVSS version

Parameters
baseFileName(in) base name of the file
targetVersions(in) name of the target PVSS version
considerSpLevel(in) argument that defines whether the Service Pack level has to be also taken into account
Returns
final name of the file matching the target pvss version
int _fwInstallation_getStringFromSystemCommand ( string  command,
string &  systemExecResult,
bool  trim = false 
)

Execute command and read the output.

Note
Function reports success always when command exits with code different than -1, so it may report success even when command returned error code. This is to not modify previous behaviour of this function. Note that it is not possible to distinguish if -1 is error code returned by command or error code of WinCC OA system() function. Newline character in output is different on Windows (CR+LF) and Linux (LF). It is recommended to use fwInstallation_splitLines() to get list of lines in output correctly.
Parameters
command(in) System command to execute
systemExecResult(out) Contains output from command execution.
trim(in) Flag that indicates if the leading and trailing whitespaces should be removed from output (by default no).
Returns
Returns 0 on success, -1 on error (system() function error or command returned -1 (only on Windows)).
int fwInstallation_getHostMemorySize ( string &  memSizeInBytes)

Return memory size in bytes.

Parameters
memSizeInBytes- return value, memory size in bytes.
Returns
0 on success, -1 on failure.
int fwInstallation_getHostCpuInfo ( string &  cpuInfo)

Return CPU information.

Parameters
cpuInfo- return CPU information, ex. "".
Returns
0 on success, -1 on failure.
int fwInstallation_getLinuxInstalledPackages ( string  grepExpression,
string &  packages 
)

Returns packages installed on an RPM based Linux system. Note that an argument (grepExpression) is passed to filter out interesting packages out of all installed packages, filter is case insensitive.

Parameters
grepExpressiongrep expression to filter out packages.
packagesoutput string receiving comma separated list of packages.
Returns
0 on success, -1 on error.
int fwInstallation_getFMCInstalledPackages ( string &  packages)

Get list of installed FMC.

Parameters
packagesvariable to receive comma separated list of FMC packages.
Returns
0 on success, -1 on error.
int fwInstallation_getWCCOAInstalledPackages ( string &  packages)

Get list of installed WinCC OA packages (also inclused PVSS packages).

Parameters
packagesvariable to recieve comma separated list of WinCC OA/PVSS packages.
Returns
0 on success, -1 on error.
int fwInstallation_getHostProperties ( string  hostname,
dyn_mixed &  pvssHostInfo 
)

Function to retrieve host properties as a dyn_mixed array

Parameters
hostname(int) name of the host
pvssHostInfo(out) host properties
Returns
0 if OK, -1 if errors
int fwInstallation_sendToTrash ( string  filename,
string  trashPath = "" 
)

Function to move files into the trash

Parameters
filename(in) name of the file to be moved
trashPath(in) path to the trash. Empty path means use the default path
Returns
0 if OK, -1 if errors
int fwInstallation_emptyTrash ( string  path = "")

Empty the trash of the FW Component Installation Tool

Parameters
path(in) path to the trash. Empty path means use the default path
Returns
0 if OK, -1 if errors
int fwInstallation_moveFile ( string  source,
string  target,
bool  overwriteFile = false 
)

Moves file/directory to the target directory. This is a wrapper of WinCC OA moveFile() function that allows also to overwrite existing file while moving.

Parameters
source(in) Path to file or a directory to be moved
target(in) Target directory or target path
overwriteFile(in) Indicates whether moved file can overwrite the one that exists in target path, by default false
Returns
0 when file moved successfully, -1 when failed
bool fwInstallation_fileCompareBinary ( string  filename1,
string  filename2 
)

Function to make a binary comparison of two files. Contribution from TOTEM.

Parameters
filename1(in) name of the first file for comparison
filename2(in) name of the second file for comparison
Returns
true if the two files are identical, false if the files are different
int fwInstallation_safeFileOverwrite ( string  source,
string  destination,
string  trashPath = "",
bool  compare = true 
)

This function unlinks a file under Linux and then overwrites it.

Parameters
source(in) name of the file to be copied
destination(in) target file name including full path
trashPath(in) path to trash
compare(in) argument used to compare files before copying. If files are identical the file is not re-copied.
Returns
0 if OK, -1 if errors
int fwInstallation_copyFile ( string  source,
string  destination,
string  trashPath = "",
bool  compare = true 
)

Function to copy files. If blind copy fails (e.g. an executable is in used) and file exists already in target path, then it tries to perform additional actions in order to successfully copy file.

Parameters
source(in) name of the file to be copied
destination(in) target file name including full path
trashPath(in) path to trash (when not specify, then default one is used (PROJ_PATH/fwTrash/))
compare(in) argument used to compare files before copying. If files are identical the file is not re-copied.
Returns
0 if OK, -1 if errors
private int fwInstallation_copyFile_handleFileOverwriting ( string  source,
string  destination,
string  trashPath = "" 
)

Function to be called from fwInstallation_copyFile(). Provides functionality to handle cases, when overwriting file in target directory failed at first attempt. It either tries to overwrite file using native system copy function or move the file from target path to project trash directory.

Parameters
source(in) Path to file to be copied
destination(in) Target path for file
trashPath(in) path to trash
Returns
0 if OK, -1 if errors
private int fwInstallation_copyFile_windowsCmd ( string  source,
string  target 
)

This function copies the file from the source to target path using Windows 'copy' command. To be used only in Windows and to copy files (not directories).

Note
It was developed specifically to workaround problem with overwriting files, that are in use by another process, when using WinCC OA copyFile(). Consider removing it when ETM-1807 will be fixed.
Parameters
source(in) Path to file to be copied
target(in) Target path for file
Returns
0 when success, other value in case of error (!=0)
int fwInstallation_registerProjectPath ( string  sPath)

This function registers a PVSS project path

Note
Registered project paths can be found in pvssInst.conf file (usually C:.conf or /etc/opt/pvss/pvssInst.conf)
Parameters
sPath,:(in) path to be registered as string
Returns
0 if success, -1 if error
Author
F. Varela
string fwInstallation_getComponentVersion ( string  component,
int  reduHostNum = 0 
)

This function retrieves the version of an installed component

Parameters
component(in) name of the component
Returns
component version as string
bool fwInstallation_isComponentInstalled ( string  component,
string &  version,
int  reduHostNum = 0 
)

This function checks if a component is installed in the current project. Returns true if component is installed and its version is succesfully retrieved. If component is not installed or retrieving component version failed, "version" is set to empty.

Parameters
component(in) Name of the component
version(out) Current version of the installed component
reduHostNum(in)
Returns
true if the component is installed, false otherwise
int fwInstallation_getComponentSourceDir ( string  component,
string &  sourceDir 
)

This function retrieves the source directory from which a component was installed

Parameters
component(in) name of the component
sourceDir(out) source directory
Returns
0 if everything OK, -1 if errors.
string fwInstallation_dp2name ( string  dp)

This function returns the name of a component correspoding to an internal dp of the installation tool

Parameters
dp(in) name of the dp of the installation tool
Returns
name of the component
void fwInstallation_setToolStatus ( bool  status)

Sets the status of the installation tool

Parameters
statustrue if OK, false if error
int fwInstallation_executePostInstallScripts ( )

This function lauches the pending post-installation of scripts of installed components (if any)

Returns
0 if OK, -1 if errors
int fwInstallation_createTrash ( string  sourceDir)

This function creates the trash for the installation tool

Parameters
sourceDir(in) path where to create the trash as string
Returns
0 if OK, -1 if errors
int fwInstallation_getToolVersion ( string &  version,
string  systemName = "" 
)

This function retrieves the current version of the installation tool used in a particular PVSS system.

Note
Please do not use this function. It will be marked as obsolete in the future. Use fwInstallation_getToolVersionLocal() or fwInstallation_getToolVersionFromDp() instead, depending on the needs.
Parameters
version(out) version of the tool
systemName(int) name the pvss system where to read the installation tool version from
Returns
0 if OK, -1 if errors
void fwInstallation_getToolVersionLocal ( string &  version)

Retrieves the current version of installation tool in the local project.

Parameters
version(out) Version of the tool (format: X.X.X[-tag[-tagId]]) Example: 8.2.0 (stable release, tag is empty), 8.3.0-SNAPSHOT-20181015090802, 9.0.0-beta-02
int fwInstallation_getToolVersionFromDp ( string &  version,
string  systemName = "" 
)

Retrieves the current version of installation tool used in given WinCC OA system from internal installation tool datapoint.

Note
'version' argument is always modified, in case of error empty string is assigned to it.
Parameters
version(out) Version of the tool (format: X.X.X[-tag[-tagId]]) Example: 8.2.0 (stable release, tag is empty), 8.3.0-SNAPSHOT-20181015090802, 9.0.0-beta-02
systemName(in) Name of WinCC OA system where to read installation tool version from. Local system when empty (default)
Returns
0 when version was read correctly. -1 in case of errors while reading values from datapoint. -2 when internal installation tool datapoint does not exists in the system.
string fwInstallation_getAgentDp ( )

This function retrieves name of the internal dp holding the parameterization of the DB-agent

Returns
name of the internal dp as string
string fwInstallation_getAgentRequestsDp ( int  localReduHostNum = 0)

This function retrieves name of the internal dp holding the pending installation requests to be executed by the DB-Agent

Returns
name of the dp as string
int fwInstallation_getProjPaths ( dyn_string &  projPaths,
bool  adjustScattered = false 
)

The function reads all project paths from the config file, normalizes them and adds to a dyn_string list. Project paths have the same order as in the config file.

Parameters
projPaths(out) dyn_string which will be filled with the project paths from the config file
adjustScattered(in) Flag that indicates if projPaths should be adjusted when it is a scattered project (default = false)
Returns
0 if success, -1 if error, -2? if no project paths in the config file (this should not happen)
private int fwInstallation_getProjPathsRaw ( dyn_string &  projPathsRaw)

The function reads all project paths from the config file into a dyn_string list. Paths are exactly as in config file.

Parameters
projPaths(out) dyn_string which will be filled with the project paths from the config file
Returns
0 if success, -1 if error, -2? if no project paths in the config file (this should not happen)
int fwInstallation_getPathMappingForScattered ( string &  nativePathToReplace,
string &  scatteredPathReplacement 
)

When running a scattered project, function returns the part of the project path that should be replaced and the replacement to be put instead in order to create a valid path to the project directories from scattered project. Use case: Accessing component installation directory when running on Scattered project. Example: When path of the main project is: /opt/user/PVSS_projects/mainProject/mainProject and path to the main project from scattered project is: //scatteredProjectHost/PVSS_projects/mainProject/mainProject then /opt/user/ should be replaced by //scatteredProjectHost/ whenever main project directories needs to be accessed from Scattered.

Parameters
nativePathToReplace(out) Part of the project path (as it is in original config file) that should be replaced.
scatteredPathReplacement(out) Part of the path that should be put instead the original one (remote path to the project from Scattered).
Returns
-1 in case of an error (failed to get project paths from config file), 1 when it is not a scattered project (no need to change paths) 0 when project is scattered and path mapping was retrieved correctly (note that the output variables are changed inside function only when 0 is returned).
string _fwInstallation_getWCCOAApplicationDpName ( string  app)

Helper function to convert data point name (remove blank spaces, etc.).

Parameters
app(string) IN WCCOA application name to convert (may contain blanks, etc.)
Returns
converted data point type
int fwInstallation_getWCCOAApplications ( dyn_dyn_mixed &  wccoaApplications)

Retrieve existing WinCC OA (UNICOS) applications on this system

Parameters
wccoaApplicationsvariable to receive info about currently installed WinCC OA applications.
Returns
0 on success, -1 on error.

: Currently only 'Default_Panel' field is filled. 'Info_URL', 'Comment_text', 'Status', 'Responsible' and 'Alarm_Overview_Panel' are missed.

int fwInstallation_backupProjectConfigFile ( )

This function backs up the project config file. It is intendended to be called before component installation/uninstallation

Returns
0 if OK, -1 otherwise
int fwInstallation_setProjPaths ( dyn_string  projPaths)

This functions writes all project paths given in a dyn_string to the config file and overwrites existing paths exept the main project path.

Parameters
projPaths,:dyn_string with the project paths for the config file
Returns
0 if OK, -1 if error
int fwInstallation_isPathInConfigFile ( string  projPath,
bool &  isPathInConfig 
)
This function checks if given path exists in config file
Parameters
projPath,:Project path (in)
isPathInConfig,:
Returns
0 if path was successfully normalised, -1 in case of error
synchronized int fwInstallation_addProjPath ( string  projPath,
int  position 
)
This function add a project path to the config file.
Parameters
projPath,:string that contains the project path to be added to the config file
position,:position of the added path in the list (n = specified position, try 999 for last before main project path)
Returns
0 if success, -1 if error, -2 if position out of range
Author
S. Schmeling
synchronized int fwInstallation_removeProjPath ( string  projPathToRemove)
This function removes the given project path from the config file.
Parameters
projPath,:string that contains the project path to be removed from the config file
Returns
0 if success or path is not in config, -1 if general error
string fwInstallation_getComponentDp ( string  componentName,
int  reduHostNum = 0 
)

This function retrieves name of the internal dp associated with an installed component.

Parameters
componentNamename of the component
reduHostNumnumber of redundant host
Returns
datapoint name for a given component, or empty it doesn't exist
int fwInstallation_getComponentInfo ( string  componentName,
string  componentProperty,
dyn_anytype &  componentInfo,
int  reduHostNum = 0 
)
This function returns the following property of the installed component: list of files for this component
Parameters
componentName,:string with the name of the component
componentProperty,:name of the requested property
componentInfo,:variable that contains the property of the component
Returns
0 - "success" -1 - error
Author
S. Schmeling and F. Varela
dyn_string fwInstallation_getInstalledComponentDps ( int  reduHostNum = 0)

This function returns the name of the internal dps correspoding to all components installed in the local project. In redundant system peer number can be specified.

Parameters
reduHostNum(in) Redu peer number (1 or 2), if 0 (default) then local peer number is used. Note that in non-redu system local peer is always 1.
Returns
List of the internal fwInstallation component dps (dyn_string). Note that as of version 8.2.1 returned datapoints always contain the system name.
int fwInstallation_getInstalledComponents ( dyn_dyn_string &  componentsInfo,
int  reduHostNum = 0 
)
This function gets the information about all installed components into a dyn_dyn_string structure:
[n][1] component name
[n][2] component version
[n][3] path to the installation

[n][4] description file

Parameters
componentsInfo,:dyn_dyn_string that will contain all installed components and their respective version numbers
Returns
0 if success, -1 if error, -999999 if no components installed
Author
S. Schmeling and F. Varela
int fwInstallation_getAvailableComponents ( dyn_string  componentPaths,
dyn_dyn_string &  componentsInfo,
string  component = "*",
bool  scanRecursively = false 
)
This function gets the information about all available components in the specified paths into a dyn_dyn_string structure:
- component name
- component version
- subcomponent [yes/no]
- path to the description file
Parameters
componentPaths(in) dyn_string with the paths to description files
componentsInfo(out) dyn_dyn_string that will contain all installed components and their respective version numbers and their paths
component(in) component pattern
scanRecursively(in) flag indicating if the search must recurse over subdirectories
Returns
0 if success, -1 if error
Author
S. Schmeling and F. Varela
int fwInstallation_popup ( string  popupText,
string  popupTitle = FW_INSTALLATION_POPUP_TITLE_ERROR 
)

This function opens a timed out popup with title and test provided as parameter.

Parameters
popupTexttext to be shown in popup window
popupTitletitle of the popup window, the default one is "Installation Error". It is possible to use predefined titles: FW_INSTALLATION_POPUP_TITLE_ERROR - "Installation Error" FW_INSTALLATION_POPUP_TITLE_INFORMATION - "Information" FW_INSTALLATION_POPUP_TITLE_WARNING - "Warning"
Author
Sascha Schmeling
string paGetProjName ( )
This function returns the project name
Returns
project name as string
void fwInstallation_getApplicationSystem ( string  applicationName,
dyn_string &  systemNames 
)
This function retrieves the system name(s) on which a certain

"application" = component is installed.

Parameters
applicationNamename of the application/component to be found
systemNamesname(s) of the system(s) with the application/component installed
Author
Sascha Schmeling
string fwInstallation_getPvssVersion ( dyn_string &  patches)
This function retrieves the PVSS version number as well as the installed patches
Parameters
patches(out) dyn_string array with all installed patches
Returns
pvss version as a string
fwInstallation_showHelpFile ( string  componentName,
string  systemName = "" 
)
This function shows the help file associated to a component
Parameters
componentName(in) name of the component in the database
systemName(in) name of the system where to look for the component
Author
Sascha Schmeling
fwInstallation_showHelpForPanel ( string  panelFilePath)

This function shows the help file for fwInstallation panels.

Parameters
panelFilePath(in) Relative path to a panel file from panels/ directory
int _fwInstallation_getConfigFile ( dyn_string &  configLines)
This function gets all entries from the config file into string structures
Parameters
configLines,:dyn_string containing the lines from the config file
Returns
0 if OK, -1 if error
Author
M. Sliwinski, adapted for library by S. Schmeling and F. Varela
int fwInstallation_saveFile ( dyn_string &  configLines,
string  filename 
)
this function saves the dyn_string  into PVSS project confg file
Parameters
configLines,:the dyn_string containing the lines from the file
filename,:the name of a file
Author
M.Sliwinski. Modified by F. Varela (with a lot of pain...)
void _fwInstallation_GetComponentsWithPendingPostInstall ( dyn_string &  components,
dyn_string &  scripts 
)
This function returns the list of pending pending post-install scripts and their components
Parameters
components(out) list of components corresponding to the scripts
scripts(out) list of pending post-install scripts
void _fwInstallation_DeleteComponentFromConfig ( string  componentName)
This function deletes the information for the component from the project config file.
Parameters
componentName,:the name of a component
Author
S.Schmeling and patched by F. Varela.
dyn_string _fwInstallation_proposeInstallationDirs ( )

This function returns proposals of the component installation directory. List contains paths from config file appearing in reverse order excluding main project path or if there are no such paths in config file then a set of default locations.

Returns
list of proposed paths for installation directory
int fwInstallation_getComponentsInfo ( string  tableName,
string  sourceWidget,
string  systemName = "",
bool  scanRecursively = false 
)
This function gets the components data from the directory specified in the textBox and fills the graphic table with it.
Parameters
tableName(in) the name of a graphic table to be filled with data
sourceWidget(in) the name of a widget containing the directory from which the data about the components is taken
systemName(in) name of the pvss system where to look for components
scanRecursively(in) flag indicating if the search must recurse over subdirectories
Returns
0 - "success" -1 - error
Author
M.Sliwinski. Modified by F. Varela.

TODO: check if it is always the same as subcomponent as ds array is not cleared

void fwInstallation_componentInstalled ( string  componentName,
string  requestedComponentVersion,
int &  result,
string  systemName = "",
bool  beStrict = false,
bool  caseSensitive = false,
bool  compareOnlyVersionNumber = false 
)

This function checks if the component is installed in version equal or higher than requested.

Parameters
componentName(in) The name of a component to be checked
requestedComponentVersion(in) Requested version of the component
result(out) Returned value indicating if component in requested version is installed (1) or not (0)
systemName(in) System where to check if the component is installed
beStrict(in) Flag to indicate an exact match of the versions installed and required
caseSensitive(in) Indicates if comparison of alphabetical characters should be case-sensitive (by default false)
compareOnlyVersionNumber(in) If true then only version number are compared (pre-release tag and number are not taken into account) (by default false) Note: if beStrict and compareOnlyVersionNumber are both true then comparison results is 1 when version numbers are identical
void fwInstallation_showFileIssues ( string  componentName,
bool  isSubComponent 
)

Displays information about component file issues in installed components table. Note: UI function. Requires that the table shape "tblInstalledComponents" exists in a panel.

Parameters
componentName(in) Name of the component
isSubComponent(in) Flag that indicates if component is a subcomponent
fwInstallation_showMessage ( dyn_string  message)
this functions outputs the message into the log textarea of a panel
Parameters
message,:the message to be displayed
fwInstallation_evalScriptFile ( string  componentInitFile,
int &  iReturn 
)
This function executes a script from the component .init file
Parameters
componentInitFile,:the .init file with the functions to be executed
iReturn,:-1 if error calling the script, otherwise, it returns the error code of the user script
Author
F. Varela
private _fwInstallation_CompareVersions_parseVersionParts ( string  versionString,
string &  versionNumber,
string &  preReleaseTag,
string &  preReleaseNumber 
)
private

Parse parts of componet version sequence ([versionNumber]-[preReleaseTag]-[preReleaseNumber]). All parts are optional, however, if present, they must appear in the presented order. Any characters after third '-' delimiter are discarded. Used in version comparison (_fwInstallation_CompareVersions())

Parameters
versionString(in) String containing component version sequence.
versionNumber(out) Main version number (first part of component version sequence)
preReleaseTag(out) Pre-release tag (second part of component version sequence)
preReleaseNumber(out) Pre-release number (third part of component version sequence)
private int _fwInstallation_CompareVersions_compareVersionNumbers ( string  instCompVersionNumber,
string  reqCompVersionNumber 
)
private

Compares given parts of version strings as sequence of version number strings ([major].[minor].[...]...). Version number strings can contain non-numerical character. Used in version comparison (_fwInstallation_CompareVersions())

Parameters
instCompVersionNumber(in) Part of version string of installed component
reqCompVersionNumber(in) Part of version string of requested component
Returns
Integer value that indicates whether first or second argument contains higher version string. Following codes are possible: FW_INSTALLATION_INSTALLED_COMPONENT_VERSION_IS_HIGHER, FW_INSTALLATION_REQUESTED_COMPONENT_VERSION_IS_HIGHER, FW_INSTALLATION_BOTH_VERSIONS_ARE_EQUAL
private int _fwInstallation_CompareVersions_compareVersionNumberPart ( string  instCompVersionNumberPart,
string  reqCompVersionNumberPart 
)
private

Compares given strings containing particular number (string) eg. [major] from the sequence of version numbers strings ([major].[minor].[...]...) Used in version comparison (_fwInstallation_CompareVersions_compareVersionNumbers())

Parameters
instCompVersionNumberPart(in) Single number from the sequence of version numbers of installed component version
reqCompVersionNumberPart(in) Single number from the sequence of version numbers of required component version, must be on the same position in the sequence of version numbers as instCompVersionNumberPart
Returns
Integer value that indicates whether first or second argument contains higher number. Following codes are possible: FW_INSTALLATION_INSTALLED_COMPONENT_VERSION_IS_HIGHER, FW_INSTALLATION_REQUESTED_COMPONENT_VERSION_IS_HIGHER, FW_INSTALLATION_BOTH_VERSIONS_ARE_EQUAL
private int _fwInstallation_CompareVersions_parseNumberAndModifierString ( string  versionNumberPart,
string &  modifierString 
)
private

Parses number (integer value) and modifier string (string of alphanumeric characters that appears after the integer value) from given part of version numbers string sequence. Used in version comparison (_fwInstallation_CompareVersions_compareVersionNumberPart())

Parameters
versionNumberPart(in) Part of the sequence of version numbers strings ([major].[minor].[...]...)
modifierString(out) Modifier string for the retrieved numeric value.
Returns
Integer value retrieved from the first numeric characters of versionNumberPart.
private int _fwInstallation_CompareVersions_compareVersionStrings ( string  instCompVersionString,
string  reqCompVersionString 
)
private

This function compares two version strings as a string of characters. Higher string is the one with character with higher ASCII code on the first position that differs in both string. If one string is longer than the other and the common parts are equal then the longer string is higher. An exception is a situation when one string is empty - then it is considered to be higher as string version should be used to indicate pre-release versions. Used in version comparison (_fwInstallation_CompareVersions_compareVersionNumberPart(), _fwInstallation_CompareVersions())

Parameters
instCompVersionString(in) Part of installed component version identifier that should be compared as a string
reqCompVersionString(in) Part of requested component version identifier corresponding to the same part of instCompVersionString
Returns
Integer value that indicates whether first or second argument contains higher string version. Following codes are possible: FW_INSTALLATION_INSTALLED_COMPONENT_VERSION_IS_HIGHER, FW_INSTALLATION_REQUESTED_COMPONENT_VERSION_IS_HIGHER, FW_INSTALLATION_BOTH_VERSIONS_ARE_EQUAL
int _fwInstallation_CompareVersions ( string  installedComponentVersion,
string  requestedComponentVersion,
bool  beStrict = false,
bool  caseSensitive = false,
bool  compareOnlyVersionNumber = false 
)

This function compares two component versions. The following version format is supported: [versionNumber]-[preReleaseTag]-preReleaseNumber. preReleaseTag and preReleaseNumber are not mandatory and they are used for indicating the pre-release version of component (eg. beta).

  • preReleaseTags (second part of version format) are compared as a strings (string is higher when it has a character with higher ASCII code on the first position that differs in both strings).
  • versionNumbers and preReleaseNumbers are compared as a sequence of version numbers ([major].[minor].[...]...). Single part of the sequence (element) can contain number and a string modifier (eg. 10a -> number=10, modifier="a"). Numer contains all numerical chracter starting from the first position in element of a sequence. If at the first position is non-numerical character it is assumed that number has value of 0. Any characters that appears after the first non-numerical character are treated as a string modifier and they are compared as a string (so 1a10 < 1a9) hence next versions should not be indicated this way (for this pupose 'number' part should be used). If element contains modifier it is considered to be lower than the element that contains only the number (10a < 10) - it gives possibility to indicate pre-release version by the modifier (eg. 1.1beta) If version contain pre-release tags then it is lower than the version with the same versionNumber that does not have any pre-release tags (1.0.0-beta-1 < 1.0.0).
    Parameters
    installedComponentVersion(in) Version name as string of the installed component
    requestedComponentVersion(in) Required component version
    beStrict(in) If set to true, the comparison will required that both component versions as identical
    caseSensitive(in) Indicates if comparison of alphabetical characters should be case-sensitive (by default false)
    compareOnlyVersionNumber(in) If true then only version number are compared (pre-release tag and number are not taken into account) (by default false) Note: if beStrict and compareOnlyVersionNumber are both true then comparison results in 1 when version numbers are identical
    Returns
    1 if the requested component version is equal or older than the version installed (if beStrict=false), 0 otherwise
int fwInstallation_deleteFiles ( const dyn_string &  componentFiles,
string  installationDirectory 
)
this function deletes the component  files
Parameters
componentFiles,:the dyn_string with the names of the files to be deleted
installationDirectory,:the name of the installation directory
Returns
0 if OK, -1 if errors
Author
M.Sliwinski and modified by F. Varela
int fwInstallation_uninstallBinaryFile ( string  binaryFilePath)

Uninstalls binary file. On Linux it does the unlink. On Windows it attempts to remove file and if it fails then tries to move file to the project trash directory.

Parameters
binaryFilePath(in) Absolute path to the binary file.
Returns
0 when binary file was uninstalled successfully, -1 in case of error.
void fwInstallation_writeToMainLog ( string  message,
bool  addTimestamp = true 
)

This function writes to the main log

Parameters
message(in) Message to be written in the main log
addTimestamp(in) Flag that indicates if timestamp should be prepended to the message (default = true)
private void fwInstallation_writeToLogFile ( string  logPath,
string  message,
bool  addTimestamp = true 
)

Writes log message to given file.

Parameters
logPath(in) Path to the log file
message(in) Message to be written in the given log file
addTimestamp(in) Flag that indicates if timestamp should be prepended to the message (default = true)
string fwInstallation_timestampString ( )

Returns current time in timestamp format.

Returns
Timestamp string
string _fwInstallation_baseDir ( string  filePath)
This function retrieves the path from a full filename
Parameters
filePath(in) full file name (basedir + filename)
Returns
path to the file
string _fwInstallation_fileName ( string  filePath)
This function retrieves the name of a file from the full path to the file
Parameters
filePath(in) full file name (basedir + filename)
Returns
filename as string
int fwInstallation_putComponentsInOrder_Install ( dyn_string &  componentsNames,
dyn_string &  componentsVersions,
dyn_string &  componentFiles,
dyn_string &  componentFilesInOrder 
)
This function puts the components to be installed in order in which they should be installed

The algorithm is similar to that used during deleting the components (see fwInstallation_putComponentsInOrder_Delete() function btn_ApplyDelete())

Parameters
componentsNames,:the names of the components to be installed
componentsVersions,:the versions of components to be installed
componentFiles,:the file names with the description of the components
componentFilesInOrder,:the file names with the description of the components
Author
F. Varela and R. Gomez-Reino
fwInstallation_readComponentRequirements ( string  descFile,
dyn_string &  dynRequiredComponents 
)
This function reads the requirements from the component description file
Parameters
descFile(in) the file with the description of a component
dynRequiredComponents(out) the dyn_string of requiredComponents
Author
M.Sliwinski
fwInstallation_readSubcomponents ( string  descFile,
dyn_string &  dynSubcomponents 
)
This function reads the sub components from the component description file
Parameters
descFile(in) the file with the description of a component
dynSubcomponents(out) the dyn_string of the subcomponents
int fwInstallation_getPmonInfo ( string &  user,
string &  pwd 
)

This function resolves the Pmon Information (i.e. user name and password)

Parameters
user(out) user
pwd(out) password
Returns
0 if OK, -1 if errors.
int fwInstallation_forceProjectRestart ( )
This function forces the restart of the whole project
Author
F. Varela
string fwInstallation_getComponentPath ( string  componentFile)

This function resolves the source path from the component description file

Parameters
componentFile(out) full path to the XML file of the component
Returns
source directory
int fwInstallation_getRegisterOnly ( string  destinationDir,
string  componentName,
bool  forceOverwriteFiles,
bool  isSilent 
)

This function retrieves whether the component can be registered only or if all component files have to be copied during installation

Parameters
destinationDir(in) target directory for installation. Note that a previous installtion of the component may exist in there.
componentName(in) name of the component being installed
forceOverwriteFiles(in) flag to force overwriting of existing files
isSilent(in) flag to specify if the installation is silent (no windows will be pop up even during interactive installation)
Returns
1 when component can only be registered, without copying files, 0 when component files have to be copied to the target directory during instalation, -1 when component installation is aborted (user request)
private int fwInstallation_overwriteComponentFilesDialog ( string  componentName,
string  installedVersion 
)

Asks user in a dialog window whether to overwrite existing component files in a destination directory and returns its choice.

Parameters
componentName(in) Name of the component being installed
installedVersion(in) Version of component that currently exists in destination directory
Returns
0 when user selected not to overwrite the existing component files, 1 when user allowed to overwrite current component files, -1 when user decided to abort component installation.
private int fwInstallation_acceptComponentInstallationPathChangeDialog ( string  componentName,
string  installedVersion 
)

Asks user in a dialog window whether to install component in a different directory, than the one, where previous version of this component was installed.

Parameters
componentName(in) Name of the component being installed
installedVersion(in) Version of component currently installed 1 when user selected to proceed with installation in a different directory, -1 when user decided to abort component installation.
int fwInstallation_installRequiredComponents ( string  componentName,
dyn_string  dynRequiredComponents,
string  sourceDir,
bool  forceInstallRequired,
bool  forceOverwriteFiles,
bool  isSilent,
int &  requiredInstalled,
bool &  actionAborted 
)

This function forces all required components to be installed prior to the installation of a given component if available in the distribution

Parameters
componentName(in) name of the component being installed
dynRequiredComponents(in) array of required components
sourceDir(in) source directory for installation
forceInstallRequired(in) flag to force installation of required components
forceOverwriteFiles(in) flag to force all existing files to be overwritten
isSilent(in) flag to define if the installation is silent, i.e. no pop-ups
requiredInstalled(out) returned argument indicating if the required components have been successfully installed or not
actionAborted(out) flag that indicates if the action was aborted by the user
Returns
0 if OK, -1 if errors
int fwInstallation_verifyDestinationDirAndSourceFiles ( string  componentName,
string  sourceDir,
string  subPath,
string  destinationDir,
const dyn_string &  dynFileNames,
const dyn_string &  dynBinFiles,
bool  registerOnly,
int  isSilent,
bool &  actionAborted 
)

This function verifies if destination (installation) directory is writeable and if files in the component package are accessible.

Parameters
componentName(in) name of the component being installed
sourceDir(in) source directory for installation
subPath(in) path to be appended to the sourceDir
destinationDir(in) target directory for installation
dynFileNames(in) component files
dynBinFiles(in) component binary files
registerOnly(in) flag indicating whether file copying can be avoided or not if the files already exist
isSilent(in) flag to define if the installation is silent, i.e. no pop-ups
actionAborted(out) flag that indicates if the action was aborted by the user
Returns
0 if OK, -1 if error
int fwInstallation_copyComponentFiles ( string  componentName,
string  sourceDir,
string  subPath,
string  destinationDir,
const dyn_string &  dynFileNames,
bool  registerOnly 
)

This function copies all component files

Parameters
componentName(in) name of the component being installed
sourceDir(in) source directory for installation
subPath(in) path to be appended to the sourceDir
destinationDir(in) target directory for installation
dynFileNames(in) component files
registerOnly(in) flag indicating whether file copying can be avoided or not if the files already exist
Returns
0 if OK, -1 if error
string fwInstallation_getImportAsciiManagerCommand ( string  inputFile,
dyn_string  extraOptions = makeDynString(),
string  stdoutFile = "",
string  stderrFile = "" 
)

Returns the shell command to execute the WCCOAascii manager to import given dpl file.

Parameters
inputFile(in) Path to the input dpl file
extraOptions(in) List of additional WCCOAascii manager command line options (default - empty)
stdoutFile(in) Path to the file where to redirect standard output stream. If empty (default) then stdout is not redirected to the file.
stderrFile(in) Path to the file where to redirect standard error stream. If empty (default) then stderr is not redirected to the file.
private string fwInstallation_getPathWithinQuotationMarks ( const string &  path)

Returns the given path with qoutation marks added at the beggining and end.

Parameters
path(in) Path
Returns
Path with quotation marks (eg. "/opt/New Folder/file")
private bool fwInstallation_doesPathContainSpace ( const string &  path)

Checks if given path contains space character.

Parameters
path(in) Path to be checked
Returns
true if path contains space, false if not
private int fwInstallation_importComponentSingleAsciiFile ( string  componentName,
string  dplFilePath,
string  asciiImportCmd,
string  logFile,
bool  updateTypes = true,
bool  isSilent = true 
)

Performs ASCII import of a component single dpl file.

Parameters
componentName(in) Name of the component
dplFilePath(in) Path to the dpl file to import
asciiImportCmd(in) Command to call ASCII manager, it must have embedded "%s" format specifier to be replaced by dplFilePath
logFile(in) Path the the stderr log file
updateTypes(in) flag to indicate if existing types have to be updated (true - default) or not
isSilent(in) Flag to indicate if installation is performed in silent mode (true - default) or in interactive mode
int fwInstallation_importComponentAsciiFiles ( string  componentName,
string  sourceDir,
string  subPath,
dyn_string  dynDpListFiles,
bool  updateTypes = true,
bool  isSilent = true 
)

This function imports the dpl files of a component

Parameters
componentName(in) name of the component being installed
sourceDir(in) source directory for installation
subPath(in) path to be appended to the sourceDir
dynDplistFiles(in) list of dpl files to be imported
updateTypes(in) flag to indicate if existing types have to be updated (true - default) or not
isSilent(in) Flag to indicate if installation is performed in silent mode (true - default) or in interactive mode
Returns
0 if OK, -1 if error
int fwInstallation_importConfigFiles ( string  componentName,
string  sourceDir,
string  subPath,
dyn_string  dynConfigFiles_general,
dyn_string  dynConfigFiles_linux,
dyn_string  dynConfigFiles_windows 
)

This function imports the config files of a component.

Parameters
componentName(in) name of the component being installed
sourceDir(in) source directory for installation
subPath(in) path to be appended to the sourceDir
dynConfigFiles_general(in) list of config files to be imported
dynConfigFiles_linux(in) list of config files to be imported (linux only)
dynConfigFiles_windows(in) list of config files to be imported (windows only)
Returns
0 if OK, -1 if error
int fwInstallation_importConfigFilesOfType ( string  componentName,
string  sourceDir,
string  subPath,
const dyn_string &  dynConfigFiles,
string  typeLabel 
)

This function imports the component config files of particular given type.

Parameters
componentName(in) name of the component being installed
sourceDir(in) source directory for installation
subPath(in) path to be appended to the sourceDir
dynConfigFiles(in) list of config files to be imported
typeLabel(in) Config files type label ["windows", "linux", "general"] to be displayed
Returns
Currently always 0
int fwInstallation_copyComponentBinaries ( string  componentName,
string  sourceDir,
string  subPath,
string  destinationDir,
const dyn_string &  binaryFiles,
dyn_string &  componentFileList,
bool  registerOnly 
)

This function copies component binary files and appends their location in the installation directory to the list of component files. It copies the binaries from source directory to the bin/ directory in component installation path. Only binaries for current WinCC OA version and not-versioned binaries are copied. Binary is versioned if is placed in the directory named as WinCC OA version (e.g. 3.15/)

Parameters
componentName(in) Name of the component
sourceDir(in) Component source directory
subPath(in) Path to be appended to the sourceDir
destinationDir(in) Component installation directory
binaryFiles(in) List of binary files to be copied (relative paths to sourceDir + subPath)
componentFileList(in/out) List of all component files to be updated with copied binaries
registerOnly(in) flag indicating whether file copying can be avoided or not if the files already exist
Returns
0 when binaries are copied successfully, -1 in case of errors
int fwInstallation_isDirNameMatchingWinccoaVersion ( string  dirPath,
string  winccoaVersion = VERSION_DISP 
)

This function checks if directory name, in the given directory path, matches pattern of a WinCC OA version and if it is equal to given version.

Parameters
dirPath(in) Path to the directory
winccoaVersion(in) WinCC OA version as a string, default: current WinCC OA version
Returns
0 if directory name matches the pattern of WinCC OA version BUT it is not equal to given version 1 if directory name matches the pattern of WinCC OA version AND it is equal to given version 2 if directory name does not match the pattern of WinCC OA version.
int fwInstallation_executeComponentInitScripts ( string  componentName,
string  sourceDir,
string  subPath,
dyn_string  dynInitFiles,
int  isSilent 
)

This function executes the component init scripts

Parameters
componentName(in) name of the component being installed
sourceDir(in) source directory for installation
subPath(in) path to be appended to the sourceDir
dynInitFiles(in) list of init files to be executed
isSilent(in) flag to define if the installation is silent, i.e. no pop-ups
Returns
0 if OK, -1 if error
int fwInstallation_storeComponentPostInstallScripts ( const string &  component,
const dyn_string &  dynPostInstallFiles_current 
)

This function stores in the component internal dp of the installation tool the list of post install scripts to be run with names of the components from which they came in following format "<component>|<postInstallScript>"

Parameters
component(in) components corresponding to post-install scripts
dynPostInstallFiles_current(in) list of post-install files to be stored
Returns
0 if OK, -1 if error
int fwInstallation_createComponentInternalDp ( string  componentName,
string  componentVersion,
string  descFile,
int  isItSubComponent,
string  sourceDir,
string  date,
string  helpFile,
dyn_string  qtHelpFiles,
string  destinationDir,
dyn_string  dynComponentFiles,
dyn_string  dynConfigFiles_general,
dyn_string  dynConfigFiles_linux,
dyn_string  dynConfigFiles_windows,
dyn_string  dynInitFiles,
dyn_string  dynPostInstallFiles,
dyn_string  dynDeleteFiles,
dyn_string  dynPostDeleteFiles,
dyn_string  dynDplistFiles,
dyn_string  dynRequiredComponents,
dyn_string  dynSubComponents,
dyn_string  dynScriptsToBeAdded,
int  requiredInstalled,
dyn_string  comments,
string  description 
)

This function creates the internal dp for the installed component

Parameters
componentName(in) name of the component being installed
componentVersion(in) component version
descFile(in) component description file
isItSubComponent(in) component description file
sourceDir(in) source directory for installation
date(in) source directory for installation
helpFile(in) source directory for installation
qtHelpFiles(in) list of relative paths to component QCH files
destinationDir(in) source directory for installation
dynComponentFiles(in) source directory for installation
dynConfigFiles_general(in) list of dpl files to be imported
dynConfigFiles_linux(in) list of dpl files to be imported (linux only)
dynConfigFiles_windows(in) list of dpl files to be imported (windows only)
dynInitFiles(in) list of init scripts
dynPostInstallFiles(in) list of post install scritps
dynDeleteFiles(in) list of delete scripts
dynPostDeleteFiles(in) list of post-delete scripts
dynDplistFiles(in) list of dpl files
dynRequiredComponents(in) list of required components
dynSubComponents(in) list of subcomponents
dynScriptsToBeAdded(in) list of scritps
requiredInstalled(in) flag to indicated if the required component were installed
comments(in) component comments
description(in) component description
Returns
0 if OK, -1 if error
int fwInstallation_checkComponentBrokenDependencies ( )

This function checks if there is any dependency broken among the installed components and sets the values of the internal dps accordingly

Returns
0 (error code not yet implemented)
int fwInstallation_installComponent ( string  descFile,
string  sourceDir,
bool  isItSubComponent,
string &  componentName,
bool &  componentInstalled,
string &  dontRestartProject,
string  subPath = "",
bool  forceInstallRequired = false,
bool  forceOverwriteFiles = false,
bool  isSilent = false,
bool  installSubComponents = true 
)
This function installs the component. It copies the files, imports the component DPs, DPTs, updates the project config file
Parameters
descFile,:the file with the description of a component
sourceDir,:the root directory with the component files
isItSubComponent,:it is false - if it is the master component; it is true if it is the sub component
componentName,:it is the return value - the name of the installed component
componentInstalled,:set to 1 if the component is properly installed
dontRestartProject,:indicates whether the project has to be restarted after installations or not
subPath,:path to be appended to the source directory
forceInstallRequiredthis flag indicates whether all required components must be installed provided that they correct versions are found in the distribution. This is a optional parameter. The default value is false to keep the tool backwards compatible. Note that the value of this parameter is set to the default value (TRUE) when a silent installation is chosen.
forceOverwriteFilesthis flag indicates whether the files of the component must be overwritten if a previous installation of the component is detected in the target directory This is a optional parameter. The default value is false to keep the tool backwards compatible. Note that the value of this parameter is set to the default value (FALSE) when a silent installation is chosen.
isSilentflag indicating whether we are dealing with a silent installation of the packages or not. The default value is false.
installSubComponentsflag indicating whether subcomponents have to also be installed
Returns
Error code: -1 if ERROR, 0 if all OK.
Author
F. Varela.
int fwInstallation_setComponentInstallationStatus ( string  componentName,
bool  ok 
)
This function sets the internal dpes of the component dp according to the status of the installation
Parameters
componentNamecomponent name
okstatus of installation
Returns
Error code: -1 if ERROR, 0 if all OK.
Author
F. Varela.
fwInstallation_getNotInstalledComponentsFromRequiredComponents ( dyn_string &  dynRequiredComponents,
string &  strNotInstalledNames 
)
This function checks if all the required components are installed. It returns a string of components that are not

installed and required.

Parameters
dynRequiredComponents,:the name of a componentConfigFile
strNotInstalledNames,:the name of a component
Author
M.Sliwinski
fwInstallation_AddComponentIntoConfig ( string  componentConfigFile,
string  componentName,
bool  addToReduConfig = false 
)

This function reads the component config file and copies its entries to the project config file (if they are not yet there).

Parameters
componentConfigFile(in) Path of the component config file
componentName(in) Name of the component
addToReduConfig(in) Flag that indicates if component entries should be added to the project redu config file (by default false)
int fwInstallation_loadFileLines ( string  filePath,
dyn_string &  fileLines 
)

Reads the given file and loads it into memory as a list of lines.

Parameters
filePath(in) Path of the file to be read
fileLines(out) List of the file lines
Returns
0 when file was loaded successfully, -1 when failed to load the file
void fwInstallation_deleteComponentConfigEntries ( dyn_string &  configLines,
string  componentName 
)

Removes all lines containing component parametrization from the list of config lines.

Parameters
configLines(in/out) List of the config lines
componentName(in) Name of the component
int fwInstallation_parseConfigLine ( string  configLine,
string &  key,
dyn_string &  keyValues 
)

Parses key-values pair from config file line.

Note
: If line contains section definition or only comment then it is returned via key parameter and keyValues is not modified.
Parameters
configLine(in) Config file line
key(out) Config entry key/section name/comment
keyValues(out) List of config entry values
Returns
-1 when failed to parse config line, otherwise code indicating the type of config line (empty/comment/section/key-value entry), see FW_INSTALLATION_CONFIG_*_LINE_CODE constants
void fwInstallation_parseConfigFileLines ( const dyn_string &  configLines,
dyn_string &  configSections,
dyn_dyn_string &  configKeysArray,
dyn_dyn_mixed &  configValuesArray 
)

Parses config lines into memory representation: list of sections ([section]), array of keys ([section][key]), array of values ([section][key][value]).

Note
Config lines contains only comment are discarded, on the other hand currently comment after the value is treated as a part of this value.
Parameters
configLines(in) List of config file lines
configSections(out) List of config sections ([section])
configKeysArray(out) Array of config entry keys ([section][key])
configValuesArray(out) Array of config entry keys values ([section][key][value])
bool fwInstallation_config_entryExistsInMemory ( string  key,
string  value,
const dyn_string &  configKeys,
const dyn_mixed &  configValues 
)

Checks if config entry (key-value pair) exists in memory representation of the particular section of config file

Parameters
key(in) Key to be searched
value(in) Value of given key to be searched
configKeys(in/out) List of config keys (of particular section)
configValues(in/out) Array of config values ([key][value]) (of particular section)
Returns
true if key-value exists in the memory representation, false if not
void fwInstallation_config_addEntryIntoMemory ( string  key,
dyn_string  keyValues,
dyn_string &  configKeys,
dyn_mixed &  configValues 
)

Adds config entry (key-values pair) into memory representation of the particular section of config file.

Parameters
key(in) Key to be added
keyValues(in) Values to be added under given key
configKeys(in/out) List of config keys (of particular section)
configValues(in/out) Array of config values ([key][value]) (of particular section)
int fwInstallation_config_setSectionInMemory ( string  section,
dyn_string &  configSections,
dyn_dyn_string &  configKeysArray,
dyn_dyn_mixed &  configValuesArray 
)

Retrieves ID of the section in the memory representation of config file. If section is not yet there, appends it and initializes corresponding indexes in configKeysArray and configValuesArray.

Parameters
section(in) Name of the section
configSections(in/out) List of the sections in config file ([section])
configKeysArray(in/out) Array of config entry keys ([section][key])
configValuesArray(in/out) Array of config entry keys values ([section][key][value])
Returns
ID of the section (index in configSections array)
bool fwInstallation_config_isCommentLine ( string  configLine)

Checks if the config line is a line that contains only comment (starts with '#' symbol).

Note
Leading whitespaces must be removed before calling this function (use strltrim()) : Maybe regexp (or piece of code) to find the first occurence of '#' that is not inside quotes '"', then take only this part that is not a comment
Parameters
configLine(in) Single line of a config file
Returns
true if config line is a comment line, false if not (a section or key-value entry)
bool fwInstallation_config_isSectionDefinition ( string  configLine)

Checks if the config line is a line that defines a config file section (e.g. [ui], [general])

Note
Leading whitespaces must be removed before calling this function (use strltrim())
Parameters
configLine(in) Single line of a config file
Returns
true if config line is a line that specifies config section, false if not
string fwInstallation_config_trimComment ( string  configLine)

Returns the config line with any comments removed. : Currently it doesn't take into account that '#' might occur inside quotes "[...]" and then should not be treated as a character that starts comment. Now this function is used only for section definition lines where quotes are not used.

Parameters
configLine(in) Single line of a config file
Returns
Config line that does not contains comments, empty string if comment line is provided as an argument
int fwInstallation_config_getKeyValue ( string  configLine,
string &  key,
dyn_string &  values 
)

Parses key-values pair in a config line.

Parameters
configLine(in) Single line of a config file
key(out) Config key
values(out) The values of a config key
Returns
-1 in case of error (not possible to parse config line), 0 when success
string fwInstallation_config_getConfigEntryParser ( string  key)

Returns the name of the function that should be used to parse config entry with specific key. It is possible to define custom parser functions for specific config keys. Name of such function must have the following pattern: fwInstallation_config_parse[key](). For example: fwInstallation_config_parseLoadCtrlLibs() for LoadCtrlLibs config key. If custom function for the config key is not defined then default parser function is returned: fwInstallation_config_parse()

Parameters
key(in) Config entry key
Returns
Name of the parser function.
dyn_string fwInstallation_config_parse ( string  valueString)

Default parser function, returns the provided value as a one-element list, without any further processing.

Parameters
valueString(in) Config key string value
Returns
One-element list containing provided valueString
dyn_string fwInstallation_config_parseLoadCtrlLibs ( string  valueString)

Parser function for LoadCtrlLibs entries. Splits provided string into a list of library files.

Parameters
valueString(in) LoadCtrlLibs key value (string contains library files delimited with comma) List of ctrl library files
fwInstallation_mergeComponentConfigIntoProject ( dyn_string &  projectConfigLines,
const dyn_string &  componentConfigLines,
string  componentName 
)

Adds component config lines into project config lines if not yet there.

Parameters
projectConfigLines(in/out) Project config lines
componentConfigLines(in) Component config lines
componentName(in) Name of the component
int fwInstallation_config_getSectionLineNum ( const dyn_string &  configLines,
string  sectionName 
)

Returns the config line number where the given section is defined.

Note
If section is defined more than once (might happen in component config), only the number of the line, where section is defined for the first time, is returned. Therefore this function should not be used for the component config lines.
Parameters
configLines(in) List of the config lines
sectionName(in) Name of the section to look for
0when section was not found in the config file, otherwise number of the line where section is defined (>0)
void fwInstallation_config_insertComponentTag ( dyn_string &  configLines,
int  lineNumber,
string  componentName,
string  tagTypePattern 
)

This function inserts the component tag into the config lines (information where the component parametrization starts/ends).

Parameters
configLines(in/out) Config file lines
lineNumber(in) Line number where the tag should be inserted
componentName(in) Name of the component
tagTypePattern(in) Pattern with the config component tag, only FW_INSTALLATION_CONFIG_COMPONENT_TAG_BEGIN_PATTERN or FW_INSTALLATION_CONFIG_COMPONENT_TAG_END_PATTERN should be used
int fwInstallation_addLinesIntoSection ( dyn_string &  configLines,
string  currentSection,
dyn_string  linesToAdd 
)
This function adds the lines from linesToAdd into the configLines under the section specified by currentSection
Note
Currently not used anywhere in the frameworks, might became obsolete, if not it should be reviewed (what if there is a comment after section definition?)
Parameters
configLines,:the dyn_string with file lines
currentSection,:the name of a currentSection
linesToAdd,:the lines to be added
Author
M.Sliwinski
int fwInstallation_changeProjPaths ( dyn_string  projPaths)
This function saves the new order of project paths into the config file.

Provided list of paths must contain all paths that were previously in config file. If PROJ_PATH is not at the last position in the list (or is missing) it will be automatically moved/added at the end of the provided list.

Parameters
projPaths(in) List of project paths in choosen order
Returns
0 if OK, -1 if error
Author
Sascha Schmeling
int fwInstallation_createPath ( string  sPath,
bool  createDirectory = true 
)
This function creates a project path, either creates the directory or just adds the path
Parameters
sPath,:project path to be created
createDirectoryflag to indicate if the directory has to be created if it does not exist (default value is true)
Returns
0 if OK, -1 if error
fwInstallation_getComponentDescriptionPVSSDB ( string  componentName,
int  reduHostNum = 0 
)

FVR: 29/03/2006.

This function retrieves the component information from the PVSS DB and
displays it in the panel
Parameters
componentNamethe name of a file with component description
Author
M.Sliwinski
fwInstallation_putComponentsInOrder_Delete ( dyn_string  componentsNames,
dyn_string &  componentsNamesInOrder 
)
This function puts the components to be deleted in order in which they should be deleted

The function only checks if the component chosen for deleting depend on each other. The function operates on the component information contained in the PVSS DB

algorithm: suppose we have the following components to delete: com1, com2, com3 the dependencies are following: com1: is required by com2 com2: is required by com3 com3: is nor required by them We can first delete the com3 because it is not required by com1 i com3 the dependencies are following: com1: is required by com2 com2: is not required by any component If there is a loop: com1 is required by com2 and com2 is required by com1 the components can not be ordered

Parameters
componentsNames,:the dyn_string of the components to be put in order before deleting
componentsNamesInOrder,:the dyn_string of the ordered components to be deleted
Author
M.Sliwinski
fwInstallation_getListOfDependentComponents ( string  componentName,
dyn_string &  dependentComponentsList 
)
This function gets the list of dependent components. This functions from the list of  all  installed components

retrieves the list of components that require strComponentName

Parameters
componentName,:the name of the component for which we would like to find dependent components
dependentComponentsList,:the dyn_string of components that require the strComponentName component
Author
M.Sliwinski
fwInstallation_parseRequiredComponentNameVersion ( string  requiredComponentNameVersion,
string &  requiredComponentName,
string &  requiredComponentVersion 
)

Parses required component name and version from requirement string

Parameters
requiredComponentNameVersion(in) Requirement string with component name and minimal required version separated with '=' (eg. fwComponent=8.0.0)
requiredComponentName(out) Parsed required component name
requiredComponentVersion(out) Parsed required version, empty if requirement string contains only component name
int fwInstallation_deleteComponent ( string  componentName,
bool &  componentDeleted,
bool  deleteAllFiles = TRUE,
bool  deleteSubComponents = true,
bool &  deletionAborted 
)
this function deletes the component files, the component information from the config file
and the internal DP created by the installation tool with the description of a component.
This function does not delete the component data point types ( ETM is planning to
add the functionality of deleting the DPT, DP from the ASCII Manager ).
Parameters
componentName(in) the name of a component to be deleted
componentDeleted(out) result of the operation
deleteAllFiles(in) flag indicating if the components files must also be deleted. Default value is true.
deleteSubComponentsflag indicating if the subcomponent must also be deleted. Default value is true.
Author
F. Varela
int fwInstallation_storePostDeleteScripts ( const dyn_string &  dynPostDeleteFiles_current)

This function stores in the component internal dp of the installation tool the list of post delete scripts to be run

Parameters
dynPostDeleteFiles_current(in) list of post-delete files to be stored
Returns
0 if OK, -1 if error
int fwInstallation_checkDistribution ( string  sourceDir,
const dyn_string &  requiredComponents,
dyn_string &  dsFileComponentName,
dyn_string &  dsFileVersions,
dyn_string &  dsFileComponent 
)

This function resolves the XML files and versions of the components required for installation during the installation of a particular component

Parameters
sourceDir(in) Source directory
requiredComponents(in) List of required components, each element must have format <componentName>=<minVersionRequired>
dsFileComponentName(out) List of available component names, element from particular index corresponds to the same index in requiredComponents list, when required component is not available in source directory, element contains empty string
dsFileVersions(out) List of available component versions, each version correspond to the component on the same index in dsFileComponentName, if component is not available in source directory, version is an empty string
dsFileComponent(out) list of available component XML files, each XML path correspond to the component on the same index in dsFileComponentName, when component is not available or in version lower than required, the XML file is an empty string
Returns
0 if success, -1 if error (at least one required component is missing in source directory or failed to parse name and version from requirement string)
int fwInstallation_checkInstalledComponent ( string  componentName,
string  version = "" 
)
This function checks if a given component is correctly installed
Parameters
componentName,:Name of the component to be checked
version,:Version of the component to be checked. Optional parameter: if emtpy it checks for any version.
Returns
0 if the component version or newer correctly installed, -1 if the component is not installed correctly (missing required components) or just not installed
Author
F. Varela
int fwInstallation_checkTargetDirectory ( string  destinationDir,
string  componentName,
string &  versionInstalled 
)
This function checks if a previous installation of a particular directory exists in the target directiory
Parameters
destinationDir(in) target directory
componentName(in) name of the component to be checked
versionInstalled(in) version of the component installed, if any
Returns
0 if OK, -1 if error
dyn_string fwInstallation_getFileNamesRec ( string  dir = ".",
string  pattern = "*" 
)
This function retrieves the files in a directory recursing over sub-directories
Parameters
dir(in) directory where to look for files
pattern(in) search pattern
Returns
list of file found as a dyn_string
fwInstallation_recurserFileNames ( string  dir,
string  pattern,
dyn_string &  fileNames 
)
Helper function used by fwInstallation_getFileNamesRec
Parameters
dir(in) directory where to look for files
pattern(in) search pattern
fileNames(out) names of the files found
int fwInstallation_getDescriptionFile ( string  componentName,
string  componentVersion,
string  sourceDir,
string &  descriptionFile,
bool &  isItSubComponent 
)
This function retrieves the full path to the XML description file of a component
Parameters
componentName(in) name of the component
componentVersion(in) version of the component (legacy, not used)
sourceDir(in) source directory
descriptionFile(out) XML description file
isItSubComponent(out) indicates if it is a subcomponent or not
Returns
0 if OK, -1 if error
int fwInstallation_isSubComponent ( string  xmlFile,
bool &  isSubComponent 
)
This function parses the xml file of a coponent to find out if it is a sub-component
Parameters
xmlFile(in) XML file name
isSubComponent(out) indicates if it is a subcomponent or not
Returns
0 if OK, -1 if error
int fwInstallation_getDistPort ( )
This function returns the port used by the distribution manager of the local project
Returns
port number
int fwInstallation_getReduPort ( )
This function returns the redundancy port of the local project
Returns
port number
int fwInstallation_getSplitPort ( )
This function returns the split port of the local project
Returns
port number
string fwInstallation_getPmonUser ( )
This function returns the pmon user (not yet implemented)
Returns
pmon user
string fwInstallation_getPmonPwd ( )
This function returns the pmon pwd (not yet implemented)
Returns
pmon user
string fwInstallation_getPmonHostname ( )

This function returns hostname 'localhost'

int fwInstallation_getProjectProperties ( dyn_mixed &  projectInfo)
This function returns the properties of the local project as a dyn_mixed array
Parameters
projectInfo(in) Project properties
Returns
0 if OK, -1 if error
int fwInstallation_createDbInitFile ( )

Saves DB connection configuration stored in internal dp to fwInstallationInit.config file.

Returns
0 when success, -1 when file creation failed
int fwInstallation_isPmonProtected ( )
This function checks if pmon is protected with a username and a pwd
Returns
0 if PMON is NOT protected, 1 otherwise
int fwInstallation_postInstallToRun ( dyn_string &  allPostInstallFiles)
This function returns post install files that are scheduled to run
Parameters
allPostInstallFiles,:dyn_string to contain the list of post install files
Returns
0 - "success" -1 - error
Author
S. Schmeling
int fwInstallation_getSections ( dyn_string &  dsSectionList,
string  sPattern = "" 
)
This function gets list of sections in config file into a dyn_string
Parameters
dsSectionList(out) dyn_string that will contain names of the all configs' sections
sPattern(in) string to define the pattern
Returns
0 - sections with specified pattern were forund in config file, -1 - error (config file cannot be loaded), -2 - no sections with given pattern were found in config file (dsSectionList is empty)
Author
D. Dyngosz
int fwInstallation_getSection ( string  section,
dyn_string &  configEntry 
)
This function gets a specified section into a dyn_string
Parameters
section,:string to define the section
configEntry,:dyn_string that will contain the lines for the section
Returns
0 - "success" -1 - error -2 - section does not exist
Author
S. Schmeling
int fwInstallation_setSection ( string  section,
dyn_string  configEntry 
)
This function sets a specified section from a dyn_string
Parameters
section,:string to define the section to where the data has to written
configEntry,:dyn_string that contains the lines for the section
Returns
0 - "success" -1 - error
Author
S. Schmeling
int fwInstallation_clearSection ( string  section)
This function will delete all entries of the specified section as well as all but the first header.
Parameters
section,:string to define the section which will be cleared (first header will stay)
Returns
0 - "success" -1 - error -2 - section does not exist
Author
S. Schmeling
int fwInstallation_addToSection ( string  section,
dyn_string  configEntry 
)
This function adds the given lines to a section in the config file.
Parameters
section,:string to define the section where the data has to be added (will be created if not existing)
configEntry,:dyn_string containing the lines to be added
Returns
0 - "success" -1 - error
Author
S. Schmeling
void fwInstallationXml_getComponentDescription ( string  descFile)
This function retrieves the component information from the xml file and
displays it in the panel
Parameters
descFile,:the name of a file with component description
Author
M.Sliwinski
int fwInstallation_normalizePath ( string &  projPath,
bool  addTrailingSlash = false 
)

This function normalises the path. After execution of the function the given argument is normalised - all backslashes in path are replaced with slashes. Note: Leading "./" is removed from path.

Parameters
projPath,:Project path (in/out)
Returns
0 if path was successfully normalised, -1 in case of error
int fwInstallation_normalizePathList ( dyn_string &  projPaths,
bool  addTrailingSlash = false 
)

Normalize list of paths. Replaces all backslashes with slashes.

Parameters
projPaths- list of project paths
Returns
In case of error returns -1 (no changes are made to input variable), normally (OK) returns 0
dyn_string fwInstallation_splitLines ( string  s)

Returns a list of lines in given string, breaking at line boundaries. New line characters (LF or CR+LF) are removed and don't occur in the returned list. If string contains n new line characters then the returned list has size n+1. However if the last new line character is also the last character of the string then last empty substring is ignored and returned list has size n.

Note
This function is recommended to use instead of strsplit(string, "\n") as it provides the correct handling of carriage return (CR) character in UNIX systems.
Parameters
s(in) String to be splitted.
Returns
List of lines in given string.
string fwInstallation_formatPowershellCommandForWinCmd ( string  powershellCommand)

Returns a given Powershell command, formatted to be run from Windows Command Prompt (in system() function call)

Note
Any double qoute character in the PS command is escaped with backslash () in the output string.
NUL is passed through stdin to ensure that PowerShell exists after execution of given script is finished.
Parameters
powershellCommand(in) PowerShell command
Returns
Windows Command Prompt command, that executes the given PowerShell command.
string fwInstallation_getVersionString ( string  version,
string  versionTag 
)

Returns the version string from given version and tag.

Parameters
version(in) Version (pattern: X.X.X)
versionTag(in) Tag (eg. "beta-01", "SNAPSHOT-201810140930", "")
Returns
Version string of pattern: <version>-<versionTag> or <version> when versionTag is empty (stable release)
void fwInstallation_cleanupObsoleteFiles ( string  componentName,
const dyn_string &  obsoleteFiles,
bool  recursive = false 
)

This function removes given files or folders from the installation directory of specified component. It is intended for performing cleanup of component obsolete files in component installation script (init [recommended] or post-install). If component is not installed, function returns immediately. If file does not exist already, it is skipped.

Parameters
componentName(in) Name of the component
obsoleteFiles(in) List of files or folders to be removed (relative paths from component installation directory); note that folder-removal is not recursive unless 'recursive' parameter is set to true
recursive(in) Remove folders recursively if set to true; default=false
void fwInstallation_cleanupObsoleteFilesFromPath ( string  componentName,
string  path,
const dyn_string &  obsoleteFiles,
bool  recursive = false 
)

This function removes given files or folders from the specified path if they exists.

Note
This is for internal use in fwInstallation. In the component cleanup script use fwInstallation_cleanupObsoleteFiles() function instead.
Parameters
componentName(in) Name of the component
path(in) Common part of the path to obsolete files
obsoleteFiles(in) List of files or folders to be removed (relative paths); note that folder-removal is not recursive unless 'recursive' parameter is set to true
recursive(in) Remove folders recursively if set to true; default=false
int fwInstallation_removeEmptyDirectory ( string  dirPath)

This function removes specified directory only if it is empty - it does not contain any files nor subfolders.

Parameters
dirPath(in) Path to the directory that should be removed.
Returns
0 when directory was removed or it didn't exist. 1 if it could not be removed because it is not empty -1 when it could not be removed due to other reasons (eg. insufficent access rights)
dyn_string fwInstallation_getSubdirectories ( string  dir,
string  pattern = "*" 
)

Returns the list of subdirectories in the given directory that match the pattern. The list does not contain current "." and parent ".." directory.

Parameters
dir(in) Path to the directory where to look for subdirectories
pattern(in) Subdirectory name pattern, when not provided then all subdirectories are returned ("*")
Returns
List of subdirectories as dyn_string
int fwInstallation_trackDependency_register ( string  triggeringComponent,
string  requiredComponent 
)

Registers components pair (component and its required component) for dependency tracking during components installation. It is registered in global mapping variable gFwInstallationTrackDependency.

Parameters
triggeringComponent(in) Component requiring another component to be installed
requiredComponent(in) Component that is required
Returns
0 if registration ok, -1 when it failed, because circular dependency was detected.
void fwInstallation_trackDependency_unregister ( string  triggeringComponent)

Unregisters component and all its required components from dependency tracking.

Parameters
triggeringComponent(in) Component to be unregistered along with its dependencies.
fwInstallation_trackDependency_clear ( )

Clears all dependency tracking entries.

bool fwInstallation_trackDependency_isCircular ( string  triggeringComponent,
string  requiredComponent 
)

Checks if given components pair (component and its required component) creates circular dependency chain with already tracked dependencies.

Parameters
triggeringComponent(in) Component requiring another component to be installed
requiredComponent(in) Component that is required
Returns
true if given pair creates circular dependency chain, false if not
private bool fwInstallation_trackDependency_findCircularRecursively ( string  triggeringComponent,
string  requiredComponent,
dyn_string &  recursiveChain 
)

Checks for occurence of circular dependency chain in given components pair and tracked dependencies recursively.

Parameters
triggeringComponent(in) Component requiring another component to be installed
requiredComponent(in) Component that is required
recursiveChain(out) List of components checked recursively
Returns
true if circular dependency occurs for given pair, false if not
string _fwInstallation_getDevicesDpPattern ( string  deviceType,
string &  devicesDpt 
)

This functions returns the dp pattern and dp type for given device type.

Parameters
deviceTypeDevice type name.
devicesDpt(out) Datapoint type of given device type name.
Returns
Datapoint pattern for given device type name or empty string when unknown device type.
string fwInstallation_getDeviceNameFromDp ( string  deviceDp,
string  deviceType 
)

This functions gets the device name from device datapoint.

Parameters
deviceDpDevice datapoint.
deviceTypeDevice type name.
Returns
Device name or empty string when unknown device type.
string fwInstallation_getAdditionalPlcInfo ( string  plcDp)

This function gets additional PLC info for the Schneider and Siemens PLCs.

Parameters
plcDp(in) PLC datapoint
Returns
JSON formatted string with additional PLC info
int fwInstallation_getDevices ( string  deviceType,
string  application,
dyn_dyn_mixed &  devices 
)

Retrieve existing devices of given type in given application on this system.

Parameters
deviceTypeDevice type name.
applicationApplication name, when it is empty string then all devices will of given type will be retrieved.
devicesVariable to receive info about devices.
Returns
0 on success, -1 on error.

: Currently only information from 'Comment' field are filled, 'Info_URL' and 'Status' are missed. The 'Moon_Info' will be updated from MOON project.

private int fwInstallation_ui_getInstalledComponentsInfo ( dyn_dyn_mixed &  installedComponentsToDisplay,
bool &  componentsIncorrectlyInstalled,
bool &  componentsBrokenDependencies,
int  reduHostNum 
)

Retrieves information about components installed in the project.

Parameters
installedComponentsToDisplay(out) Array of installed components information, note indexing: [information_type][component]
componentsIncorrectlyInstalled(out) Flag that indicates if there are components installed incorrectly
componentsBrokenDependencies(out) Flag that indicates if there are components with missing dependencies
reduHostNum(in) Local host redu number, in non-redundant system it is always 1.
Returns
Number of installed components
private void fwInstallation_ui_getInstalledComponentsInfoRecursively ( dyn_dyn_mixed &  installedComponentsToDisplay,
string  componentDp,
string  parentComponent,
int &  index,
dyn_string &  pendingSubcomponents,
bool &  componentsIncorrectlyInstalled,
bool &  componentsBrokenDependencies,
int  reduHostNum 
)

Retrieves information about particular installed component from datapoint. Note: Does recursive call for subcomponents of current component.

Parameters
installedComponentsToDisplay(out) Array of installed components information, note indexing: [information_type][component]
componentDp(in) Component datapoint name
parentComponent(in) Name of the parent component, when empty then component doesn't have a parent
index(in/out) Number of elements in installedComponentsToDisplay array
pendingSubcomponents(out) List of subcomponents that could not be added as their parent is not in the array.
componentsIncorrectlyInstalled(out) Flag that indicates if there are components installed incorrectly
componentsBrokenDependencies(out) Flag that indicates if there are components with missing dependencies
reduHostNum(in) Local host redu number, in non-redundant system it is always 1.
private void fwInstallation_ui_updateInstalledComponentsStatusInfo ( shape  fileIssueLabelShape,
shape  fileIssueArrowShape,
bool  componentsIncorrectlyInstalled,
bool  componentsBrokenDependencies 
)

Displays status info of installed components (incorrect installation/missing dependencies).

Parameters
fileIssueLabelShape(in) Shape of label where to put status info
fileIssueArrowShape(in) Shape of array to be displayed in case of component issues
componentsIncorrectlyInstalled(in) Flag that indicates if there are components installed incorrectly
componentsBrokenDependencies(in) Flag that indicates if there are components with missing dependencies
synchronized void fwInstallation_ui_displayInstalledComponents ( shape  tableShape,
shape  fileIssueLabelShape,
shape  fileIssueArrowShape,
bool  subcomponentsVisible,
int  reduHostNum = 0 
)

Searches for components installed in project and displays them in 'Installed components' table.

Parameters
tableShape(in) Installed components table shape
fileIssueLabelShape(in) Shape of label where to put status info
fileIssueArrowShape(in) Shape of array to be displayed in case of component issues
subcomponentsVisible(in) Flag that indicates if subcomponents should be shown (true) or hidden
reduHostNum(in) Local host redu number, default value (0) indicates that the number will be obtained automatically.
private int fwInstallation_ui_getAvailableComponentsInfo ( dyn_dyn_anytype &  availableComponentsToDisplay,
string  sourceDirectory,
bool  scanRecursively = false,
string  systemName = "" 
)

Retrieves information about available components in given source directory

Parameters
availableComponentsToDisplay(out) Array of available components information, note indexing: [information_type][component]
sourceDir(in) Path to look for available components
scanRecursively(in) Flag that indicates if components are searched also in subdirectories
systemName(in) System where it is checked if component is already installed, if empty (default) then local system
Returns
0 when components were not found in given directory, otherwise number of found components
void fwInstallation_ui_displayAvailableComponents ( shape  tableShape,
string  sourceDir,
bool  scanRecursively,
bool  subcomponentsVisible,
bool  hiddenComponentsVisible,
string  systemName = "" 
)

Searches for available components in given source directory and displays them in 'Available components' table.

Parameters
tableShape(in) Available components table shape
sourceDir(in) Path to look for components
scanRecursively(in) Flag that indicates if components are searched also in subdirectories
subcomponentsVisible(in) Flag that indicates if subcomponents should be shown (true) or hidden
hiddenComponentsVisible(in) Flag that indicates if hidden components should be shown (true) or hidden
systemName(in) System where it is checked if component is already installed, if empty (default) then local system
void fwInstallation_ui_filterComponentsTable ( shape  tableShape,
bool  subcomponentsVisible,
bool  hiddenComponentsVisible 
)

Show/hide rows with subcomponents and hidden component in components table according to given parameters.

Parameters
tableShape(in) Components table shape
subcomponentsVisible(in) Flag that indicates if subcomponents should be shown (true) or hidden
hiddenComponentsVisible(in) Flag that indicates if hidden components should be shown (true) or hidden
fwInstallation_ui_getMarkedComponentsData ( shape  tableShape,
const dyn_string &  markLabels,
const dyn_string &  columnsToGet,
dyn_dyn_mixed &  componentsInfo 
)

This function retrieves from a table requested data of components that have specific labels set in colum "colStatus". Retrieving data of components that are selected in a table for installation or removal.

Parameters
tableShape(in) Shape of a table
markLabels(in) List of labels - components that have these labels in "colStatus" column will be retrieved
columnsToGet(in) List of table columns from which the information are read.
componentsInfo(out) Retrieved marked components info. Columns are indexed corresponding to the columnsToGet list, each row contains one component data.
dyn_mixed fwInstallation_ui_getColumnsInRow ( shape  tableShape,
int  row,
const dyn_string &  columnsToGet 
)

Retrieves values from table cells in a given row and given columns.

Parameters
tableShape(in) Shape of a table
row(in) Table row number
columnsToGet(in) List of table columns from which the information are read.
Returns
List of values in a particular row and in given columns. Column values are in the same order as in columnsToGet list.
fwInstallation_ui_componentsTableRightClickPopupMenu ( shape  tableShape,
int  row,
string  column 
)

Shows and handles the right click pop-up menu in components table.

Parameters
tableShape(in) Components' table shape
row(in) Row number
column(in) Name of a column (currently unused)
private void fwInstallation_ui_copyComponentsListToClipboard ( shape  tableShape)

Copies to clipboard a list of components and their versions as a string.

Parameters
tableShape(in) Components' table shape
string fwInstallation_ui_getTableColumnsAsString ( shape  tableShape,
dyn_string  columns,
bool  addHeader = true,
string  colSeparator = "\t",
bool  onlyVisible = true 
)

Reads all rows of the given table's columns as a string.

Parameters
tableShape(in) Shape of a table
columns(in) List of table columns
addHeader(in) Flag that indicates if columns headers should be added at the beginning (true - default)
colSeparator(in) String that separates fields of different columns (default is TAB character)
onlyVisible(in) Flag that indicates if only content of visible rows should be read
Returns
Content of table's columns as string. When shape is not ot type 'TABLE' or table don't have a specified column then empty string is returned.
void fwInstallation_ui_setTableAlternatingRowColors ( shape  table)

Enables alternating row colors for a given table.

Parameters
table(in) Table shape
void fwInstallation_ui_openReleaseNotes ( )

Opens fwInstallation Release Notes in text editor (read only mode)

void fwInstallation_reportInit ( shape  sh)

Creates/updates global variable that stores provided shape of a 'Installation Info' reference panel and therefore enables reporting of component installation process. This function is called in fwInstallation_installationInfo.pnl panel with its own shape as an argument when user-defined event eventStartReporting() occurs.

Parameters
sh(in) Shape of 'Installation Info' reference panel on main installation panel.
void fwInstallation_reportTeardown ( )

Removes global variable with shape of a 'Installation Info' reference panel. This disables reporting of reporting of component installation process. This function is called in fwInstallation_installationInfo.pnl panel when user-defined event eventStopReporting() occurs.

private fwInstallation_reportSetReportShape ( shape  sh)

Sets the shape stored by 'reportShape' global variable.

Parameters
sh(in) Shape that is assigned to 'reportShape' global variable
shape fwInstallation_reportGetReportShape ( )

Returns the shape stored in 'reportShape' global variable.

Note
fwInstallation_reportReportShapeExists() function should be called before to check if global variable exists.
Returns
Shape stored in 'reportShape'
bool fwInstallation_reportReportShapeExists ( )

Checks if global variable 'reportShape' exists.

Returns
TRUE when 'reportShape' exists or else, FALSE
private void fwInstallation_updateReport ( string  messageType,
anytype  value 
)

Sends installation report messages to the 'Installation Info' panel. This function invokes 'updateReport' public function in fwInstallation_installationInfo.pnl, with message type and parameter value provided as an arguments.

Note
Handling of provided message type should be implemented in 'updateReport' public function in fwInstallation_installationInfo.pnl
Parameters
messageType(in) Type of the message
value(in) Parameter value for given message type
fwInstallation_reportInstallationStartTime ( )

This function sends installation start time. Start time is the current time.

Note
This function must be called after the number of components to be installed is set.
fwInstallation_reportSetTotalComponentsNumber ( int  componentsNumber)

This function sends number of components to be installed.

Parameters
componentsNumber(in) Number of components to be installed
fwInstallation_reportUpdateTotalComponentsNumber ( int  additionalComponentsNumber)

This function sends number of additional components to be installed (this number is added to the current number of components to be installed).

Parameters
additionalComponentsNumber(in) Number of additional components to be installed
fwInstallation_reportComponentInstallationProgress ( string  componentName,
int  stage 
)

This function sends installation progress of given component

Parameters
componentName(in) Name of the component being installed
stage(in) Current component installation step number
fwInstallation_reportComponentInstallationFinished ( string  componentName)

This function sends information that installation of given component is finished

Parameters
componentName(in) Name of the component which installation is finished
fwInstallation_reportInstallationMessage ( errClass  message)

This function sends installation log messages ()

Note
During processing of log messages in 'Installation Info' panel it is assumed that fwInstallation_throw() is called only by functions that run installation process (this might not always be true - DB agent? - but this can be detected by checking if error comes from UI manager that runs fwInstallation main panel, but what about executing init scripts in dedicated control manager [future solution?]?)
  • that component installation is not run in parallel (only one component is being installed at the moment - this should be always true)
Parameters
message(in) Log message of errClass type

Variable Documentation

const string csFwInstallationToolVersion = "8.4.1"

Version of this tool. Used to determine the coherency of all libraries of the installation tool Please do not edit it manually

const string csFwInstallationToolTag = ""

Tool version tag. In repository it has a value "devel", when snapshot/beta is built it is replaced by pre-release tag. In final relase this global is an empty string. Used to determine the coherency of all libraries of the installation tool Please do not edit it manually

const string csFwInstallationLibVersion = "8.4.1"

Version of this library. Used to determine the coherency of all libraries of the installtion tool Please do not edit it manually

const string gFwInstallationComponentName = "fwInstallation"

Error codes that can be ignored while doing ASCII import Name of this component.

const string gFwInstallationConfigFile = "fwInstallation.config"

Name of the config file of the tool.

const string gFwInstallationInitFile = "fwInstallationInit.config"

Name of the init file loaded at start up of the tool.

const int gFwInstallationError = -1

Returned error code in case of problems

const int gFwInstallationOK = 0

Returned error code in case everything is OK

bool gFwInstallationErrorShown = FALSE

Constant that stores a particular error has already been shown

bool gFwYesToAll = FALSE

Constant that stores if the user has clicked in the Yes to All button during installations

string fwInstallation_VERSION_KEYWORD = "%VERSION%"

keyword used to replace by the current version name

const string gFwTrashPath = PROJ_PATH + "/fwTrash/"

Path to the trash folder

const string FW_INSTALLATION_RELEASE_NOTES = "fwInstallation/fwInstallationReleaseNotes.txt"

Relative path from help/en_US.utf8/ directory to the fwInstallation release notes file

const string FW_INSTALLATION_LOG_FILE = "fwInstallation.log"

fwInstallation main log file name.

const string FW_INSTALLATION_REPORT_VARIABLE_INSTALATION_INFO_COMPONENT = "componentName"

Elements of mapping, that stores information about installation of particular component

const string FW_INSTALLATION_REPORT_MESSAGE_INSTALLATION_STARTED = "installationStarted"

Definition of report message types and functions that sends them

const int FW_INSTALLATION_REPORT_STEP_STARTING_INSTALLATION = 1

Definition of component installation steps