I have an application that on its "First Run" checks the registry for a FirstRun (boolean) value and also checks a database for the existance of a SysAdmin user account in the users table.
If neither of these two exist, the user is prompted to create a sysadmin (userId & password) account, before the application will run. The new user account is stored in the users table with a user type of "SysAdmin". I allow two other user types (Admin, User), each with their own specific roles. Only one SysAdmin account can be created and its created at "First Run". If the SysAdmin account is sussfully created at first run then the registry value FirstRun is created in the registry and set as true.
Once a user of type SysAdmin is logged into the system, they can later change the password via the System Administration Panel.
If either the FirstRun registry value or the SysAdmin user account DO NOT exist, then the application terminates, and the FirstRun value in database is never created (does not exist).
Question 1: Do I really need the First Run value in the database, Im thinking that i just need to check the existence of the SysAdmin user account in the users table.
Question 2: Would you implement it in a different manner? If so, how?