DonilZ
Posts: 3
Joined: Mon Aug 14, 2023 6:10 pm

Removing files that were not included in the installer

Let's say I compiled the msi installer and installed the program with it. Over time, other folders and files appear in the folder with the installed program that were not in the installation package (let's call them non-installation).
Now I need to build a new installation package with updated files (i.e. in the old installation package I only change a few files and UpdateCode).
By launching a new msi package, all files are first deleted from me, and then new ones are installed (everything is correct, this is how the installer works), BUT non-installation files are also deleted and therefore lost forever.
Please tell me, is it possible to somehow make sure that files that are not in the installation package are not deleted after reinstallation? It is necessary to do this with the installation package, the option with PATCHES does NOT interest me
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Removing files that were not included in the installer

Hello and welcome to our forums,

The default behavior should be the exact opposite.

A setup package can only remove the files that it initially installed - outside files should be left there.

This is the reason why we have added the "Uninstall Cleanup" option. This basically ensures a folder is removed even if it contains files from outside the installation package.
Screenshot_40.png
Screenshot_40.png (24.18 KiB) Viewed 5354 times

You can differentiate a folder that has the cleanup active by the "X" mark:
Screenshot_41.png
Screenshot_41.png (4.25 KiB) Viewed 5354 times

Have you enabled this in your project?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
DonilZ
Posts: 3
Joined: Mon Aug 14, 2023 6:10 pm

Re: Removing files that were not included in the installer

Hello, Catalin.
Thanks for your reply!

I never used "Uninstall Cleanup" and I don't have any folders that are marked with a "red X".

Also in all folders I have non-checked Properties -> Operations -> Remove folder.

However, all the same, when I run the installer with a different ProductCode and same UpgradeCode (that is, during an upgrade), absolutely all files are deleted, including those that were not included in the project.
DonilZ
Posts: 3
Joined: Mon Aug 14, 2023 6:10 pm

Re: Removing files that were not included in the installer

I would also like to add that during normal deletion everything works as it should, files that were not in the installer are not deleted. But when upgrading - the result is wrong
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Removing files that were not included in the installer

Hello,

Something must be off here, as this behavior is not normal.

I'm saying this because an upgrade basically consists of:

- the uninstall of the previous version (just like a normal uninstall)

- the install of the newer version

So basically upgrading would just uninstall the previous version just like you'd normally uninstall it from Control Panel.

The only thing here that I can think of right now is perhaps some custom behavior you or someone included in your project - e.g. a Custom Action that cleans up everything during an Upgrade.

If that's not the case, could you please forward me a sample AIP file which I can use in order to reproduce this, together with a step-by-step test case? You can do so by email at support at advancedinstaller dot com.

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

Return to “Building Installers”