Comments (3)
In order to check if the application has already been launch, I see 3 options :
- 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.
- Use ApplicationDeployment.IsFirstRun Property to check whether application has already been launched or not. Check documentation here
- Similar to solution 1) but use user's Properties.Settings instead of custom storage.
Solution 1
Pros ๐
- Total control of the way it is stored and retrieved
- Total control of when it should be reinitialized or not
Cons ๐
- More complicate to implement
- Would leave a file or a registry entry after uninstall. Could be considered a feature : if user reinstall the application its settings would be restored.
Solution 2
Pros ๐
- Very simple to implement
- The machine would stay clean after uninstall
Cons ๐
- Absolutely no control on it. It is not a problem if it works properly but impossible to investigate if there is a problem
- The checkbox would be automatically rechecked each update because IsFirstRun returns true for the first run of each version.
- ClickOnce dependent. Won't work anymore in case of new setup based on another technology.
Solution 3
Pros ๐
- Very simple to implement
- Total control of when it should be reinitialized or not (provided that AssemblyVersion is never modified and stay 1.0.0.0, because a new settings file is created for each assembly version)
Cons ๐
- Partial control of the way it is stored and retrieved (settings file in user AppData).
- Would leave a file after uninstall. Could be considered a feature : if user reinstall the application their settings would be restored.
from needabreak.
I think the more appropriate is solution 3)
I have created a new branch to implement this fix
from needabreak.
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.
from needabreak.
Related Issues (20)
- Benoรฎt => Benoit
- [BUG] Manual session locking not detected anymore
- Update dependencies and migrate to .NET 8
- Publish wap project to Microsoft Store HOT 1
- Display today's screen time
- Win32Exception when clicking on INRS link
- Run at startup does not work with MSIX package HOT 2
- Store screen time in case of reboot
- The time remaining before session lockout should be reset when the user puts the PC to sleep
- mailto: opens a new webbrowser instead of mailing app HOT 1
- Keep time left when screen is locked for less than five minutes
- Discourage user from selecting "Postpone"
- The popup window should appear only when the user is inactive HOT 2
- Add a settings window HOT 1
- Countdown sometimes start twice [BUG]
- Idle detection can be improved
- [BUG] Counting time left should continue even when NeedABreak is suspended HOT 1
- [BUG] Update not automatically proposed HOT 1
- Replace "suspend mode" by "do not disturb" mode
- [BUG] Time left not reset after screen lock when "do not disturb" mode is active
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from needabreak.