Title: Introduction to ClickOnce
1Introduction to ClickOnce
CDNUG 07-Nov-2005
- Name Panayiotis Panayiotou
- Title Business Solutions Lead Dot.Cy
Developments Ltd
2 Agenda
- What is ClickOnce?
- ClickOnce Basics
- Demo ClickOnce Publishing Smart Client Windows
Applications - Fine-tuning ClickOnce
- Demo Configuring ClickOnce Deployment
- Requirements and updating
- Demo Updating ClickOnce Deployed Application
- Prerequisites and Manifests
- Demo Prerequisites
- Security
- Demo Security SandBox
- ClickOnce API
- Demo ClickOnce API
- Hints Tips
3(No Transcript)
4ClickOnce Vision What is ClickOnce?
- Bring the ease of
- web application deployment to
- client applications
5Deployment with ClickOnce What is ClickOnce?
- Smart Client Deploy meets Web Deploy
- Run an application by clicking on a URL
- Update an application by updating a server
- Robust Downloader Installer
- File HTTP server support
- Flexible updates optional, required, etc..
- Start Menu Add/Remove Programs integration
- Extensibility via an API
- Deep Visual Studio Integration
- Rich Security Model
- CLR CAS sandboxing
- Permission elevation prompting w/ Authenticode
6The Best of the Client and WebWhat is
ClickOnce?
7Hope Everyone is still awaked!!!!!!!! Demo
ClickOnce Publishing Smart Client Windows
Applications
8Fine-tuning ClickOnceDevelopment Experience
- Visual Studio 2005 IDE support
- Integrated with core project types
- Setup is not a post-development task
- Project Designer
- Publish pane
- Security pane
- Singing pane
- Publish Wizard
- Copies application to Web server, FTP or
network file share
9Fine-tuning ClickOnce Deployment Options
- Launched application (from Web or UNC)
- Application launches, but doesnt install
- No start menu, no Add/Remove Programs
- There will besupport to cleanupClickOnce Cache
- Always updateson launch
10.NET Framework Deployment
- Managed Networks
- Desktops locked down
- Push technologies
- SMS, Intellimirror, Imaging
- Unmanaged PCs
- User is the admin
- Component Bootstrapper
- FX installed as part of app setup
11Component Bootstrapper
- Lightweight setup.exe
- Detects prerequisites
- Downloads/installs as needed
- Web or disk installations
- Manages reboots
- Supports any msi or exe installer
- Out of the box
- .NET FX, MDAC 9, MSDE, J, MSI 2.0, SQLEXPRESS
- Fully extensible for other components
12Bootstrapper in action
Web Server
Setup.exe
Setup.exe
Dotnetfx.exe
Dotnetfx.exe
a
Mdac_typ.exe
Reboot
MDAC detected!
Foo.msi
Foo.msi
a
App.deploy
App.deploy
13Demo Configuring ClickOnce Deployment
14ClickOnce Requirements
- Operating System Support
- ClickOnce ships in the .NET Framework redist
supports all of the same operating systems
languages as the core .NET Framework.
Specifically Windows 98 up, except for NT4. - Special server requirements for hosting a
"ClickOnce" application - No, you can use a regular file share, IIS or any
web server. - If you are using a web server
- You need to configure the MIME type
(application/deployment) for the .application
extension. - You need to configure your server to unblock any
restricted file extensions used by your app, such
as .exe, .dll, .config., manifest, etc. - If you want to use HTTP compression, you will
need IIS6 and HTTP 1.1. - Client Computers to have .NET FW 2.0
15ClickOnce BasicsUpdate options for installed apps
- On application startup
- If found, ask user to update app
- After application startup
- If found, ask user to update on next run
- Required updates
- Specified using minimum required version
- Programmatic updating
- Prerequisites
16ClickOnce BasicsUpdate Architecture
17Demo Updating ClickOnce Deployed Application
18ManifestsDeclarative Installation
- Application manifest (n)
- Authored by the developer
- Describes the application
- Example what assemblies constitute the
application - Deployment manifest (1)
- Authored by the administrator
- Describes the application deployment
- Example what version clients should use
19ManifestsDeployment Application Manifests
MyApp.application 1.0
? 1.1
Link to MyApp.application
20ManifestsDeployment Manifest
MyApp.application
ltassemblyIdentity name"MyApp.application" vers
ion"1.0.0.0" language"neutral" publicKeyToken
"25a34e5eada94e4c" processorArchitecture"msil"
/gt ltdescription publisher"My Company, Inc."
product"Weather Report" /gt
Identity
21ManifestsDeployment Manifest
MyApp.application
ltdeployment install"true" minimumRequiredVersi
on"1.0.0.0"gt ltsubscriptiongt ltupdategt ltbefor
eApplicationStartup /gt lt/updategt lt/subscription
gt ltdeploymentProvider codebase"http//../MyA.ap
plication" /gt lt/deploymentgt
Identity
Deployment
22ManifestsDeployment Manifest
MyApp.application
ltdependencygt ltdependentAssembly codebase"MyApp
_1.0.0.0\ MyApp.exe.manifest" size"6101"gt
ltassemblyIdentity name"MyApp.exe" version
"1.0.0.0" publicKeyToken"34e5eada94e4c" la
nguage"neutral" processorArchitecture"msil"
/gt lthashgt . . . lt/hashgt lt/dependentAss
emblygt lt/dependencygt
Identity
Deployment
App Ref
23ManifestsDeployment Manifest
ltSignature Id"StrongNameSignature" ltSignedInfogt
ltCanonicalizationMethod Algorithm"http//..
.xml-exc-c14n" /gt ltSignatureMethod Algorithm
"http//...rsa-sha1" /gt ltReference
URI""gt ltTransformsgt . . . lt/Transformsgt ltDi
gestMethod Algorithm"http//...sha1"/gt ltD
igestValuegt mC8avBcdsDW2hAdUgzzuvwB9N8 lt/
DigestValuegt lt/Referencegt lt/SignedInfogt ltSigna
tureValuegttvp9...N3GF4aJElt/SignatureValuegt ltKeyI
nfogt ltKeyValuegt ltRSAKeyValuegt ltModulusgt5h
68S14...bgA7Elt/Modulusgt ltExponentgtAQABlt/Expon
entgt lt/RSAKeyValuegt lt/KeyValuegt lt/KeyInfogt lt
/Signaturegt
MyApp.application
Identity
Deployment
App Ref
Signature
24ManifestsApplication Manifest
MyApp.exe.manifest
ltentryPointgt ltassemblyIdentity name"MyApp" v
ersion"1.0.0.0" publicKeyToken"25A34E5EADA94E4
C" language"neutral" processorArchitecture"m
sil" /gt ltcommandLine file"MyApp.exe" parame
ters"" /gt lt/entryPointgt
Entry Point
25ManifestsApplication Manifest
lttrustInfogt ltsecuritygt ltapplicationRequestMinim
umgt ltPermissionSet class"System.Security.
PermissionSet" version"1" ID"Custom"gt
ltIPermission class"PrintingPermission,
System.Drawing, . . . /gt more
permissions follow lt/PermissionSetgt ltdefaultA
ssemblyRequest permissionSetReference"Custom"
/gt lt/applicationRequestMinimumgt lt/securitygt lt/t
rustInfogt
MyApp.exe.manifest
Entry Point
Permissions
26ManifestsApplication Manifest
ltfile name"MyApp.exe.config" size"1374"gt lthash
gt ltTransformsgt ltTransform Algorithm"..."
/gt lt/Transformsgt ltDigestMethod
Algorithm"...sha1"/gt ltDigestValuegt/Obm...lt/Di
gestValuegt lt/hashgt lt/filegt ltfile
name"Readme.txt" size"474"gt lthashgt ltTransform
sgtlt/Transformsgt ltDigestMethod
Algorithm"...sha1"/gt ltDigestValuegt/Obm...lt/Di
gestValuegt lt/hashgt lt/filegt
MyApp.exe.manifest
Entry Point
Permissions
Files
27ManifestsApplication Manifest
ltdependencygt ltdependentAssembly
codebase"MyApp.exe" size"20480"gt ltassemb
lyIdentity name"MyApp" version"1.0.0.0"
. . . /gt lthashgt. . .lt/hashgt lt/dependentAssembly
gt lt/dependencygt ltdependencygt ltdependentAssembly
preRequisite"true"gt ltassemblyIdentity
name"MicrosoftW-CLRCoreComp"/gt lt/dependentA
ssemblygt lt/dependencygt
MyApp.exe.manifest
Entry Point
Permissions
Files
Dependencies
28ManifestsApplication Manifest
ltSignature Id"StrongNameSignature" ltSignedInfogt
ltCanonicalizationMethod Algorithm"http//..
.xml-exc-c14n" /gt ltSignatureMethod Algorithm
"http//...rsa-sha1" /gt ltReference
URI""gt ltTransformsgt . . . lt/Transformsgt ltDi
gestMethod Algorithm"http//...sha1"/gt ltD
igestValuegt mC8avBcdsDW2hAdUgzzuvwB9N8 lt/
DigestValuegt lt/Referencegt lt/SignedInfogt ltSigna
tureValuegttvp9...N3GF4aJElt/SignatureValuegt ltKeyI
nfogt ltKeyValuegt ltRSAKeyValuegt ltModulusgt5h
68S14...bgA7Elt/Modulusgt ltExponentgtAQABlt/Expon
entgt lt/RSAKeyValuegt lt/KeyValuegt lt/KeyInfogt lt
/Signaturegt
MyApp.exe.manifest
Entry Point
Permissions
Files
Dependencies
Signature
29ClickOnce BasicsBootstrapper
- Installs app prerequisites
- .NET FX, SQLExpress, DirectX,..
- Requires admin rights
- Extensible architecture
- Manages reboots
- Installs ClickOnce appafter prerequisites
- Use ClickOnce for auto-updates
- No auto-updating of prerequisite components
30Demo Prerequisites
31SecurityIntroduction
- ClickOnce applications run in a sandbox by
default - Permissions are based on origin
- Internet, Intranet or Full Trust
- Similar to IE and Javascript
- Sandbox size increases
- Longhorn gt .NET V2.0 gt .NET V1.1
- Apps often need higher trust
- Call unmanaged code
- Connect to DB, WS,
32SecurityDetermining required permissions
- Security pane of Project Designer
- Configure permissions manually
- Permissions Calculator
- Calculates least required permissions
- Use declarative securityfor dynamic actionsEx.
WebBrowserPermission( SecurityAction.Demand
, Unrestricted true, Level
WebBrowserPermissionLevel.Default) - Debug in sandbox
- Intellisense in sandbox
33SecurityMicrosoft Authenticode
- Authenticode signatures required for ClickOnce
- Based on industry standards
- Allows devs to include company information
through the use of digital signatures - In contrast to.snk files!
- Certificate origins
- Verisign,
- Internal certification authority (CA)
- MakeCert
- Programs
- MakeCert creates X.509 certificate
- SignCode, CertMgr,
- MSDN link
34SecurityUser prompting
- App requests requiredpermissions
- User prompted,if app permission needs gt sandbox
permissions - Users make trust decisions all the time
- Installing software from CD
- Submitting a credit card number to web page
- Useful for targeting PCs at home
- Internet or unmanaged Intranet
- User is the admin
- Admin can disable prompting via policy
35SecurityScenarios to get elevated trust
- ISVs
- Obtain a cert from VeriSign
- User runs app ? trust prompt indicates the
company - Large managed companies (no trust prompt)
- Can use own PKI infrastructure and issue certs
for internal enterprise applications - Add cert to trusted root publisher list
- ? Use Active Directory Group Policy
- Small companies hobbyists (no trust prompt)
- Use makeCert (.NET SDK) or VS2005
- Add cert to trusted root publisher list on
clients - At setup time of .NET FW, SMS, etc.
- Tell enduser to use CertMgr
- ? As part of the bootstrapper
36SecuritySecure Updates
- ClickOnce manifests are signed (XMLDSig)
- Manifest hashed
- Hash signed signature created
- Signature added to manifest
- ? Changing the manifest invalidates the signature
- ? Guarantees a unique application identity
- Publisher key needed to deploy updates
- ClickOnce apps are isolated ? their components
cant be reused! - Prevents auto-deployment of viruses
- Does not require signed assemblies
- Hash in signed manifest is sufficient
37Demo Security
38API BasicsIntroduction
- System.Deployment Namespace
- Class ApplicationDeployment
- Simple Secure to use API
- Ex. CheckForUpdate(), UpdateLocation Update()
- Sync Async versions of all methods
- Only works when deployed with ClickOnce
- Use IsNetworkDeployed to detect
39API BasicsProgramming Scenarios
- Application updating
- Implement Update now menu option
- Match client with back-end programs
- Customize when-to-update logic
- Limit updates to beta users only
- Throttle updates based on server load
40Demo ClickOnce API
41Some Afterthoughts
- Keep smart client applications as much as
possible self-dependable to keep security
restrictions to the minimum - Compatibility with previous versions of .NET
framework - Can us a wrapper application
- Deploying with page login
- No direct support from ClickOnce API. But you can
use the ASP.NET authentication and authorization
mechanisms.
42(No Transcript)