![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Gamemap |
I want to write a program that first uninstalls another program and then deletes itself with its parent folder.
Is this possible? Is it only possible to transfer it to the %TEMP% folder?
Why wouldn’t it be possible? But I’m not sure why this is a Godot-specific question, especially since you can bundle a Godot game as a single executable that doesn’t actually need any kind of installation besides dropping it somewhere into the filesystem. Uninstalling the game then consists of deleting the file.
archeron | 2021-03-26 08:07
I want a programm that deletes my game and then itself, but this code won’t work.
Directory.remove(str(OS.get_executable_path().get_base_dir()))
(deleting the DeleteProgramm)
Gamemap | 2021-03-26 09:18
What error do you get from Directory.remove? And what version of Godot are you running it on? This is important because the behaviour of Directory.remove was changed several times in 3.2, and depending on which version you use, it works a bit differently.
archeron | 2021-03-26 12:46
Godot Version: 3.2.4 RC3
Error: 1 (Generic error)
I did not know that the folder must be empty. Unfortunately I can only delete the pck, not the exe file of my delete program (which is currently running).
Gamemap | 2021-03-26 17:04