Standard Path locations, and loacations to save app generated data
I created an application it works great, i used
Inno setup compilerto create a setup for it, it installs as well. now the app has an update mechanism, it downloads a
patch.zipand unzips it and runs the patches it updates the app, the problem is if i run the app from a custom location ie. any folder which has its executable and all the required DLLs the program downloads these patches into the same directory where the executable resides. bt after installation, these files are created in
C:\Users\Sanchit\AppData\Local\VirtualStore\Program Files (x86)\<APPNAME>\
i don't know how to frame my question bt how do other apps(i mean professional apps) handle this? i know there is something called
QStandardPathsbt how do i use it?
Thanks in advance. :)
Call QStandardPaths::writableLocation with QStandardPaths::AppDataLocation so you'll get the standard folder your application data to be stored.
Hope it helps
Thank you @SGaist for replying. I used QStandardPath::standardLocation and called QstandardPath::AppDataLocation it returned me with C:/Users/username/AppData/Roaming/appname seeing this i updated the inno setup script to create a dir their now program primarily writes to this location, is it ok?
Something is not clear, what is doing the update ? Inno Setup or your own updater ?
@SGaist I use inno setup to make pkges and update patches. thats aside, the app updates itself, my downloading these patches from the server and executing them. So im was looking for the directory to place the downloaded patch files.
You could use the temp directory for patch files - after update they are not needed anymore.