Custom Application Installer using .NET

  • Thread starter Thread starter ShujaARizvi
  • Start date Start date
S

ShujaARizvi

Guest
Hi All,



Hope you're having a great day. I created a custom installer for my application through .NET WinForms, and quite recently had to embed an uninstaller in the same installer as well. So the flow goes like:



  • The installer runs and checks for the installed application.
  • If the application is present, it asks the user to uninstall the previous version before installing the newer version.
  • If the application is not present, the wizard takes user to the installation screen.

My application, along with other sub apps, also has a windows service that runs in the background. So when I uninstall the application, I do the following:



  1. I find and uninstall the background Windows Service.
  2. I delete all the registry entries.
  3. Finally I uninstall all the application files present in the installation directory.

The issue I am facing begins at step 3. Since the Windows Service is not fully uninstalled without computer restart, rather it is only marked for deletion, I am unable to completely wipe out the app installation directory, and some files remain there. After the restart, I have to manually go and delete all those files. Can anybody help me on how to proceed with this and solve my issue?



Possible ways of doing this in my mind are:



  1. The uninstaller somehow completely uninstalls the service without a restart, so I am able to wipe the installation directory fully.
  2. I configure a sort of a one time event in windows that triggers after the restart and automatically deletes the remaining files from installation directory.

Kindly guide me on how to proceed with this. Your help would be highly appreciated. Thanks & Regards.



PS: I've made a custom installer because it has to have a custom theme, and it needs to download files from internet, and could require further enhancements down the road.

Continue reading...
 
Back
Top