ITextFileUpdatesComponent

DeclarationCopy link to this sectionLink to this section copied!

ITextFileUpdatesComponent : IDispatch

OverviewCopy link to this sectionLink to this section copied!

This interface facilitates accessing text file update operations and create a new one

MethodsCopy link to this sectionLink to this section copied!

NewTextUpdateFile(IFolder TargetFolder, String FileName) returns ITextUpdateFile
Creates a new text file update.

NewTextUpdateFileS(String PathToTargetFolder, String FileName) returns ITextUpdateFile
Creates a new text file update.

Properties Copy link to this sectionLink to this section copied!

Array<ITextUpdateFile> TextUpdateFiles
Gets the collection of text updates file operations

Example Copy link to this sectionLink to this section copied!

$advinst = new-object -com AdvancedInstaller
$project = $advinst.CreateProjectS("architect")
$project.TextFileUpdatesComponent.TextUpdateFiles
$textFileUpdate =
$project.TextFileUpdatesComponent.NewTextUpdateFileS("appdir\pgsql\data", "postgresql.conf")
$textFileUpdate.CreateBackupFileBeforeUpdate = $true
$textFileUpdate.AbortInstallationOnError = $true


$updateCheckpoint = $textFileUpdate.NewReplaceOperation("checkpoint_completion_target")
$updateCheckpoint.Find = "#checkpoint_completion_target = 0.\d+"
$updateCheckpoint.UseRegularExpressions = $true
$updateCheckpoint.Replace = "checkpoint_completion_target = 0.9"
$updateCheckpoint.MatchCase = $true 
$updateCheckpoint.ReplaceOnlyFirstOccurence = $true


$updateStatementTimeout = $textFileUpdate.NewReplaceOperation("statement_timeout") 
$updateStatementTimeout.Find = "#statement_timeout = \d+"  
$updateStatementTimeout.UseRegularExpressions = $true
$updateStatementTimeout.Replace = "statement_timeout = 1800000"
$updateStatementTimeout.MatchCase = $true
$updateStatementTimeout.ReplaceOnlyFirstOccurence = $true