velja
Posts: 45
Joined: Tue May 14, 2013 12:01 pm

Directory remove operation not deleting directory

Mon Aug 05, 2019 1:32 pm

My setup project creates certain directory under user app data dir.
I added MessageBox custom action, which asks user if he wants to keep or delete settings and projects, which are stored in the mentioned directory.
Output property of this message box custom action is REMOVE_SETTINGS and clicking Yes button sets it to IDYES. I know this because I added another MessageBox custom action just to show the value of this property.
Under Operations Tab for the mentioned directory, I checked remove folder. Condition is REMOVE_SETTINGS = IDYES, Always remove folder, I selected component which is always installed / uninstalled, and selected Remove on: Component Uninstall.
Directory is never deleted.

I sent the project file for another ticket I have open on the forum.

Thanks.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Directory remove operation not deleting directory

Thu Aug 08, 2019 2:23 pm

Hello Velja,

I tested the behavior but I cannot replicate the behavior.

Could you please also forward us by email a download link to your built setup package, a verbose log of the uninstall process and the full folder path of such a folder not being removed on uninstall?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

velja
Posts: 45
Joined: Tue May 14, 2013 12:01 pm

Re: Directory remove operation not deleting directory

Thu Aug 08, 2019 3:21 pm

Thanks,

Setup package is is sent. Let me know if I can assist further.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Directory remove operation not deleting directory

Wed Aug 14, 2019 10:29 am

Hello Velja,

I apologize for the delayed reply.

I have tested and replicated the behavior you related. This seems to happen just because of the condition you have used:

Code: Select all

REMOVE_SETTINGS = IDYES
Please note that when you click on [Yes] button of your message box custom action the "IDYES" string is set as the value of your "REMOVE_SETTINGS" property. However since this is a string value you should update the condition of your folder remove operation to the following expression:

Code: Select all

REMOVE_SETTINGS = "IDYES"
otherwise the IDYES will be interpreted as a property reference and since this property does not exist it will be resolved to empty value thus your condition will be always false.

So, could you please update your folder remove operation condition to the following expression

Code: Select all

REMOVE_SETTINGS = "IDYES"
and see how this goes?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

velja
Posts: 45
Joined: Tue May 14, 2013 12:01 pm

Re: Directory remove operation not deleting directory

Thu Sep 05, 2019 10:04 am

That worked. Thanks.

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

Re: Directory remove operation not deleting directory

Thu Sep 05, 2019 10:42 am

Hello Velja,

Thank you for your followup on this.

We are glad you got this working.

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

Return to “Common Problems”