简体   繁体   中英

Can I use C:\Program Files as the UNC path when publishing my project

I want to publish ac# project. I want to know if I can use C:\\Program Files as the UNC path Or I must add my PC name like C:\\mypcname\\folder I want to make sure it can be installed from another computer system.

I think, you have a big misunderstanding here. First of all, if you include a computername, you need to write it in the form \\computername.

But what do you have in mind? Publishing my project? When you publish or install a project, you will never ever use absolute pathes like "C:\\Program Files", but instead you will use variable names for system folders. You may check for Environment specialfolder enumeration to get an idea.

And - you should have in mind, that EVERY installer available today will properly do that job for you. Have a look at Innosetup. Or, make that question more clear.

If you are using the publish dialog, then you are deploying using ClickOnce . If you are distributing it, then typically you would be using FTP to publish it to a web server or something - if you choose a location on your hard drive, then that is just where the files will be placed; you would need to copy those files onto a flash drive and take it from computer to computer to deploy it.

C:\\mypcname\\folder is not a valid file path, so that one is out. C:\\Program Files is probably not a very good option. A folder under "My Documents" would probably be better.

Either way, the option you choose has nothing to do with where the project will wind up on your users' computers once they "install" it... ClickOnce actually puts everything into the hidden AppData folder under the Users folder of the user. If you want the application to wind up in C:\\Program Files , then ClickOnce is not the deployment technique you are looking for. Look into something like InstallShield instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM