Hello @Gandla, Manjunath ,
Thanks for reaching out and providing details of your update flow.
From my research, this issue is likely caused by how Windows Installer (MSI) handles file reference counting in modern Windows 11 builds during a rapid uninstall/reinstall cycle. When the old app is uninstalled, the OS marks the merge module DLLs in System32 for deletion. If your updated MSI starts its "File Costing" phase before the OS finishes physically deleting those files, the installer assumes the DLLs are already present and skips copying them. Once the delayed deletion completes, your app is left without its dependencies.
Additionally, Microsoft has officially deprecated the use of Merge Modules for Visual C++ components precisely because they cause these types of reference-counting issues.
So, I suggest these approaches below:
- App-Local Deployment: Stop installing the DLLs into
System32. Instead, deployVCruntime140.dllandmsvcp140.dlldirectly into your application's installation folder (alongside your.exe). This isolates your app from OS-level changes and completely bypasses MSI reference counting bugs. See Redistributing Visual C++ Files for details. - Use a Bootstrapper/Chainer: If a system-wide install is strictly required, remove the merge modules from your MSI package entirely. Instead, use a bootstrapper (like WiX Burn) to run the official
vc_redist.x64.exe /quietinstaller just before your main MSI runs. - Temporary Workaround: If you must keep your current "uninstall -> install" flow, add a 5-10 second sleep delay in your client code between the uninstallation of the old version and the installation of the new one. This gives the OS time to finish purging the old files.
Hope these approaches help! If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.
Thank you.