cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
aenglish
Level 2

Custom Action to Delete a Folder and it's contents that wasn't installed by Installer

Jump to solution

I'm hoping someone might be in a position to help me.
We have recently adopted Microsoft Edge WebView2 in our product.

https://developer.microsoft.com/en-us/microsoft-edge/webview2/

This now creates a Folder within our Product:

C:\Program Files\Company Name\Software\Program.exe.WebView2\EBWebView

However, once we uninstall, this folder is being left behind where there are 281 Files and 140 Folders in this directory. Some of these files have a cache name, so I imagine the names might differ from machine to machine.

I can't used the RemoveFiles functionality as it expects the folder to be empty to be able to remove the folder.

What would be the best way to remove this folder and all it's contents when uninstalling our program?

Labels (1)
0 Kudos
(1) Solution
(2) Replies
varul
Revenera Moderator Revenera Moderator
Revenera Moderator

You can try using customaction to delete this folder and its content,


Please refer our installscript sample code for delete dir which will be helpful

https://docs.revenera.com/installshield22helplib/Subsystems/installshield22langref/helplibrary/LangrefDeleteDir_Example.htm

you need to sequence it in installexec sequence with condition REMOVE=ALL, so that it wil run only on uninstallation.

Please refer below link for customaciton conditions

https://stackoverflow.com/questions/537584/how-to-execute-custom-action-only-in-install-not-uninstall

 

0 Kudos
0 Kudos