[Moved] automatic run



  • hi to everyone
    how can i make my program automarically run when i turn on my pc on windows?



  • What you're asking doesn't really have something to do with Qt, this is a platform specific issue.

    In your case, on Windows, you can put a key on the registry, in a particual location, see "here":http://www.bleepingcomputer.com/tutorials/tutorial44.html



  • put it in in the start up folder. That will be the easiest!
    Eg:
    C:\Users<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup



  • Yes, this is the second solution :)



  • Moved from the "General/Deskopt" to the "Brainstorm" forum, as it's not Qt related.



  • [quote author="Rahul Das" date="1313846692"]put it in in the start up folder. That will be the easiest!
    Eg:
    C:\Users<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup[/quote]

    Yay for fast solutions! And yay for crappy users which decide they'd gladly play around with your setup, and will just delete your shortcut from the startup folder, then call you saying with angry voice "Your application doesn't work!!!! Fix it!!!".

    In my opinion, the best solution for this would be to add it to the registry. End users doesn't know how to use RegEdit and even if they know, it's not likely to play with it too much :P

    QSettings with native format ftw :P

    P.S.: Haven't tested myself if QSettings works for Windows\CurrentVersion\Run and alike registers, actually I am linux developer, developing apps for windows and linux and don't want to be bothered with windows registry, but from what I've read about QSettings, it should work.



  • Not sure about that. I think it is a bonus if a user can easily modify behaviour like this. On the other hand, it is easy to fix a missing entry in the start up folder from the application itself. You can check if it is still there, and offer the user to create it anew if not.

    QSettings can write to any registry key you have write access to.



  • Yeah, agreed, you CAN check and all, but end users tends to forget to tell you they did things like that when you do support for your app (been there, done that :P)

    Oh well, that's two solutions for one thing, I guess kitten will be happy ;-)



  • I meant: checking programatically, from within your application itself.

    OT:
    For users not telling what they are actually doing, we have logging :) Use a logging framework in your application that logs all relevant events (at different levels), input files, etc. so that you can easily reproduce the issues they are reporting. No need for them to tell you what they did, just make them send you their log file :)



  • True, logging framework/implementation would be able to easily do the trick for you. But even then there will be people which will decline deletion of the shortcut, haha.

    So far I wasn't needing such logging in my app, but I might consider getting one, just to have something built for reference ;-)



  • Don't build one before you have given the existing ones a good lookover. No need to reinvent the wheel yet again. Personally, I like the LibQxt one.



  • Yeah, I'll look into it once I decide to use such logging, thanks for the input.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.