How can I prevent my application from being installed on a specific server?

Hi,

I created a small application.  I am trying to publish it using Visual c# express 2010.
I know how to publish it, but I want to make sure that this application can't be installed on a specific server.  
For example, if a user tries to install this application to the server starts its ip with '19.1.1', I want the warning messeage box to be popped up and will not allow the installation.

Should I do something during the publishing process or code this to my application?

Can anybody please tell me how to do that step by step?
IzzyTwinklyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CodeCruiserCommented:
By publishing, do you mean you are using ClickOnce? You would need to add logic to application startup so that app can be installed but can not be run.
Dave BaldwinFixer of ProblemsCommented:
You probably need to do something in the installer.  But Ford has a lot of networks and the 19.1.1.x may be just public facing IPs and not internal ones.
IzzyTwinklyAuthor Commented:
Hi guys,

In Visual C# 2010 express, if you right click the project file from the Solution Explorer, 'Publish Wizard' is popped up.  I use this 'Publish Wiazrd'.  I don't know if there is better way.
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Gautham JanardhanCommented:
you can put an ip filter for the website / virtual dir you are deploying to which is easier i think. if you are doing it thru code.

if (ApplicationDeployment.IsNetworkDeployed)
            {
                // do check here
            }

Open in new window

Dave BaldwinFixer of ProblemsCommented:
You could put a routine in somewhere to go check "WhatismyIP.com" or some similar site...  That will get you the public IP that server is using.
IzzyTwinklyAuthor Commented:
Thanks guys,

I don't think that it's hard to make the application not to start in a specific server once it's installed.  
What I am trying to do is a little bit different.  I want to make a user can't even 'INSTALL' this application to a specific server.   Can anybody tell me more specific/detailed method for doing it?
Gautham JanardhanCommented:
take a look at this http://msdn.microsoft.com/en-us/library/dd997001.aspx here at installapplication method you can do the check and return if from an invalid ip

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.