070607 07q2 vista

Upload: apple-johnnyseed

Post on 31-May-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 070607 07Q2 Vista

    1/27

    Where DevelopersMatter

    Vista Enable Your ApplicationsFredrik Haglund, Regional Developer [email protected]

  • 8/14/2019 070607 07Q2 Vista

    2/27

    AgendaWhat is User Account Control in Vista?

    Other Compatibility Issues on Vista

    Running as Standard User

    User Interface Changes in Vista

    Demo Migration BDECOM and COM with Elevation

    Signing

  • 8/14/2019 070607 07Q2 Vista

    3/27

    Vista Enable Your Applications

  • 8/14/2019 070607 07Q2 Vista

    4/27

    What is User Account Control in Vista?Why?

    How?

  • 8/14/2019 070607 07Q2 Vista

    5/27

    UAC Elevation Demo

    Over the Shoulder elevation prompt:

    Elevation prompt:

  • 8/14/2019 070607 07Q2 Vista

    6/27

    UAC ArchitectureAccess Token Split at Login

    Elevation Prompt

    Secure Desktop

    Installer Detection

    User Interface Privilege Isolation

    Virtualization/Redirection

  • 8/14/2019 070607 07Q2 Vista

    7/27

    UAC Virtualization (Redirection)

  • 8/14/2019 070607 07Q2 Vista

    8/27

    Other Compatibility Issues on VistaServices Isolation

    IE Protected Mode

    Windows Resource Protection64-bit Windows Vista

    Networking

    Version CheckingShell changes

    Removed components (WinHelp)

  • 8/14/2019 070607 07Q2 Vista

    9/27

    Running as Standard User Do not assume user is an Admin!

    Follow Guidelines

    A Standard User can not: Change files in Program Files folders Change files in Windows or System32 folders Change registry under HKLM\Software Change the local machines date and time Install or uninstall Services Register COM Server (globally)

  • 8/14/2019 070607 07Q2 Vista

    10/27

    User Interface Changes in VistaDWM Desktop Window Manager

    Glass, Thumbnail and Flip 3D

    Rendering - Black borders, High Dpi, UI themes

    New UI elements:Shield, FileDialogs, TaskDialog, etc

  • 8/14/2019 070607 07Q2 Vista

    11/27

    New in C++/Delphi 2007 for VistaEnable Runtime Theme option

    Component: TTaskDialog , TFileOpenDialog ,TFileSaveDialog

    Property TCustomForm. GlassFrame

    Property Application. MainFormOnTaskBar

    Function TaskMessageDlg

    Global var UseLatestCommonDialogs

  • 8/14/2019 070607 07Q2 Vista

    12/27

    Enable runtime theme

  • 8/14/2019 070607 07Q2 Vista

    13/27

    Manifest - requierdExecutionLevelasInvoker (Default in D2007)

    highestAvailable

    requireAdministrator

  • 8/14/2019 070607 07Q2 Vista

    14/27

    Manifest content

  • 8/14/2019 070607 07Q2 Vista

    15/27

    RedesignDo not open files or registry keys with Write flag

    Save data, log files, etc. in the right location using

    SHGetFolderPath CSIDL_PERSONAL { My Documents }

    CSIDL_APPDATA { Application Data, new for NT4 }

    CSIDL_LOCAL_APPDATA { non roaming, user\LocalSettings\Application Data }

    CSIDL_COMMON_APPDATA { All Users\Application Data }

    CSIDL_MYPICTURES { My Pictures, new for Win2K }

    CSIDL_COMMON_DOCUMENTS { All Users\Documents }

  • 8/14/2019 070607 07Q2 Vista

    16/27

    SHGetFolderPath

  • 8/14/2019 070607 07Q2 Vista

    17/27

    RunAsAdminLaunch application running as administrator

    Use Application.Handle to delay elevation if appis minimized.

    No handle always gives direct foregroundelevation.

  • 8/14/2019 070607 07Q2 Vista

    18/27

    RunAsAdmin

  • 8/14/2019 070607 07Q2 Vista

    19/27

    Using COM class for Admin tasksCOM Server must be an EXEEXE must have requireAdministrator to install COM

    objects correctly

    Registration of COM Class must add value LocalizedString (and resource string in executable) add key Elevation and value Enabled = 1

  • 8/14/2019 070607 07Q2 Vista

    20/27

    Elevated COM callsUse Moniker to create elevated CoClass from

    User Process

  • 8/14/2019 070607 07Q2 Vista

    21/27

    The Shield - SetElevationRequiredStateCall function with Button as parameter to add

    Shield symbol

  • 8/14/2019 070607 07Q2 Vista

    22/27

    Test your application identify problems

    Classify your application as Standard User, Admin or Mixed.

    Add application Manifest

    Redesign functionality User apps should write data to correct locations

    Split out admin stuff into a separate executable

    Redesign user interface Add shield to buttons

    Redesign installer

    Test again

    Optionally sign application (Authenticode)

    Determine whether to pursue the Windows Vista Logo program

  • 8/14/2019 070607 07Q2 Vista

    23/27

    Case Exampel: BDE ApplicationLocation of Database Files

    Virtualization

    Risk of Database Corruption

    Alias and BdeAdmin Config Files

    TDatabase andTSession

  • 8/14/2019 070607 07Q2 Vista

    24/27

    Vista Enable Your Applications

    Demonstrations

  • 8/14/2019 070607 07Q2 Vista

    25/27

    Summary

  • 8/14/2019 070607 07Q2 Vista

    26/27

    SummaryWhat is User Account Control in Vista?

    Other Compatibility Issues on Vista

    Running as Standard User

    User Interface Changes in Vista

    Migration

  • 8/14/2019 070607 07Q2 Vista

    27/27

    Thank you