|
Hello,
I have a deployment scenario where the userhas no internet access, for security reasons, only has a secure internal LAN, and needs to install my software. I was thinking to initially send the user a CD with a standard MSI installer that wraps my ClickOnce network install set of files. The user picks the location to install these files on his internal network share.
The problem is how can I automate the process of signing the application and deployment manifests to reflect the new location? Asking the user to do this with the MAGE or MAGEUI tool is not going to work.
Any suggestions are greatly appreciated.
Victor | | Victor Grippi Friday, September 04, 2009 7:25 PM | Hello Victor, Thanks for your post. >To recap: I'm trying to publish to a location that can be replicated by the user inside their intranet. I have turned off manifest signing, which I thought would solve this issue, but it still looks for the DeploymentProviderURL (the place I need to publish to) and fails to install. I thought with signing turned off, I could drop it anywhere and it would install. This scenario has been discussed it the following article. The problem here iscertificate , as a ClickOnce application's identity is based on the digital signature of the deployment manifest. If the developer signs the deployment manifest, it could lead to conflicts if the customer is a large company, and more than one division of the company deploys a customized version of the application. The article has offer some solutions as well as thebenefits and drawbacks of each. http://msdn.microsoft.com/en-us/library/bb384248.aspx If the number of locations is not too much, I prefer the suggestion about UNC from Robin. Thanks, Rong-Chun Zhang MSDN Subscriber Support in Forum If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. - Edited byRong-Chun ZhangMSFT, ModeratorFriday, September 11, 2009 9:47 AMtypo
- Marked As Answer byRong-Chun ZhangMSFT, ModeratorWednesday, September 23, 2009 9:01 AM
- Edited byRong-Chun ZhangMSFT, ModeratorMonday, September 14, 2009 1:54 AMtypo, miss not
-
| | Rong-Chun Zhang Friday, September 11, 2009 9:46 AM | Why does the user have to install the files on an internal network share? Is the installation for him alone? You could try this:
Deploy the files to a folder on your computer like C:\MyAppDeployment\.
Zip up that folder and send it to your guy.
Have him unzip it into the same foldername, and double-click on the setup.exe in the folder.
Over time, if he unzips into that folder, he will end up with the Application Files structure, and he can delete the old versions from application_files, or not. Doesn't matter.
What matters is that your installation URL matches the one he installs from, be it a web address or a folder name on a hard drive.
RobinDotNet Click here to visit my ClickOnce blog! | | RobinDotNet Saturday, September 05, 2009 5:13 PM | Thanks for the reply Robin.
Our customers deploy multiple workstations, at one or more remote locations, and these all connect to a central host database. Some do not have outsideinternet access so installing and upgrading has hadto be done with a CD. Thishas beenproblematic. With ClickOnce we are hoping to have a single install point, on the host,where each remote user can then install locally from.
We do not know the path where the customer will want to install from, and it's possible the customer will move their network share location over time.
I was thinking that I could wrap the ClickOnce installin a standard MSI install where the user can choose the install location. At this point I would capture the install path and then re-sign the manifest files with the original certificate using the MAGE tool. I assume MAGE is command line and MAGEUI not.
Another question is: can MAGE.exe be distributed? The certificate?
What about changes the customer needs to do to config files. For example, the database connection string is kept in the app.config file. This needs to bemodified at each installation site before remoteworkstationsdo theirClickOnce install. Isthis possible without breaking the signature?
Does this sound feesable?
Thanks, Victor | | Victor Grippi Tuesday, September 08, 2009 5:13 PM | I don't think there's a problem distributing mage, but the problem I see with your scenario is that you will have to give the password for your certificate to your user/customer. This is unwise, as they could turn around and use your certificate for something else. If you have a single install point, can't you make a requirement to having and running the application that it be mapped to a specific drive? Or can you use the UNC path in order to pick up the deployment, like \\mynetworkshare\myappfolder\myapp\publish.htm If you are not enforcing specific drive mapping, how can you even insure that all of the customers in one location have their drives mapped to the same, and that they will all be able to use one deployment? How many customers do you have with different file locations? You can't modify any of the files in the ClickOnce deployment w/o re-signing both manifests. Depending on the number of locations, I would automate that on my side to create X number of build packages and then zip them up and put them on the respective network locations. It would be easier and safer to automate this on your side than to rely on your customers/users to do so. RobinDotNet Click here to visit my ClickOnce blog! | | RobinDotNet Wednesday, September 09, 2009 6:25 AM | "Or can you use the UNC path in order to pick up the deployment, like \\mynetworkshare\myappfolder\myapp\publish.htm " Wouldn't I need to map \\mynetworkshareusing the hosts file? This may not be possible for our users to do. Normally the first part of a UNC path is the server name like : \\serverName\someShare so I'm back having to require the user to set up a predefined path. I guess I could map it to the c:\ drive, but then ClickOnce thinks it's a CD ROM install and then asks for the updatelocation. It defaults to http://localhost which is not where the update will be. To recap: I'm trying to publish to a location that can be replicated by the user inside their intranet. I have turned off manifest signing, which I thought would solve this issue, but it still looks for the DeploymentProviderURL (the place Ineed to publish to)and fails to install. I thought with signing turned off, I could drop it anywhere and it would install. Thanks, Victor | | Victor Grippi Thursday, September 10, 2009 9:45 PM | Hello Victor, Thanks for your post. >To recap: I'm trying to publish to a location that can be replicated by the user inside their intranet. I have turned off manifest signing, which I thought would solve this issue, but it still looks for the DeploymentProviderURL (the place I need to publish to) and fails to install. I thought with signing turned off, I could drop it anywhere and it would install. This scenario has been discussed it the following article. The problem here iscertificate , as a ClickOnce application's identity is based on the digital signature of the deployment manifest. If the developer signs the deployment manifest, it could lead to conflicts if the customer is a large company, and more than one division of the company deploys a customized version of the application. The article has offer some solutions as well as thebenefits and drawbacks of each. http://msdn.microsoft.com/en-us/library/bb384248.aspx If the number of locations is not too much, I prefer the suggestion about UNC from Robin. Thanks, Rong-Chun Zhang MSDN Subscriber Support in Forum If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. - Edited byRong-Chun ZhangMSFT, ModeratorFriday, September 11, 2009 9:47 AMtypo
- Marked As Answer byRong-Chun ZhangMSFT, ModeratorWednesday, September 23, 2009 9:01 AM
- Edited byRong-Chun ZhangMSFT, ModeratorMonday, September 14, 2009 1:54 AMtypo, miss not
-
| | Rong-Chun Zhang Friday, September 11, 2009 9:46 AM | So all of your users don't have access to the same network share? Also, you can't map it to the C drive; don't they HAVE a C drive? You don't want to use http://localhost either, unless your users are running IIS on their machines and you're having them put it there. The deployment URL is critical to the deployment -- it is part of the deployment identity, and part of the security of a ClickOnce application, so someone can't hijack your deployment. You can never drop it anywhere and have it install. You always have to have the URL match the one from where it is installed, and the manifest(s) have to be digitally signed with the certificate. How many are there? Why can't you just create the separate deployments with the different publishing locations and have the user put it in place? RobinDotNet
Click here to visit my ClickOnce blog! | | RobinDotNet Sunday, September 13, 2009 12:14 AM | Hello Victor,
I am writing to check the status of the issue on your side. Would you mind letting me know the result of the suggestions? If you have any additional question, welcome to post here.
Have a great day!
Thanks, Rong-Chun Zhang MSDN Subscriber Support in Forum If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. | | Rong-Chun Zhang Thursday, September 17, 2009 3:49 AM | I ended upwith a temporary solution that involves setting the publish location to c:\myFolder\myFolder and publishing to my local machine. I also turned off checking for updates since this relaxesthe requirement to verify the DeploymentProviderURL.
I then programmatically added codeto check for updates.In effect the update capability is still there without the requirementto go to the DeploymentProviderURL.
I still need a better solution in respect to not having the customer install on their server at the "c:\myFolder\myFolder" location. Again, we ship a CD with an MSI that contains the ClickOnce deployment because some of our customers operate secure internal LAN/WANS and do not have outside public internet access. Therefore I want to let them use the MSI to pick any location on their network to drop the ClickOnce deployment into, and then their people will install and update from that location. This is the scenario I am trying to find a solution for andstill have not found it. Having a "hard coded" location is not desirable or optimal. Many networks do not use a c: drive to prevent virus attacks that assume every machine has a c:\ drive.
I know it is possible to do this by automating the modification of the manifest file using the MAGE tool, however as previously posted, this is notsecure sinceeither I have to expose my certificateor my customers' need to compromise theirs. What I want is the easy ClickOnce install and dependency checking, the updating capability, and the easy uninstall capability. What I DO NOT want is the manifest checking and signing and DeploymentProvider URL verification. Once delivered to my customer it is up to them to secure the application. I also have a licensing scheme in place to further protect who installs and uses my software, so I do not need ClickOnce to do this. Does this make sense????
Here is the code to check for updates in case someone else wants to go down a similar path:
class ClickOnce { private static System.Timers.Timer _updateTimer = null; public static void StartListeningForUpdates() { if (ApplicationDeployment.IsNetworkDeployed) { _updateTimer = new System.Timers.Timer(); _updateTimer.Interval = 10000; _updateTimer.Elapsed += new System.Timers.ElapsedEventHandler(_updateTimer_Elapsed); _updateTimer.Start(); } }
public static void StopListeningForUpdates() { if (ApplicationDeployment.IsNetworkDeployed) { _updateTimer.Stop(); _updateTimer.Dispose(); } }
private static bool _updating; static void _updateTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { if (ApplicationDeployment.IsNetworkDeployed) { ApplicationDeployment current = ApplicationDeployment.CurrentDeployment;
if (!_updating) { try { if (current.CheckForUpdate()) {
Log.Write("ClickOnce we have updates!", 2); _updating = true; current.Update();
} } catch (Exception ex) { Log.Write(String.Format("ClickOnce Update failed: {0}", ex.Message), 1); _updating = false; } } } } }
// add this to your main or startup method:
ClickOnce.StartListeningForUpdates();
Thanks for your help,
Victor | | Victor Grippi Friday, September 25, 2009 5:58 PM | One comment about making manual updates: When your certificate expires, your customers will have to uninstall and reinstall the application, unless you are targeting .NET 4.0. The manifest and certificate checking is a core part of ClickOnce. It is how they verify that you are running a deployment from the intended location, and it has not been hijacked by a hacker somewhere who then uses it to install malware on the user's computer. You must sign the manifest telling where that location is -- if this wasn't required, the deployment could come from anywhere, and be modified by anybody. You never said how many deployments you had, but it seems like you could automate creating a set of them where you set the deployment URL for each location or group and provide it, and they have to put it there. If none of the proposed ideas work for you, maybe you need to create your own version of ClickOnce, or use a setup & deployment package instead. RobinDotNet Click here to visit my ClickOnce blog! | | RobinDotNet Friday, September 25, 2009 9:44 PM |
|