ipollock
Posts: 137
Joined: Wed Aug 31, 2016 10:46 am

Folder and contents being deleted at Uninstall

I have a web applications install which has been in use for some time Advanced Installer 12.7.2 (Which will be updated soon)
We have a new problem where one of the folders containing deployed files (by the installer) and a file called CustomerSettings.xml
all reside. During the uninstall i would expect the folder to be emptied except for the CustomerSettings.xml.
The reason is that this wasn't registered as part of the install and should be left behind after uninstall along with its supporting folder structure.
Unfortunately it is all being removed.

Please could you help.
Thanks in advance.
Ian
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Folder and contents being deleted at Uninstall

Hello Ian,

Please make sure the folder where the XML file resides does not have the uninstall cleanup on it (should be visible by a red "X" mark).
Screenshot_62.png
Screenshot_62.png (5.52 KiB) Viewed 10556 times
If that is selected, then the folder will be removed regardless of the file being there.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ipollock
Posts: 137
Joined: Wed Aug 31, 2016 10:46 am

Re: Folder and contents being deleted at Uninstall

That's right, uninstall cleanup is not activated for this folder.
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Folder and contents being deleted at Uninstall

Hello Ian,

I am not quite sure if the issue is resolved on your side.

If not, please forward me the following resources:

- a copy if the AIP file

- a download link for the setup

- a test-case (e.g. which file should I be looking for, what are the steps to reproduce this)

by email at support at advancedinstaller dot com so i can further investigate this on my end.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ipollock
Posts: 137
Joined: Wed Aug 31, 2016 10:46 am

Re: Folder and contents being deleted at Uninstall

It's not resolved yet Catalin. I'm unable to share the aip and install file due to it's business rules.

I guess i could try to be clearer:

The installer does the install and produce a number of folders (such as Folder1, Folder2, Folder 3 and Folder 4) with files inside that support our application. Two of the four folders has a "\Customisation folder" inside it too with a 'CustomerSettings.xml' file either present or added in after the install.
Two of the folders does not have a "\Customisation folder" so the 'CustomerSettings.xml' is manully put into say "\Folder3" base and there is not one
in "Folder4"

During uninstall, all of the contents of "Folder1" and "Folder2" are removed except the sub folder "CustomerSettings" and it's 'CustomerSettings.xml' file. Folder4 is removed with all of it's contents and so is Folder3 (which is the problem). I would have expected everything except the 'CustomerSettings.xml' to have been removed at uninstall.

There are no special conditions on any of the folders.

Best regards,
Ian
ipollock
Posts: 137
Joined: Wed Aug 31, 2016 10:46 am

Re: Folder and contents being deleted at Uninstall

I have also made a simple model using a similar method and the model works ok.
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Folder and contents being deleted at Uninstall

Hello Ian,

I'm afraid I will not be able to correctly assist without being able to reproduce this on my end as well.

I do understand your scenario now and I've tried to reproduce it on my end as well, but with no success.

If the XML file and its' parent folder were added to Folder3 after the installation, then indeed the Folder3\ParentFolder\file.xml should not be removed during uninstall unless specifically being told so.

The only thing I can think of is perhaps a cleanup custom action that removes that folder and all of its' content.

Could you please perhaps try again to create a sample that reproduces this? If we are able to do so, I would gladly further assist you here with the testing and investigation.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ipollock
Posts: 137
Joined: Wed Aug 31, 2016 10:46 am

Re: Folder and contents being deleted at Uninstall

That's ok, i found the problem a couple of days ago. It was specifically to do with a Custom action running at Uninstall time.
Based on Powershell - example below. This has been disabled and the uninstall is working normally and leaving new custom files alone now. :)
Thanks for your help.

# Get APPDIR from AI and store
$InstPath = AI_GetMsiProperty APPDIR

# Set up variables for file tranfer
$Capture = Join-Path -Path $InstPath -ChildPath "Capture"

Remove-Item -LiteralPath $Capture -Force -Recurse
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Folder and contents being deleted at Uninstall

Hello Ian,

Perfect!

I was suspecting it was a custom action, but since I wasn't able to investigate the project, I couldn't be 100% sure. :)

Thank you for your followup on this!

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

Return to “Common Problems”