Using ClickOnce and XBAPs To Deploy Windows Forms and WPF Applications Guy Smith-Ferrier [email protected] Blog: http://www.guysmithferrier.com 1 Courseware Online About… Author of .NET Internationalization – Visit http://www.dotneti18n.com to download the complete source code The .NET Developer Network – http://www.dotnetdevnet.com – Free user group for .NET developers, architects and IT Pros based in Bristol 2 Courseware Online ClickOnce Vision To bring the ease and reliability of web application deployment to Windows Forms applications 3 Courseware Online Agenda ClickOnce and Windows Forms ClickOnce and WPF XAML Browser Applications (XBAPs) Windows Forms, WPF and XBAP Comparison XBAPs and Silverlight Comparison 4 Courseware Online Information Sources Smart Client Deployment with ClickOnce, Brian Noyes, Addison Wesley Deploying .NET Applications, Sayed Y. Hashimi and Sayed I. Hashimi, Apress Windows Presentation Foundation Unleashed, Adam Nathan, Sams Publishing Pro WPF, Mathew MacDonald, Apress Saurabh Pant's blog – blogs.msdn.com/saurabh/archive/tags/ClickOnce /default.aspx 5 Courseware Online Online Example Create a Windows Forms application and call it CustomerCare1 Set Form1.Text to "Customer Care" and add a button Select Build | Publish CustomerCare1 – Click Next – Select the "No" radio button – Click Next – Click Finish In the CustomerCare1 web page click on the Run CustomerCare1 button – In the Security Warning dialog click on Run 6 Courseware Online Online Example (continued) Close the application Click on the Run button again and observe that the application doesn't show the "Downloading" dialog and it starts up faster Close the application and close the web page Add a button to CustomerCare1, publish it again and click on the Run button – Observe that the application shows the "Downloading" dialog as it downloads the updated copy 7 Courseware Online How Does It Work ? The Publish Wizard:- – creates a new Virtual Directory in IIS using the name of the application (e.g. CustomerCare1) – creates a new folder beneath the Home Directory (e.g. C:\Inetpub\wwwroot\CustomerCare1) adds a customized setup.exe (the Bootstrapper) to the new folder adds a Publish.htm page which is shown to the user adds a deployment manifest (e.g. CustomerCare1.application) adds a version-specific deployment manifest (e.g. CustomerCare1_1_0_0_0.application) – creates a new folder for the latest version of the application (e.g. CustomerCare1_1.0.0.0) adds the application (e.g. CustomerCare1.exe.deploy) adds an application manifest (e.g. CustomerCare1.exe.manifest) When the application is run it is cached so it runs faster next 8 time Courseware Online How Does Publish.htm Work ? Publish.htm includes:- – a Button called InstallButton with an href of "setup.exe" – a section called BootstrapperSection Publish.htm includes JavaScript which is automatically executed to determine if the .NET Framework 2.0 is installed – If it is installed:- BootstrapperSection.style.display is set to none InstallButton.href is set to the application's deployment manifest (e.g. CustomerCare1.application) 9 Courseware Online ClickOnce Client Requirements For browser access the client must support URL activation e.g. – Internet Explorer Non-Internet Explorer browsers (e.g. Mozilla) will not work because they look for the application files in the same location as the manifest files For FireFox use FFClickOnce – http://www.softwarepunk.com/ffclickonce/ – Outlook – MSN Explorer – AOL 10 Courseware Online
Description: