bNobo / needabreak

NEED A BREAK! is an application intended to help you take care of your health while you work on a computer.
GNU General Public License v3.0
8 stars 5 forks source link

Automatically check "Run at startup" on first start #20

Closed bNobo closed 4 years ago

bNobo commented 4 years ago

This application is intended to constantly run in the background, it won't if it is not at least launched :)

bNobo commented 4 years ago

In order to check if the application has already been launch, I see 3 options :

1) Store a value somewhere at the end of startup and check for its existence at the beginning of startup. It the value does not exists then it means first start and "run at start" should be checked automatically. The value could be stored in a file or in windows registry. 2) Use ApplicationDeployment.IsFirstRun Property to check whether application has already been launched or not. Check documentation here 3) Similar to solution 1) but use user's Properties.Settings instead of custom storage.

Solution 1

Pros 👍

bNobo commented 4 years ago

I think the more appropriate is solution 3)

I have created a new branch to implement this fix

bNobo commented 4 years ago

I have made a very simple implementation which just check "run on startup" on first run without any other verification. The menu item will be checked no matter whether it is really a first installation or an update. So an existing installation where "run on startup" is not checked will have the menu item checked after update. I'm not sure it's really an issue because currently there are very little users who have installed the application. Moreover, I consider "run on startup" REALLY should be checked for a better user experience.