Delete a particular folder when we uninstall the WPF application

Prince Kumar Chauhan 20 Reputation points
2023-11-22T16:28:08.08+00:00

Hi,

 I want to delete a  particular folder when an application is uninstalled.

1.I have developed the WPF app in VS2022 with .net 6

2.Also added a "Setup" project to create the installer => The installer works fine

3.Now I want to add the "Uninstall" custom action to the setup project.

4.Now I need to add an "Installer Class" to my main project, but in VS2022 there is no such template as an "installer class".

5.Is there any alternative for it ?

6.Please help me out here to do the same ?

Developer technologies | Windows Presentation Foundation
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

Answer accepted by question author
  1. gekka 13,426 Reputation points MVP Volunteer Moderator
    2023-11-23T10:59:34.0066667+00:00

    Add Net Framework class library project to solution that contains your .Net 6 main project.
    Your main project does not need to reference that class library.

    Custom actions can be referenced by adding the installer class to that class library.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.