Reputation: 30915
i have Qt c++ app that on each start is checking if there is new executable update file and if there is it downloading it, the problem is how can i change the name of the old executble to for example : foo_tmp.exe and the new executable to : foo.exe or in runtime or on closing or on start something
Upvotes: 0
Views: 205
Reputation: 2713
QFile::rename
is a static method that will allow you to rename a file.
However renaming the currently running executable file will cause you issues. As the file is in use by the operating system you will either be prevented from doing this, cause undefined behaviour or it will simply not work. You should most likely have a launcher application that checks for updates to the main application before starting it.
Upvotes: 1