zlchanger@gmail.com
Posts: 2
Joined: Thu Aug 28, 2025 2:54 pm

After packaging the exe installation package, do not delete unknown files during installation

Hi,

I’m struggling to get this to work.

My supervisor has assigned me a task to build an upgrade package that can upgrade the program (ps: this upgrade package only includes some files of the entire project).

In addition, the upgrade package needs to identify the version already installed on the current registration machine during the installation process and compare the version set by the installation package. This logic has been implemented.

But when I only added the files that needed to be upgraded to build the exe, I found that all the other files in the target directory that did not need to be replaced were deleted, leaving only the files built by the upgrade package.

How can I implement this feature by retaining files that do not require updates and not building them into an exe installation package

I’d be really grateful if someone could point me in the right direction, thanks in advance.

Kind regards
Catalin
Posts: 7794
Joined: Wed Jun 13, 2018 7:49 am

Re: After packaging the exe installation package, do not delete unknown files during installation

Hello and welcome to our forums,

An upgrade works like this in the Windows Installer technology:

- the old version is removed entirely

- the new version is installed after that

In your case, since the older version is removed entirely, the files are also gone with it.

The best way of doing this, especially if the previous version was also created with Advanced Installer, is to use that old project to generate a new version instead of creating a new project from scratch.

Doing so, you can ensure that the previous files, although removed, will be readded by the newer version.

Also, if there are some files that you do not want to be removed, you can achieve that by implementing the steps presented here:

Preserve Old Configuration Files During Upgrades in Advanced Installer

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
zlchanger@gmail.com
Posts: 2
Joined: Thu Aug 28, 2025 2:54 pm

Re: After packaging the exe installation package, do not delete unknown files during installation

Hello.

I tried this method, and it still doesn't replace some files during installation. However, it seems to still include files that won't be updated.

I'd like to avoid including the files in the red box (those that won't be updated) in the package, and also avoid deleting the files in the red box in the source directory (those already installed and don't need to be updated) during installation.

Image
Catalin
Posts: 7794
Joined: Wed Jun 13, 2018 7:49 am

Re: After packaging the exe installation package, do not delete unknown files during installation

Hello,

First of all, please note that I can not see the screenshot.

Now, regarding what you want to achieve here, I gave it some more thought and I think it kind of goes against how Windows Installer works.

With that in mind, I'm thinking it would be better to create a custom package (like you initially wanted) that just does what you need, through a custom action or something similar.

Here's what I'm thinking:

1. add the files that you want to be overwritten in the "Files and Folders" page

2. in this new package, do a search and retrieve the installation path for the first package (packages created with Advanced Installer automatically write the installation folder - the "Application Folder" from "Files and Folders" page - to the registry so you can easily retrieve that)

3. set the install path of the new package to be the same as the old package (e.g. using a Set Property)

4. make sure the second package (that is only meant to replace some files) is not registered with Windows Installer so that it does not appear in Control Panel. You can disable this option in "Install Parameters" page.

This way, the files from the newer package should be installed in the same folder, overwritting the old ones.

Please note, however, that this comes with some downsides, one of them being that when you will uninstall the old package, the new files might still remain behind because they weren't installed by the same package.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”