GithubHelp home page GithubHelp logo

Comments (3)

bNobo avatar bNobo commented on September 25, 2024

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 ๐Ÿ‘

  • 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.

bNobo avatar bNobo commented on September 25, 2024

I think the more appropriate is solution 3)

I have created a new branch to implement this fix

from needabreak.

bNobo avatar bNobo commented on September 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.