We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

RoDeLoPo
Posts: 2
Joined: Mon Sep 07, 2015 5:52 pm

Delete folder only if it has been created by installer?

Hello everyone! I would like to know if it's possible to delete a folder (on uninstall) and its contents only if it has been created by Advance Installer.

I don't want to go into to much detail, as it may be confusing to explain, but basically the folder I want to delete may have already been present in the computer before the installation. If it is not, Advanced Installer creates it.

Therefore, I would like to delete such folder only if Advanced Installer has created it. If it was already present in the computer, the folder should not be removed.

Is this possible?

Thank you!
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Delete folder only if it has been created by installer?

Hello and welcome to Advanced Installer forums,

Please note that during an uninstall, Windows Installer removes only the data registered into the MSI file. All other data created by custom actions, by the installed application or by the user is not registered in the MSI, therefore it will not be removed.

Did you encountered another behaviour?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
RoDeLoPo
Posts: 2
Joined: Mon Sep 07, 2015 5:52 pm

Re: Delete folder only if it has been created by installer?

Yes, that is the behavior I encountered. However, when using Advanced Installer's "Uninstall Cleanup" feature, I am able to uninstall the folder successfully. The problem is that it will remove the folder even if it was already present before the install, which is exactly what I want to avoid. I suppose I would have to use some sort of parameter on Uninstall Cleanup, however I don't know what to use.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Delete folder only if it has been created by installer?

Hi,

Since you don't want to remove the folder if it was already present on the target machine before the installation, then you don't have to use the Uninstall Cleanup feature. The resources added by the .MSI in the related folder will be automatically removed during the uninstall process.

However, if other data created by custom actions, by the installed application or by the user are added there, they will not be removed by the uninstall process since are not registered into the .MSI.

To detect if the folder was already present on the target machine, you can try to create a folder search operation in the Search page. Use the [ New Search Wizard ] toolbar button to set up a new search, following step-by-step directions.

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”