300 likes | 700 Views
Session code: CLI400. ClickOnce: Advanced Topics in Web Based Application Deployment for Windows Forms and Avalon. Jamie Cool Program Manager Microsoft Corporation. Agenda. ClickOnce Programmability Updating API On-Demand API ClickOnce Architecture Tips & Tricks Coming Soon!.
E N D
Session code:CLI400 ClickOnce: Advanced Topics in Web Based Application Deployment for Windows Forms and Avalon Jamie Cool Program Manager Microsoft Corporation
Agenda • ClickOnce Programmability • Updating API • On-Demand API • ClickOnce Architecture • Tips & Tricks • Coming Soon!
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
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
Updating API Demo NameTitle Group
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
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.
On-Demand API Demo NameTitle Group
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
ClickOnce – Whidbey Arch Network System. Deployment.exe (managed) IE App Store MIME Filter Net Access (NCL) UI (Winforms) File Access (BCL) My App Yes Startup SHIM Update Check? No
ClickOnce – Longhorn Arch Network BITS 2.0 My App (Browser Hosted) IE App Store System. Deploy.exe System. Deployment.dll (managed) My App Startup SHIM Jobs.NET Service
Deployment Manifest MyApp.Deploy <assemblyIdentity name="TaskVision.deploy" version="1.0.0.0" publicKeyToken=“…" processorArchitecture="x86" asmv2:culture="en-US" /> <description asmv2:publisher="Microsoft" asmv2:product="TaskVision"> </description> Identity
Deployment Manifest MyApp.Deploy <deployment isRequiredUpdate="false" > <install shellVisible="true" /> <subscription> <update> <beforeApplicationStartup /> <periodic> <minElapsedTimeAllowed time="0" unit="hours" /> </periodic> </update> </subscription> </deployment> Identity Deployment
Deployment Manifest MyApp.Deploy <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> Identity Deployment App Ref
Deployment Manifest MyApp.Deploy <Signature > <SignedInfo> <Reference URI=""> <DigestMethod Algorithm=“http://…" /> <DigestValue>2xKk…</DigestValue> </Reference> </SignedInfo> <SignatureValue>vNTBod96H7k…</SignatureValue> <KeyInfo> <KeyValue> <RSAKeyValue> <Modulus>+Wnh5RN9…</Modulus> <Exponent>AQAB</Exponent> </RSAKeyValue> </KeyValue> </KeyInfo> </Signature> Identity Deployment App Ref Signature
Application Manifest MyApp.Manifest <assemblyIdentity name="TaskVision.deploy" version="1.0.0.0" publicKeyToken=“…" processorArchitecture="x86" asmv2:culture="en-US" /> Identity Entry Point Security File List Assembly List Signature
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!
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
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
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
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
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…
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?
© 2003-2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
Deployment Manifest MyApp.Deploy <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> <assemblyIdentity name="TaskVision.deploy" version="1.0.0.0" publicKeyToken=“…" processorArchitecture="x86" asmv2:culture="en-US" /> <description asmv2:publisher="Microsoft" asmv2:product="TaskVision"> </description> <deployment isRequiredUpdate="false" > <install shellVisible="true" /> <subscription> <update> <beforeApplicationStartup /> <periodic> <minElapsedTimeAllowed time="0" unit="hours" /> </periodic> </update> </subscription> </deployment> Identity Deployment App Ref Signature