views:

225

answers:

5

Hello,

I need some advice please. I need to enable a .Net application to run over a network share, the problem is that this will be on clients network shares and so the path will not be identical.

I've had a quick look at ClickOnce and the publish options in VS2008 but it wants a specific network share location - and I'm assuming this location gets stored somewhere when it does its thing.

At the moment the job is being done with a old VB6 application and so gets around all these security issues, but that application is poorly written and almost impossible to maintain so it really needs to go.

Is it possible for the domain controller to be set up to allow this specific .Net application to execute? Any other options would be welcomed as I want to get this little application is very business critical.

I aught to say that the client networks are schools, and thus are often quite locked down as are the client machines, so manually adding exceptions to each client machine is a big no no.

Marlon

--Edit--

Apologies, I forgot to mention we're restricted to .net 2.0 for the moment, we are planning to upgrade this to 4.0 but that won't be immediate.

A: 

Can you use a UNC path? \\server\folder\app.exe?

Russell Steen
There might be configuration to make on Code Access Security to allow the execution from such a path...
Cédric Rup
A: 

Perhaps, the link here could save you, if I am not mistaken, you are worried about the drive letter and handling UNC conventions? Take a look at this on CodeGuru, which contains code on how to map to a UNC share dynamically at run-time.

tommieb75
nope I'm saying that to make a clickonce deployment VS2008 asks for a UNC network in the publishing wizard. I am concerned that if I put one in for the network we have here - that wont deploy for client networks.
Marlon
@Marlon: Why do you think it won't deploy for client networks? Why not put in a designated network share that will be the same as the client's network?
tommieb75
We can't really designate a path or drive letter - we have over 100 schools and each of those will have a different network configuration.
Marlon
A: 

The problem is Security related to the .Net framework. Unfortunately i don't have much experience in this area, but maybe one of these links will help:

Oliver
+2  A: 
  1. On the "Publish" tab of your project properties there is a "Installation Folder Url" textbox. Visual Studio requires you to put something there. Just put in any random UNC path (\\someserver\randomfolder)
  2. Click the "Options" button. Select "Manifests" and check "Exclude deployment provider URL". This will remove the path you were forced to add in step 1.

This should allow clients to put your deployment wherever they want. When their users install, their start menu shortcut will point back to where they put the deployment.

Here's the description from MSDN about that checkbox...

Exclude deployment provider URL
Specifies whether to exclude the deployment provider URL from the deployment manifest. Starting in Visual Studio 2008 SP1, the deployment provider URL can be excluded from the manifest for scenarios in which application updates should come from a location unknown at the time of the initial publication. After the application is published, updates will be checked from wherever the application is installed from.

whatknott
Hello, thank you for that suggestion, would seem to solve my problems - however that specific check box is disabled :( only the top two are enabled. Do you have any suggestions?
Marlon
I'm guessing that some other setting is disabling it. I would create a dummy project and change ClickOnce settings one at a time. After each change, check to see if the "Exclude deployment provider URL" check box gets disabled.
whatknott
Have discovered this option is only available to applications which use .NET 3.5 and above. But thank you for the information, its another thing to put on the list of benefits of upgrading.
Marlon
+3  A: 

The deployment location in the manifest must match the location where it is deployed. You are going to HAVE to use a UNC path. There shouldn't be any problem with this. ClickOnce applications install under the user's profile, and require no administrative privileges. It only needs read access to the file share where the application is deployed.

The best answer is to create deployments for each school and for you to set the UNC path, because then you can just send them a signed deployment and they can put it on the file share. But that's a major p.i.t.a. if there are a lot of schools involved.

The next answer is: Who actually deploys the application to each school, i.e. puts it on the file share? Is there some kind of administrator?

What I would recommend (depending on who it is) is giving them mageUI.exe and teaching them how to change the deployment URL and re-sign the manifest (it will prompt). The problem with them re-signing the deployment is they have to have a certificate. You could give each school their own certificate (created with the "create test certificate" button in VS, or use MakeCert to create one [ask if you want more info]) or give them all the same key (not very secure, but hey, it would work).

If you at least updated to .NET 3.5 SP-1, you could deploy the application without signing it. (I'm not giving you a hard time about .NET 2.0, my company is in the same position, I'm just passing this information on.)

If the computers have internet access, you could probably find somewhere to host the deployment for $10/month, and push it to a webserver and let them all install from there. Then everyone would get updates at the same time, you would only have to deploy updates to one location. This would be the simpliest solution, assuming they have internet access.

RobinDotNet
Visit my ClickOnce blog!

RobinDotNet