IPrerequisitesComponent

Declaration

IPrerequisitseComponent: IDispatch

Overview

This interface is meant to configure Prerequisites.

Properties

SAFEARRAY(Variant) ChainedPackages
Gets the list of currently defined chained packages.

SAFEARRAY(Variant) SupportedPredefinedPackages
Gets the list of all predefined packages.

SAFEARRAY(Variant) UnchainedPackages
Gets the list of currently defined unchained packages.

Methods

Void DeletePrerequisite
Deletes the specified prerequisite from the package list.

IChainedPackage NewChainedPackage
Creates and adds a new chained package using the specified package source path.

IUnchainedPackage NewUnchainedPackage
Creates and adds a new unchained package using the specified package source path.

NewPredefinedPackage (string aPackageName, bool aDownloadFromUrlOnInstall)
This methid adds a predefined package.
If aDownloadFromUrlOnInstall is false, the package is included directly in the project.
If aDownloadFromUrlOnInstall is true, the package will be downloaded from a URL during installation.

Example

      $projPath = "D:\MyJob\tests\builds\prerequisites.aip"

$advinst = new-object -comObject "AdvancedInstaller"
$proj    = $advinst.CreateProject($advinst.ProjectTypes.Architect)

# add chained package
$chained_prereq = $proj.PrerequisitesComponent.NewChainedPackage("$currentPath\resources\resources-powershell\Prerequisites\Feature-based Prereq1.msi")

# edit the chained package
$chained_prereq.Folder                 = "Test Folder Chain"
$chained_prereq.InstallUiLevel         = "Basic"
$chained_prereq.InstallProperties      = "TEST_PROP"
$chained_prereq.MaintenanceProperties  = "TEST_MAINT"
$chained_prereq.UninstallUiLevel       = "Silent"
$chained_prereq.UninstallProperties    = "TEST_UNINSTALL"
$chained_prereq.EnableLogging          = $true
$chained_prereq.RollbackProductsOnFail = $true

# add feature-based prereq
$feat_based_prereq = $proj.PrerequisitesComponent.NewUnchainedPackage("$currentPath\resources\resources-powershell\Prerequisites\Feature-based Prereq2.msi")

# edit the feature-based prereq
$feat_based_prereq.InstallCondition       = "Not Installed"
$feat_based_prereq.InstallCmdLineFullUi   = "/qn"
$feat_based_prereq.InstallCmdLineBasicUi  = "/qn TEST=`"basic install`""
$feat_based_prereq.InstallCmdLineSilentUi = "/qn TEST=`"silent install`""

$feat_based_prereq.AllowUninstall         = $true
$feat_based_prereq.UninstallCmdLine       = "/x {5FF4B3E3-CC54-4CCA-A2C4-8BC1E91B90A3}"
$feat_based_prereq.UninstallCondition     = "NOT TEST_UNINSTALL"

$feat_based_prereq.AllowMaintenance       = $true
$feat_based_prereq.MaintenanceCmdLine     = "/fomus {5FF4B3E3-CC54-4CCA-A2C4-8BC1E91B90A3}"
$feat_based_prereq.MaintenanceCondition   = "NOT TEST_MAINT"

$feat_based_prereq.AllowRollback          = $true
$feat_based_prereq.RollbackCmdLine        = "/rollback -test"
$feat_based_prereq.RollbackCondition      = "NOT TEST_ROLLBACK"

$feat_based_prereq.EnableLogging          = $true

# save the project
$proj.SaveAS($projPath)

#load the project
$projLoad = $advinst.LoadProject($projPath)

$chained_prereq_load    = $projload.PrerequisitesComponent.ChainedPackages | ? { $_.Name -eq "Feature-based Prereq1"}
$feat_based_prereq_load = $projLoad.PrerequisitesComponent.UnchainedPackages | ? {$_.Name -eq "Feature-based Prereq2"}

    

See also

IUnchainedPackage

IChainedPackage

Topics