Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to check if the application is running for the first time after being installed.
Posted
Comments
Tejas Vaishnav 29-Sep-12 6:13am    
you tagged C# and ASP.NET the it means it's web application, so web application is hosted not installed. setup or installation is related to desktop application.

1 solution

Hi,

There are different ways you can do it,

When your application runs, you can look up for a specific registry key ( keep key name such as it stays unique). If the key is not found then your application is running for the first time. Do the things you want to do for the first run and create above key in registry. So in next run, you will find the key and take action accordingly.

Also you may create a flag either in a database table or as a text file in your bin folder when your application runs for the first time.
On each run you can check for the flag and if not found then it is first run and then create the flag and if flag already exists then simply take action accordingly.

Hope this gives you some idea about your requirement.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900