Standard Path locations, and loacations to save app generated data
-
I created an application it works great, i used
Inno setup compiler
to create a setup for it, it installs as well. now the app has an update mechanism, it downloads apatch.zip
and 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 inC:\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 calledQStandardPaths
bt how do i use it?
Thanks in advance. :) -
Hi,
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 ?
-
-
You could use the temp directory for patch files - after update they are not needed anymore.