MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Uninstall does not delete file created by application

Hello,

I have an application that create a file (AgentUser.bin) in a directory.
The file is NOT installed by the installer
The file must be removed at the application uninstall time and have specified in a custom action that file should be uninstalled.

However, the file is left in the directory when the uninstaller is finished.

NOTE: I have also set the directory in which this file resides to be removed, but it is not removed either.

Is there a way to make this work?

Thanks
Mike
Attachments
Folder to be removed properties
Folder to be removed properties
AgentFolderRemoveProperties.PNG (66.74 KiB) Viewed 10470 times
File to be removed properties
File to be removed properties
AgentUser_bin_Uninstall.PNG (52.56 KiB) Viewed 10470 times
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Uninstall does not delete file created by application

Here is a complete aip file with an executable in it that will reproduce the problem.

Here are the steps to reproduce:

Build the setup
Run the setup
Run the application
Check directories / files exist on your drive

C:\ProgramData\CompanyA\App\1\A : AgentSettings.xml
C:\Users\<yourNameHere>\Documents\CompanyA\App\1\A : AgentUser.Bin

Run the uninstaller
Check the above directories again.
Attachments
Tester.zip
Complete aip setup that reproduces problem
(9.76 KiB) Downloaded 368 times
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Uninstall does not delete file created by application

Hi Mike,

Your files are not removed because you try to remove them from a different path than they are actually created.

As you mentioned, your application creates the files to the following paths:
C:\ProgramData\CompanyA\App\1\A : AgentSettings.xml
C:\Users\<yourNameHere>\Documents\CompanyA\App\1\A : AgentUser.Bin


But if you want to use properties in your project to construct those paths, you need to use a vertical bar "|" in the name of your properties (i.e. [|Manufacturer]). This is because the files and folders names support only PseudoFormatted data types.

Also, I noticed that the product name of your installer is set to "App" in the "Product Details" page, but your application creates the files in the "A" folder, so you should set the product name accordingly.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Uninstall does not delete file created by application

Hey thank you for catching that... I have made the adjustments...but now the entire folder structure disappears.

Under the Common Application Data folder, I create 4 folders and in the last one [|ProductName] I have a file that is removed upon uninstall "AgentSettings.xml"

When I install the application, the file is NOT present. But when I run the application, the file gets generated. Then when I uninstall the application, the entire folder structure under Common Application Data gets removed.

I have attached the project for your inspection.
Attachments
Tester.zip
Folders get deleted aip project
(9.75 KiB) Downloaded 362 times
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Uninstall does not delete file created by application

Here are the settings I am currently trying (and uninstall does NOT remove files )

Folder:
Remove_Folder.PNG
Remove_Folder.PNG (24.18 KiB) Viewed 10451 times
File:
Remove_File.PNG
Remove_File.PNG (16.35 KiB) Viewed 10451 times
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Uninstall does not delete file created by application

Hi Mike,

On the first hand, you only need the "File Removal" operation if you want to remove that file, the "Remove folder" option is not needed anymore.

On the other hand, I see that you have the "AI_CLEAN_RESOURCES_UNINSTALL = 1" condition set for these operations which means that this property should be set to "1" during the uninstallation, but I didn't find it on any of your dialogs. Anyway, you can remove that condition without any problem and the file should be removed as expected.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Uninstall does not delete file created by application

Thank you ... removing the condition, fixed the issue.

thanks
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Uninstall does not delete file created by application

You're welcome Mike. I'm glad you got this working.

Just let us know anytime you need help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Parimal Patel
Posts: 25
Joined: Wed Jun 01, 2016 3:16 am

Re: Uninstall does not delete file created by application

I have same issue using Advanced installer 13.0. i have setup folder remove option using Uninstall Cleanup, Saving project throw error because of component property or field is empty. What is Component property on folder operation. Also by selecting anything from Component drop-down doesn't remove folder on UnInstall.
Remove_1.png
Remove_1.png (26.91 KiB) Viewed 10385 times
Remove_2.png
Remove_2.png (27.61 KiB) Viewed 10385 times
Thanks,
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Uninstall does not delete file created by application

Hi Parimal,

The "Component" combobox specifies the component that will be related to the folder removal operation. So, that operation will be performed only when that component will be uninstalled from the machine. That combobox should always be set by default to a random component (unless you manually choose a specific component).

Can you reproduce the problem in a new project? If so, can you please give us a detailed step by step test case scenario so we can try to reproduce the behavior?

Also, I'm not sure why that folder is not removed on uninstall after you chose a component. Are you sure that the condition is true during the uninstall? If so, can you please send us the .AIP (project file) and a verbose log of the uninstallation to support at advancedinstaller dot com, so we can investigate them?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”