Click here to Skip to main content
11,572,251 members (71,433 online)
Rate this: bad
good
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 at 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


Advertise | Privacy | Mobile
Web04 | 2.8.150624.2 | Last Updated 29 Sep 2012
Copyright © CodeProject, 1999-2015
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