Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Write an inaccessible registry
twovrcmr last edited by twovrcmr
Hi everyone, I am from Taiwan.
I am trying to write a registry which my application doesn't have write permission.
My application runs under User's account and that registry is read-only for the user.
Here are snippets of my codes:
// write a registry on windows QSettings settings("HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\kkbox", QSettings::NativeFormat); settings.setValue("kkSerial", serialNum); //always fails
I don't find any Qsetting constructor could meet my requirement.
just think about it: wouldn't the whole access protection mechanism be pointless when you could write it anyway?!?!
You can try to run the application with admin privileges, but thats not an option anyway in your case i guess.
Jagh last edited by
@raven-worx what I think he is asking here, is how to request permissions from UAC to do this operation.
Like you know, some other programs that show you "this program requires administrator privileges" window at the start.
I guess the permissions needed are encoded in the .exe metadata, but I'm quite interested to learn the details myself
HojjatJafary last edited by HojjatJafary
This is how you can run your whole application as admin:
run as admin