tags:

views:

51

answers:

2

I'm not sure how many people here are experts with visual studios, but I'd imagine a handful (not to raise expectations but to appeal to your egos :P).

I'm working primarily in visual basic for now (though I hope to switch to c# in the near future and maybe a java or web app).

Basically I'm trying to create an update feature that will work similarly to how common programs such as firefox or itunes update automatically. There is supposed to be provided functionality for this in what is called click once.

I carry out the following procedures and get the following errors when trying to change the update url of my program to a password-protected ftp location.

Go to project properties

Go to publish

click updates

click browse

click FTP Site

Under Server put: web###.opentransfer.com

Under Port: 21

Under Directory put: CMSOFT

Passive mode is selected (which is what filezilla tells me the server is accessed with)

Anonymous User is unselected and a username and password are typed in

Push Ok

Under Update location it shows: ftp://web###.opentransfer.com/CMSOFT

I push Ok

I see a message box titled Microsoft Visual Basic 2010 Express with an x icon

Publish.UpdateUrl: The string must be a fully qualified URL or UNC path, for example "http://www.microsoft.com/myapplication" or "\server\myapplication".

I've tried changing the directory to "CMSOFT/PQCM.exe" and the results are the same...hope this was descriptive enough.

A: 

Hi,

With ClickOnce deployment (the publish tab in Visual Studio), you can publish to a webserver or file share with FTP. You can NOT install a ClickOnce application using FTP. You have to use http or a file share (as you have discovered). (You can also publish to a CD and provide the deployment that way, but that doesn't really help you here.)

If your intention is to protect your ClickOnce deployment, the only real way to do this is to use Windows integrated security to protect the default deployment manifest (.application file). Of course, this is only practical for an application hosted on an intranet inside a company.

Your other choice is to password-protect the page where the Install URL is invoked, but this isn't 100% secure, since anybody could get the link to the setup.exe or .application file and run it directly without ever going through the web page.

We provide protection by requiring the customers to log into our application when they start it up. So they can install the ClickOnce application, but they can't use it unless they are a valid user.

RobinDotNet
I see. Do you know of how I could host the executable with a direct link (so I could use it in my program) that is free? The only way I could figure out to get a direct link was FTP...
Assimilater
I don't know what you mean by "that is free", or what you are trying to accomplish. Are you trying to deploy it and have the user install it, or are you trying to let another program run it? Note that if you want to use the features of ClickOnce deployment -- that would be the security built in to make sure the files are not tampered with, and the incremental updates -- you don't want to run the [exe] file directly. ClickOnce applications are run via the shortcut, which is a appref-ms file. Run the exe, and it doesn't run as a ClickOnce app. Can you give more details what you're trying to do?
RobinDotNet
Well I'm trying to accomplish a lot of things that are unrelated other than they are all required to make this program work the way I want it to. And this will need to fill multiple comments.I use the clickonce setup file only to make sure that the user has the .net framework requirements...I hate having it put in a folder the user can't find especially since one of the features of this program is to carry the data on a thumb drive and opened from anywhere. (meaning the executable would be on the thumb drive).
Assimilater
So I created an install program that goes through the normal installation process (I don't like my limited control over the click-once installation method). The setup file downloads the setup program to that obscure folder with the clickonce reference. The setup program downloads the software (hitherto from an ftp location) to a location of the user's choosing since that is critical to the functionality of my program.
Assimilater
This is a contact management program; the program itself creates three directories that represent categories (contacts mileage and personal) for data storage in its parent directory. The program creates a file for each contact in the contacts folder to record basic contact information and keep track of notes in comma delimited format. It also logs mileage in comma delimited format and some personal business information likewise. The point being that it needs to be able to write data in whatever location it exits (thumb drive or hard drive).
Assimilater
Especially since portability and the option of where to install the program is a demand of my customers working with UAC and ClickOnce has been a thorn in my side...I hope this is enough information for you to understand what I'm trying to do...
Assimilater
(and since this program is in its early stages i need to be able to send out updates as/(if) i need to make bug fixes and it is very cumbersome to email out zip files with the executable. I used to have a program that would be installed with the contact manager, close the contact manager, delete the contact manager and replace it with the new one. The requirement of administrator privileges to right data to the hard drive, however, made that option only available for windows xp...which is going extinct these days
Assimilater
as for how the file is downloaded I need a direct link if my program is to be able to download it. Google won't host executable files. Other file-hosting services don't provide a direct link for free. And the only ftp server I have access to is password protected. I need to find some other way of hosting the file to do what you propose...
Assimilater
RobinDotNet
I never store my data in the ClickOnce deployment folders. Check out this blog entry; this is what I usually recommend for deploying data: http://robindotnet.wordpress.com/2009/08/19/where-do-i-put-my-data-to-keep-it-safe-from-clickonce-updates/ . If you put your data in LocalApplicationData or MyDocuments, then UAC isn't a problem. The point of UAC is to modify how your app works, not to circumvent it. In fact, one of the primary design goals of ClickOnce is to NOT require admin privs, which is why the app is installed in the user's profile.
RobinDotNet
RobinDotNet
How do you use a setup deployment without clickonce?
Assimilater
And the user needs to have access to the exe for part of the functionality. If you carry the data on a thumb drive without the executable, then you can only use the data on computers with the program installed...this was not my desire.
Assimilater
Another question? Why would microsoft have a problem with installing a program to program files? Isn't that the point of that directory?! To house installed programs?!
Assimilater
Hey back to the original question: is there a directory that exists on all windows platforms (ie not a user, maybe default user) that I could have the program download the file to and THEN set the update location to that location and perform the update in the code manually?
Assimilater
RobinDotNet
A: 

I'm having formatting issues with comments, so I'll answer your questions here.

Links on setup & deployment packages
http://support.microsoft.com/kb/307353
http://msdn.microsoft.com/en-us/library/tw8kdk75.aspx
http://msdn.microsoft.com/en-us/library/k3bb4tfd.aspx
My expertise is in ClickOnce deployment; I know very little about S&D packages. AFAIK, the expert is Phil Wilson, and he answers questions in the MSDN ClickOnce and Setup & Deployment Forum. He's a brilliant guy.

Also note that the setup & deployment project type is not available in the Express versions of VS.

Why do the users need to have access to the executable?

If you want people to be able to run the application without it being installed, why don't you just do an XCopy of the \bin\release folder and let them put it wherever they want to and then run it via the exe file?

Microsoft doesn't have a problem with installing a program to Program Files; it's just not for ClickOnce applications. Installing in Program Files requires admin privileges, and that is counter to the design goals of ClickOnce deployment. The point of C/O is to provide a lightweight deployment methodology that doesn't require administrative privileges. It installs the files under the user's profile, and it keeps them cached separately from anything else so you can be sure that installing a ClickOnce deployment cannot mess up anything else on the computer. This gives IT folks a nice warm fuzzy feeling. As a customer, it would give me a warm fuzzy feeling because I wouldn't have to worry about dll hell or something like that impacting me. The other great feature of C/O deployment is the automatic updates, which means you can ensure the users get automatic updates and they are always running the most current version of the application with almost no effort on your part.

It seems like you want the ability to force the users to run the most recent version (i.e. upgrades), but you don't want to install the application in a specific place, or require that it be installed. Those two things are counter to each other, and the only way I know of to accomplish that is to write your own deployment packaging.

I don't see how putting the application in some folder on the user's computer is going to allow you to do programmatic updates even. ClickOnce does have an APi that you can call to check for updates, the really the application must be hosted on a file share or web server. If you have to send files to a user and have him put them in a specific folder so he can then run the application and get an update, it's just overkill. Just send him the files and have him put them in a specific folder, and your work here is done.

RobinDotNet
I'm thinking of an alternative solution that might work better as commented in my other click-once thread. I'm going to explore how I can compact my data. I might look at a database file though when I tinker with some of the tools I get very confused as to what I'm actually doing. This would only leave me with one challenge: How can I host the file with a URL link? I'd really like the update feature but if I need a URL...how can I get it?
Assimilater
First, the easiest database to use is SQLCE. It's basically a file and you can deploy the dll's with the app instead of as a prerequisite, which is easy. Next up is SQLExpress, but you have to actually install SQLExpress on the client machine. As for hosting the file with a URL link, you would host your application on a webserver or a file share that the user can actually get to. Are your customers internal to a company, or external and all over the web? You can deploy your app and host it on a website if you have one.
RobinDotNet
They are internal to a series of companies for the most part, but the market may expand to business I am not affiliated with. Does this mean that clickonce would send them to a web page rather than perform the update in the background?I don't know anything really about SQL...I tried doing using some data tools in the toolbox and control list but have been totally lost on how to use them. Know a good resource to get me started? Preferably one that isn't 10 pages long :P.
Assimilater
You can install IIS on your own machine (assuming you have control over it) and deploy your application locally and try it out. Deploy it, install it, deploy a new version, run the application and see it pick up the update. Here's a blog posting on deploying to localhost: http://robindotnet.wordpress.com/2009/07/20/local-deployment-of-a-clickonce-application/
RobinDotNet
As for SQLServer, I'd click the Data cloud tag on Beth Massi's blog: http://blogs.msdn.com/b/bethmassi/To learn how to do data access, I bought Dave Sceppa's ADO.Net book and read it, and it set me up, but now they have Entity Framework. So I'm not sure where to tell you to start. I'd post just that question here on stackoverflow. You don't really want SQLServer training, you want development training using a SQLServer database, if you know what I mean. :-)
RobinDotNet