Click here to Skip to main content
12,296,307 members (64,007 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
how to check if the application is running for the first time after being installed.
Posted 28-Sep-12 23:51pm
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

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 29 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100