aenglish
Flexera beginner

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
aenglish
Flexera beginner

Thanks.

Indirectly we found another solution to our problem which stops the folder being created along side our Installation directory in the first place, therefore I don't need to worry about removing it at all.

https://docs.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.winforms.corewebview2creationprop...

https://docs.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.winforms.corewebview2creationprop...

Thanks for you help

View solution in original post

0 Kudos
2 Replies
varul
Revenera
Revenera

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/Langr...

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-uninstal...

 

0 Kudos
aenglish
Flexera beginner

Thanks.

Indirectly we found another solution to our problem which stops the folder being created along side our Installation directory in the first place, therefore I don't need to worry about removing it at all.

https://docs.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.winforms.corewebview2creationprop...

https://docs.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.winforms.corewebview2creationprop...

Thanks for you help

View solution in original post

0 Kudos