Hello Brian,
You can achieve this using our
PowerShell automation support.
For example, the script below marks all file components from the "Common" folder as permanent:
Code: Select all
$advinst = New-Object -ComObject AdvancedInstaller
$project = $advinst.LoadProject("C:\Your Application.aip")
function Set-FilesPermanentRecursively($folder) {
# Process files in the current folder
foreach ($file in $folder.Files) {
$component = $file.Component
$component.Permanent = 1
}
# Recurse into subfolders
foreach ($subfolder in $folder.Folders) {
Set-FilesPermanentRecursively $subfolder
}
}
# Get the "Common" folder
$selectedFolder = $project.FoldersComponent.Folders | Where-Object { $_.Name -eq "Common" } | Select-Object -First 1
# Run the recursive function
if ($selectedFolder -ne $null) {
Set-FilesPermanentRecursively $selectedFolder
} else {
Write-Host "Common folder not found."
}
$project.Save()
Please make sure to update the project path and folder name according to your project.
Hope this helps! Let us know if you have any questions.
Best regards,
Liviu
FOLLOW US
Get the latest news in Application Packaging