Session code: CLI400 ClickOnce: Advanced Topics in Web Based Application Deployment for Windows Forms and Avalon Jamie Cool Program Manager Microsoft Corporation.
Download ReportTranscript Session code: CLI400 ClickOnce: Advanced Topics in Web Based Application Deployment for Windows Forms and Avalon Jamie Cool Program Manager Microsoft Corporation.
Session code: CLI400 ClickOnce: Advanced Topics in Web Based Application Deployment for Windows Forms and Avalon Jamie Cool Program Manager Microsoft Corporation 1 Agenda ClickOnce Programmability Updating API On-Demand API ClickOnce Architecture Tips & Tricks Coming Soon! 2 ClickOnce Programmability 3 Updating API Scenarios “Update Now” menu option Ensuring server backend & client frontend match Custom “when to update” logic Early adopter “only” updates Throttled updates based on server load 4 API Basics System.Deployment Namespace Simple & Secure to use API Ex. CheckForUpdate() & Update() Sync & Async versions of all methods Moving to “Async For Components” model Only work when deployed w/ ClickOnce Use IsNetworkDeployed to detect 5 Updating API Demo Name Title Group 6 On-Demand API Scenarios “Progressive download” Download an app as it’s needed Shell w/ Plugin app model Generic shell hosts all company apps Each app not downloaded until used Each user may use different apps 7 Using On-Demand Group files in the manifest Put related files in the same group Download files as a group Mark files as “optional” in the manifest Optional files are not downloaded at 1st start DownloadFiles() Takes a group or file name Sync & Async – multiple downloads simul. 8 On-Demand API Demo Name Title Group 9 APIs in the Alpha Currently in System.DeploymentFramework Moving to -> System.Deployment Currently uses IAsyncResult model Moving to -> “Async for Components” model Easier programming model Currently has no On-Demand support It’s being added! API shape is being tweaked based on feedback 10 ClickOnce Architecture 11 ClickOnce – Whidbey Arch Network System. Deployment.exe (managed) IE MIME Filter Net Access (NCL) App Store UI (Winforms) File Access (BCL) Yes My App Startup SHIM Update Check? No 12 ClickOnce – Longhorn Arch Network BITS 2.0 IE My App (Browser Hosted) App Store System. Deploy.exe System. Deployment.dll (managed) Startup SHIM My App Jobs.NET Service 13 Deployment Manifest MyApp.Deploy Identity <assemblyIdentity name="TaskVision.deploy" version="1.0.0.0" publicKeyToken=“…" processorArchitecture="x86" asmv2:culture="en-US" /> <description asmv2:publisher="Microsoft" asmv2:product="TaskVision"> </description> 14 Deployment Manifest MyApp.Deploy Identity Deployment <deployment isRequiredUpdate="false" > <install shellVisible="true" /> <subscription> <update> <beforeApplicationStartup /> <periodic> <minElapsedTimeAllowed time="0" unit="hours" /> </periodic> </update> </subscription> </deployment> 15 Deployment Manifest MyApp.Deploy Identity Deployment App Ref <dependency> <dependentAssembly> <assemblyIdentity name="TaskVision.manifest" version="1.0.0.0" publicKeyToken=“…" processorArchitecture="x86" asmv2:culture="en-US" /> </dependentAssembly> <asmv2:installFrom codebase="1.0.0.0/TV.manifest" /> </dependency> 16 Deployment Manifest MyApp.Deploy Identity Deployment <Signature > <SignedInfo> <Reference URI=""> <DigestMethod Algorithm=“http://…" /> <DigestValue>2xKk…</DigestValue> </Reference> </SignedInfo> <SignatureValue>vNTBod96H7k…</SignatureValue> App Ref Signature <KeyInfo> <KeyValue> <RSAKeyValue> <Modulus>+Wnh5RN9…</Modulus> <Exponent>AQAB</Exponent> </RSAKeyValue> </KeyValue> </KeyInfo> </Signature> 17 Application Manifest MyApp.Manifest Identity Entry Point <assemblyIdentity name="TaskVision.deploy" version="1.0.0.0" publicKeyToken=“…" processorArchitecture="x86" asmv2:culture="en-US" /> Security File List Assembly List Signature 18 Manifest Signing ClickOnce will required signed manifests Guarantees update integrity Can sign with public key or cert Uses XML DSIG Will not require signed assemblies Hash in manifest is sufficient Tools will help w/ signing VS will support automatic signing SDK tool will also be provided Signing is Optional in Alpha It won’t be in the Beta! 19 CLR Security Infrastructure ApplicationSecurityManager (ASM) New CLR Codegroup Grants trust based using Application evidence Checks application trust lists Per-user & per-machine lists Stores trust or no-trust decision Trust granted based on trust requested Delegates to TrustManager for decision Only if no existing decision is present Different TrustManager for Longhorn OS 20 TrustManager Decides if app needs additional trust Requested permissions beyond default No previous trusted version No admin policy Display user prompt if necessary ITrustManagerConfig Control when / how prompting happens 21 Tips & Tricks 22 Tips & Tricks Using Windows 2003 as the server Locks down unknown file extensions Must enable in MIME type list Default ClickOnce file extensions being added Always restart IE between updates Caching issue causes some updates to be delayed on Alpha Can also configure web server to expire content after 1 minute 23 Tips & Tricks (cont.) Deployment errors Debug using the clickonce error log HTTP error -> make sure you can download all app files using IE Invalid manifest error ->make sure the manifest schema is valid Runtime errrors Make sure your running with needed trust Usually manifests as a security exception 24 Things to look for soon… Compression support Based on HTTP compression On-Demand APIs InstallShield support for ClickOnce More VS semi-trust development support VS Signing support SDK Manifest editor Improved Logging… 25 Other Sessions… 26 Call to Action Use ClickOnce! You already have it! Post feedback to: <> What do you like? What’s missing? What did you have problems with? 27 © 2003-2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. 28 Deployment Manifest MyApp.Deploy Identity Deployment App Ref Signature <dependency> <assemblyIdentity <deployment isRequiredUpdate="false" > name="TaskVision.deploy" <dependentAssembly> version="1.0.0.0" <install shellVisible="true" /> <assemblyIdentity publicKeyToken=“…" name="TaskVision.manifest" processorArchitecture="x86" <subscription> version="1.0.0.0" /> asmv2:culture="en-US" <update> publicKeyToken=“…" <beforeApplicationStartup /> processorArchitecture="x86" <description <periodic> asmv2:culture="en-US" /> asmv2:publisher="Microsoft" <minElapsedTimeAllowed </dependentAssembly> asmv2:product="TaskVision"> time="0" unit="hours" /> </description> </periodic> <asmv2:installFrom </update> codebase="1.0.0.0/TV.manifest" /> </subscription> </dependency> </deployment> 30