Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete self while running

Im currently creating a uninstallation application which deletes the application folder. The problem is that i cant delete the uninstaller application which is in the same folder cause its running. Is there a way to delete the application while running, so its just in the memory.

        string Installation = UninstallRegister.Read("InstallationLocation");
        if (Directory.Exists(StartMenu))
        {
            Directory.Delete(StartMenu, true);
        }

Best regards

like image 261
BlackVoid Avatar asked Jul 09 '26 21:07

BlackVoid


1 Answers

A simple idea would be to copy the uninstall application to %TEMP% and run from there. This would however leave a file in %TEMP% (which would probably not be noticed by anyone).

like image 161
Vlad Avatar answered Jul 11 '26 13:07

Vlad