IFinishActions

This interface exposes the Exit dialog's Finish Actions (the "Finish Options" editor page: View Readme / Launch Application / close the wizard automatically) to the Advanced Installer COM automation surface. It is backed directly by the MSI properties the built-in ExitDialog uses, so changes are immediately reflected by the GUI editor and vice versa. It is reached through the dialogs component:

advinst = New-Object -ComObject "AdvancedInstaller"
$proj    = $advinst.CreateProject($advinst.ProjectTypes.Architect)
$finish  = $proj.DialogsComponent.FinishActions

NoteIFinishActions returns $null when the project has no ExitDialog (for example, a merge module / MSM project).

Groups

The interface is organized in two independent option groups, plus a single flag that skips the Exit dialog entirely:

  • Readme group: DisplayReadmeOption, ReadmePath, ReadmeIsHyperlink, ReadmeIsCheckedByDefault.
  • Launch Application group:LaunchAppAfterInstall, ApplicationPath, ApplicationArguments, RunApplicationAsAdmin, LaunchAppCheckedByDefault
  • RunActionsWithoutDisplayingThisDlg - runs the enabled finish action(s) automatically without showing the Exit dialog.

Each group is centered on a path property (ReadmePath / ApplicationPath): setting the path is what makes the group usable, and clearing the path (or disabling the group's main switch) resets every other member of that group back to its default (empty / $false).

Properties

string ApplicationArguments()
Gets or sets the command-line arguments passed to ApplicationPath when it is launched. Can be set independently of the group's enabled state; it is cleared whenever the Launch Application group is cleared.

string ApplicationPath()
Gets or sets the path of the application launched from the Exit dialog. Setting a non-empty path enables the Launch Application group. Setting it to an empty string clears the whole Launch Application group, equivalent to setting LaunchAppAfterInstall to $false.

bool DisplayReadmeOption()
Gets or sets whether the Readme group is enabled. Reads as $true whenever ReadmePath is non-empty. Setting it to $false clears the whole Readme group (ReadmePath, ReadmeIsHyperlink and ReadmeIsCheckedByDefault are all reset). Setting it to $true while ReadmePath is empty raises an error: Set ReadmePath before enabling DisplayReadmeOption.

bool LaunchAppAfterInstall()
Gets or sets whether the Launch Application group is enabled. Reads as $true whenever ApplicationPath is non-empty. Setting it to $false clears the whole Launch Application group (ApplicationPath, ApplicationArguments, RunApplicationAsAdmin and LaunchAppCheckedByDefault are all reset). Setting it to $true while ApplicationPath is empty raises an error: Set ApplicationPath before enabling LaunchAppAfterInstall.

bool LaunchAppCheckedByDefault()
Gets or sets whether the "Launch Application" checkbox is checked by default on the Exit dialog. Setting it to $true before ApplicationPath is set raises an error: Set ApplicationPath before enabling LaunchAppCheckedByDefault.

bool ReadmeIsCheckedByDefault()
Gets or sets whether the "View Readme" checkbox is checked by default on the Exit dialog. Setting it to $true before ReadmePath is set raises an error: Set ReadmePath before enabling ReadmeIsCheckedByDefault.

bool ReadmeIsHyperlink()
Gets or sets whether ReadmePath is treated as a hyperlink instead of a local file. Setting it to $true before ReadmePath is set raises an error: Set ReadmePath before enabling ReadmeIsHyperlink. Setting it to $false only disables the hyperlink behavior; it does not clear ReadmePath.

string ReadmePath()
Gets or sets the path (or URL, when used together with ReadmeIsHyperlink) of the Readme file shown on the Exit dialog. Setting a non-empty path enables the Readme group. Setting it to an empty string clears the whole Readme group, equivalent to setting DisplayReadmeOption to $false.

bool RunActionsWithoutDisplayingThisDlg()
Gets or sets whether the enabled finish action(s) run automatically without showing the Exit dialog to the end user. Setting it to $true while neither ReadmePath nor ApplicationPath is set raises an error: At least one finish action (ReadmePath or ApplicationPath) must be set before enabling RunActionsWithoutDisplayingThisDlg.

bool RunApplicationAsAdmin()
Gets or sets whether the application is launched elevated (as administrator). Setting it to $true before ApplicationPath is set raises an error: Set ApplicationPath before enabling RunApplicationAsAdmin.

Examples

Example 1: Launch the application silently after install, without showing the Exit dialog

$advinst = New-Object -ComObject "AdvancedInstaller"
$proj    = $advinst.LoadProject("C:\Projects\MyApp\MyApp.aip")

$finish = $proj.DialogsComponent.FinishActions
$finish.ApplicationPath = "[APPDIR]MyApp.exe"
$finish.ApplicationArguments = "/silent"
$finish.LaunchAppCheckedByDefault = $true
$finish.RunActionsWithoutDisplayingThisDlg = $true

$proj.Save()

Example 3: Turn off the Launch Application group entirely

$finish = $proj.DialogsComponent.FinishActions
$finish.ApplicationPath = ""   # clears ApplicationArguments, RunApplicationAsAdmin,
                               # LaunchAppCheckedByDefault and LaunchAppAfterInstall too