andrii_tk
Posts: 9
Joined: Tue Mar 19, 2024 2:52 pm

Missing libraries after update

Hello,

I have a problem when updating my app:
- v4.3.3.1146 (first install): worked fine.
- Update to v4.4.0.1156: some libraries are missing, especially essential RabbitMQ.Client.dll.

Both installers were built via CI on Jenkins, using the “Synchronize” feature. We don’t run manual sync each time; CI collects files and builds the project automatically.

I checked this article: https://www.advancedinstaller.com/user- ... uestion380

It suggests enabling “Always overwrite existing files.”
- Enabling it for the whole folder fixes the issue.
- But I also have files that should not be overwritten, and setting it at folder level blocks me from controlling behavior per file. So this feature is not helpful.

I understood what happened: one library was downgraded, which caused RabbitMQ.Client.dll to also be downgraded. However, I don’t understand why a downgrade leads to missing files — I would expect files to be always overwritten by default, regardless of version, as downgrades of libs may be intentional in future. Could you please help me find a reliable solution?

Log:
MSI (s) (14:A0) [08:13:36:844]: Executing op: ComponentRegister(ComponentId={F702FDE4-DD1B-4A17-A155-D74EBC9C2FE4},KeyPath=C:\Program Files (x86)\AnonCompanyName\AnonProductNameCore\RabbitMQ.Client.dll,State=3,,Disk=1,SharedDllRefCount=0,BinaryType=0)
...
MSI (c) (2C:BC) [08:10:14:968]: Disallowing installation of component: {F702FDE4-DD1B-4A17-A155-D74EBC9C2FE4} since the same component with higher versioned keyfile exists
MSI (c) (2C:BC) [08:10:15:336]: Disallowing installation of component: {998FD154-0513-443B-99FE-F12BC1C09886} since the same component with higher versioned keyfile exists
...
(Full installation log and AIP file was sent to support by email to support@advancedinstaller.com)

Environment:
- Advanced Installer: 20.9.1
- OS: Windows 10 / 11
- Project type: EXE installer (elevated permissions)

Thanks in advance!
Eusebiu
Posts: 4964
Joined: Wed Nov 14, 2012 2:04 pm

Re: Missing libraries after update

Hi,

I'm afraid that this is an old Windows Installer bug that has never been fixed as mentioned in the "Why do one or more files disappear after an upgrade is performed" FAQ that talks about the same issue.

This problem appears only when a file's version is decreased in the newer version of the package. This appears because Windows Installers sees that the file present on the machine has a higher version than the one from the package and wrongly sets a flag that the file from the package would not be installed anymore. Hence, the easiest workaround is to use the "Always overwrite existing file" option.

However, please note that you do not have to set that option on the entire folder, you can just set it on the problematic file. Do you encounter any issues if you set the option only on your missing libraries?

Best regarsd,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
andrii_tk
Posts: 9
Joined: Tue Mar 19, 2024 2:52 pm

Re: Missing libraries after update

Hi Eusebiu,

Thank you for quick response.

We are using the Synchronize feature, which automatically selects the files to be installed. Your proposal makes sense and would help in this specific case, but what we are looking for is a sustainable solution.

We don’t want to manually check before each release which DLLs might have been downgraded and then mark them individually with “Always overwrite existing file.” Ideally, we’d like to configure this once and not worry about it again.

That’s why I initially thought enabling “Always overwrite existing file” at the folder level would be best. However, this also changes the behavior for files that we already configured manually with “Do not overwrite existing file.”

Is there a way to apply “Always overwrite existing file” only to synchronized files, or at the folder level without overriding existing per-file settings?

Thanks,
Andrii
Eusebiu
Posts: 4964
Joined: Wed Nov 14, 2012 2:04 pm

Re: Missing libraries after update

Hi Andrii,

Indeed, your scenario is not that simple. The easiest solution that I can think of is to set the "Always overwrite existing files" option for the folder first, then select the "Do not overwrite existing file" for each file that you do not want to overwrite. This way the later option will be kept for the files that you do not want to overwrite while all other files will be overwritten.

Let me know if this helps.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
andrii_tk
Posts: 9
Joined: Tue Mar 19, 2024 2:52 pm

Re: Missing libraries after update

Hi Eusebiu,

Sorry for the long delay.

I tested the approach you suggested, but it doesn’t work in my setup. When I enable “Always overwrite existing files” on the parent folder, the files that shouldn’t be overwritten inherit that state as well. After I manually restore their original settings, the folder option becomes unchecked again because the files are no longer consistent.

The real issue is that our CD system generates the installer using the Sync Folder feature. After each sync, any newly added files lose the Always overwrite existing files flag, which breaks the behavior I need.

To work around this, I added a PowerShell step that explicitly assigns a Version tag to every file in the project except the config files.

Here’s the script I’m using:

Code: Select all

function Update-MsiFileVersions {
    param(
        [xml]$xml,
        [string[]]$excludeFiles
    )

    $fileComponent = $xml.DOCUMENT.COMPONENT | Where-Object { $_.cid -eq "caphyon.advinst.msicomp.MsiFilesComponent" }

    if ($null -eq $fileComponent) {
        throw "Could not find MsiFilesComponent in the project file."
    }

    $updated = 0
    $skipped = 0

    foreach ($row in $fileComponent.ROW) {
        $fileName = $row.GetAttribute("FileName")

        # Check for skip conditions: ends with "|<pattern>", pipe is required
        $matched = $excludeFiles | Where-Object { $fileName -like "*|$($_)" }

        if ($matched) {
            Write-Host "Skipped: $fileName (matched pattern '|$matched')"
            $skipped++
            continue
        }

        $row.SetAttribute("Version", "65535.65535.65535.65535")
        $updated++
    }

    Write-Host "Updated $updated files to Version 65535.65535.65535.65535"
    Write-Host "Skipped  $skipped files based on exclusion rules"
}


$advinst = New-Object -ComObject AdvancedInstaller
$proj = $advinst.LoadProject($aip)
$proj.DigitalSignature.EnableSigning = $true
$proj.ProductDetails.Version = $version # new product code is created automatically
$proj.BuildComponent.SelectedBuild.OutputFolder = $out_dir
$proj.Save() # file sync happens here
Write-Host "Updated properties and saved AIP"

# prepare signing, custom AIP file manipulations, because neither AI CLI nor AI ComObject provide commands to edit those properties
[xml]$xml = Get-Content -Path $aip
Write-Host "Loaded AIP XML from $aip"

Update-MsiFileVersions -xml $xml -excludeFiles @(
    "config.json",
    "logging.json"
)

$xml.Save($aip)
Write-Host "Updated properties manually and saved AIP"

& $aiPath /rebuild $aip
Do you see any issues with this approach, or is there a more reliable way to achieve consistent overwrite behavior when using Sync Folder?
Eusebiu
Posts: 4964
Joined: Wed Nov 14, 2012 2:04 pm

Re: Missing libraries after update

Hi Andrii,

Sorry for my late reply.

Actually, setting a version tag for all the files in the folder is what our "Always overwrite existing files" option do. But since that option sets the version on all the files, you can use your script to set it only on the files you want and that should work as expected. I see no problem with that.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
andrii_tk
Posts: 9
Joined: Tue Mar 19, 2024 2:52 pm

Re: Missing libraries after update

Hi Eusebiu,

Thanks for the clarification - that answers my question perfectly.
Appreciate your help.
We can close the topic.

Best regards,
Andrii
Eusebiu
Posts: 4964
Joined: Wed Nov 14, 2012 2:04 pm

Re: Missing libraries after update

You're welcome, Andrii. Glad to assist.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”