Custom Actions
$CustomActions = @(
New-InstallerCustomAction -FileId "ConfigureScript" `
-RunOnInstall `
-CheckReturnValue `
-Arguments "-NoProfile -ExecutionPolicy Bypass" `
-ScriptArguments "-Mode Install"
)
New-Installer -ProductName "My App" `
-UpgradeCode "66ad7f2c-e176-4a91-b73b-5dced490ec67" `
-OutputDirectory ".\output" `
-CustomAction $CustomActions `
-Content {
New-InstallerDirectory -PredefinedDirectoryName "ProgramFilesFolder" -Content {
New-InstallerDirectory -DirectoryName "My App" -Content {
New-InstallerFile -Source ".\MyApp.exe" -Id "MyAppExe"
New-InstallerFile -Source ".\Configure.ps1" -Id "ConfigureScript"
}
}
} `
-RequiresElevationLast updated