By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,609 Members | 3,812 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,609 IT Pros & Developers. It's quick & easy.

Restrict the installation of .net application to limited times

P: n/a
Hi Techies,

I have created Setup & Deployment project and installing a windows
application from that. Now i want to restrict the user to install my
application only upto 3 times.

After that it should prompt to the user to download again from the
site.

Can anyone guide me in this.

Will registry editor be useful for this..,

Expecting some quick solution

Thanx

Jul 17 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Yes, the registry is an option. I prefer to keep configuration in my
app directory. If you are looking for something other than the
registry and don't want to call a web service or other type of internet
check to test installation count- you can use a file and store it
someplace that it wont be removed from if the software is uninstalled.

There are all kinds of ways you can structure the file- here is just
one idea:

1) create an XML object that writes XML that looks something like this:

.... psuedo xml:

<xml>
<installs maxInstalls="3">
<installDate appVersion="{your app's version
number}">{date}</installDate>
</installs>
</xml>

- when your app runs, it can look for this file in whatever place you
choose to store it (outside the application directory so that if the
user uninstalls the file is still there. maybe the user's temp folder
or someplace you can normally read and write to).

If found, it looks for the number of install attempts and either adds
another childnode to the list (i noted only 1 install in my example) if
not, it creates it and populates it with the first install date and
version number. If the count is greater than what you specify, you
prompt the user for further action.

I would also encrypt the file to make it non-readable to people. There
are numerous easy encryption classes available.

The flaw in this is that if the user figures this out, they can delete
the file and be good to go so I fully agree that this is "security via
obscurity" - but you did ask for something quick...

You can write encrypted strings to the registry too of course, but you
can run into permission issues with the registry depending on the
user's environment so I shy away from this.

Your file does not have to be XML, but XML is easy and convenient for
this purpose.


su***************@gmail.com wrote:
Hi Techies,

I have created Setup & Deployment project and installing a windows
application from that. Now i want to restrict the user to install my
application only upto 3 times.

After that it should prompt to the user to download again from the
site.

Can anyone guide me in this.

Will registry editor be useful for this..,

Expecting some quick solution

Thanx
Jul 18 '06 #2

P: n/a
Thanks for your detailed information. I preferred way of Registry
editor and i got the solution

id******@msn.com wrote:
Yes, the registry is an option. I prefer to keep configuration in my
app directory. If you are looking for something other than the
registry and don't want to call a web service or other type of internet
check to test installation count- you can use a file and store it
someplace that it wont be removed from if the software is uninstalled.

There are all kinds of ways you can structure the file- here is just
one idea:

1) create an XML object that writes XML that looks something like this:

... psuedo xml:

<xml>
<installs maxInstalls="3">
<installDate appVersion="{your app's version
number}">{date}</installDate>
</installs>
</xml>

- when your app runs, it can look for this file in whatever place you
choose to store it (outside the application directory so that if the
user uninstalls the file is still there. maybe the user's temp folder
or someplace you can normally read and write to).

If found, it looks for the number of install attempts and either adds
another childnode to the list (i noted only 1 install in my example) if
not, it creates it and populates it with the first install date and
version number. If the count is greater than what you specify, you
prompt the user for further action.

I would also encrypt the file to make it non-readable to people. There
are numerous easy encryption classes available.

The flaw in this is that if the user figures this out, they can delete
the file and be good to go so I fully agree that this is "security via
obscurity" - but you did ask for something quick...

You can write encrypted strings to the registry too of course, but you
can run into permission issues with the registry depending on the
user's environment so I shy away from this.

Your file does not have to be XML, but XML is easy and convenient for
this purpose.


su***************@gmail.com wrote:
Hi Techies,

I have created Setup & Deployment project and installing a windows
application from that. Now i want to restrict the user to install my
application only upto 3 times.

After that it should prompt to the user to download again from the
site.

Can anyone guide me in this.

Will registry editor be useful for this..,

Expecting some quick solution

Thanx
Jul 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.