Im trying to get my application to start one the user logs on to his or hers account.
My current code:
#ifdef Q_OS_WIN
QSettings bootUpSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat);
QString base_dir = qApp->applicationDirPath() + "\\MyApp.exe";
if (autoStartChecked == "true") {
bootUpSettings.setValue("MyApp","\""+base_dir+"\"");
} else {
bootUpSettings.remove("MyApp");
}
#endif
When I look in regedit I can see that my application has added the key with value, but for some reason the application wont auto start when i logon to Windows.
Any ideas?