locked
Win7 App Compat FAQ For Developers RRS feed

All replies

  • 1.    What are the Windows 7 new features for developers?     [Top]

     

     

    1

    Taskbar

    With the new taskbar in Windows 7, applications can provide more information to the user in more intuitive ways. For example, Application User Model IDs enable developers to group the application windows. Jump Lists make it quicker for users to jump to where they want to go. Thumbnail Toolbars help users switch between windows with more confidence. Icons Overlays and Progress Bars help users stay in contact with their application while it is minimized.

    2

    Libraries

    Libraries are the new entry points to user data. Libraries are a natural evolution of the My Documents folder concept that blends into the Windows Explorer user experience. A library is a common store of user defined locations that applications can leverage to manage user content as their part of the user experience.  Libraries are not file system locations so some applications will be needed to be updated to work with them like folders.

    3

    Multi Touch

    Windows 7 improves touch and added gestures support empower developers to quickly and easily create unique application experiences that go beyond simple mouse pointing, clicking, and dragging. The new multi-touch APIs support rich gestures, such as pan, zoom, and rotate. The Windows 7 Multi-Touch Platform also provides raw touch data inputs and advance manipulation and interties.

    4

    Sensor and Location Platform

    The Sensor and Location Platform includes native support for sensors, expanded by a new development platform for working with sensors, including location sensors such as GPS devices. Built on the Sensor platform, the new Windows Location APIs enable application developers to access the user’s physical location information.

    5

    Ribbon

    Windows 7 incorporates the Ribbon interface introduced in Office 2007 throughout the operating system, enabling improved user interface development on the platform. This means that developers can deliver a rich, graphical, animated, and highly familiar user interface by using a markup-based UI and a small, high-performance, native code runtime. The Ribbon control helps developers improve usability by exposing your application's most frequently accessed features directly to end users. The Ribbon makes it easier for end users to find and use application features because functionality is more visible, resulting in greater productivity.

    6

    Background Services

    Services and background processes have tremendous influence on the overall performance and power profile of the system, and therefore the applications. If we could cut down on the total number of services, we could reduce the total power consumption and increase the overall stability of the system. The Windows 7 Service Control Manager has been extended so that a service can be automatically started and stopped when a specific system event, or trigger, occurs on the system. Trigger-start capabilities remove the need for services to start up automatically at computer startup and then poll or wait for an event to occur.

    7

    Windows 7 Instrumentation

    Windows 7 includes new Event Tracing for Windows (ETW) capabilities that developers can take advantage of during the development process to improve the application, like optimizing application performance. Instrumentation has always been part of Windows, but Windows 7 includes new ETW underlying technology that makes the task of including instrumentation in your application a whole lot easier.

     

    You can find more materials about Windows 7 development guidance in Windows 7 Training Kit for Developers.

     

    Related Threads:

     

    Use SetCurrentProcessExplicitAppUserModelID from Office VBA


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, August 21, 2009 2:50 AM
    Moderator
  • 2.    ACT & SUA

     

    a)     How do I determine if my application has administrative dependencies?  [Top]

     

    If your application behaves abnormally when running under a protected administrator account, the direct way to determine if the application has administrative dependencies is to try running it once as administrator. If the application starts working, then it has administrative dependencies. Next, you have to reset your computer, because the application may have “run once” bugs that the mere act of running the application will cause the behavior to change on subsequent executions. After resetting, you can use diagnostic tools like Standard User Analyzer to diagnose the administrative dependencies.


    Standard User Analyzer is helpful to identify an application's use of administrator privileges. The tool is able to record most administrative operations performed by an application, including registry/file system access and elevated API calls. This data is stored in a log file and is displayed within the tool. Microsoft recommends that developers run this tool to identify issues with running the application under a protected administrator account.

     

    Related threads:

     

    http://social.msdn.microsoft.com/Forums/en-US/windowscompatibility/thread/864824e9-1ae3-47a7-820b-e8dc98291218


     

    b)     What is the use of symbol path in SUA? How do I correlate SUA errors to problematic lines of code?  [Top]

     

    The symbol path is useful when you have a developer examining the application to change the code to fix the application. If the application is written in native code, the private symbols of your application will allow you to translate between wherever in memory the application code is at the moment, and the exact method in the code that requires elevated privileges.  The developer can go straight into the code to make the fix.


    Symbols, in combination with stack traces, allow you to see all of the functions that are currently being called by the application. They tell you not only where you are in the code, but how you got there.


    To correlate SUA error to problematic lines of code, you first need the matching private symbols of your binaries. Then in SUA, you can set Symbol Path on the App Info tab to point to your symbol files. A typical Symbol Path setting is

    C:\MyTestApp\;srv*c:\symbols*http://msdl.microsoft.com/download/symbols

    , where C:\MyTestApp\ is the location of the symbols files, and srv*c:\symbols*http://msdl.microsoft.com/download/symbols tells SUA to use Windows Symbol Server to interoperate the stack traces related to Windows modules.

    With the correct symbol setting, when you go to other tabs to view issues detected by SUA, you can double click on a particular issue (File, Registry, etc) and see the call stack at the bottom-right. There you can find the source line information that you are looking for. Below is a sample call stack with source line information outputted by SUA:


    MyApp!GetProcessElevation+4d (d:\MyApp\Test.cpp @ 296)
    MyApp!InitInstance+61 (d:\MyApp\Test.cpp @ 142)
    MyApp!wWinMain+6f (d:\MyApp\Test.cpp @ 59)
    MyApp!__tmainCRTStartup+28b (f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c @ 578)
    MyApp!wWinMainCRTStartup+f (f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c @ 403)
    kernel32!BaseThreadInitThunk+12 ( @ 0)
    ntdll!RtlInitializeExceptionChain+63 ( @ 0)
    ntdll!RtlInitializeExceptionChain+36 ( @ 0)

     

    Related threads

     

    Correlating SUA errors to problematic lines of code


     

    c)     What is a shim and where can I get documentation on the most frequently used shims?   [Top]

     

    A shim is a small piece of code that intercepts calls from application to the Windows operating system. It sits between the two, within the address space of the call of user mode space. It intercepts the calls and changes values either passing to the OS or coming back from the OS. Shim allows us to fix parameters, fix return values, or completely redirect the API call to something healthy to the application if the API is fundamentally changed. You can find more materials about shim in the article Understanding Shims, and in Chris Jackson’s blog: Windows Vista Shim Internals Basics: How Shims Work to Address Compatibility Issues (and What are the Ramifications?)


    The most frequently used shims are documented at
    http://technet.microsoft.com/en-us/library/cc722305(WS.10).aspx. Each child node in the tree is a fully documented shim. The help file of Application Compatibility Toolkit includes all the documents too.

     


     

    d)     How do I tell if a shim is being applied to a targeted executable?  [Top]

     

    The best way to determine if a shim is being applied to a targeted executable is to enable debug output from shims and view the output either in a debugger, or by using DebugView. To enable debug output, you can set the registry value:


    [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags]
    "ShowDebugInfo"=dword:00000009

    For more information about how to enable diagnostic output from shims, please refer to Chris Jackson’s blog:

     

    http://blogs.msdn.com/cjacks/archive/2008/05/20/enabling-diagnostic-output-from-shims.aspx


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, August 21, 2009 2:51 AM
    Moderator
  • 3.    UAC

     

    a)     How can I programmatically launch an un-elevated application from an elevated process?   [Top]

     

    A frequently asked question is “how do I launch an un-elevated application from an elevated process”, or fundamentally, “how do I launch a process using my un-elevated token once I’m running elevated”.  Since there is no direct way to do this, the situation can usually be avoided by launching the original application as standard user and only elevating those portions of the application that require administrative rights. In this way, there is always a non-elevated process that can be used to launch additional applications as the currently logged on desktop user.  This method is called as “bootstrapper”. However, sometimes an elevated process needs to get another application running un-elevated.  This can be accomplished by using the task scheduler within Windows.  The elevated process can register a task to run as the currently logged on desktop user.


     

    b)     Is there any API to detect if UAC is turned off?   [Top]

     

    UAC by design is difficult to check for. Most applications should not check for it and then act differently. You need to think over again why you need to know if UAC is turned off or not, and look for solutions that do not depend on the UAC setting. You can also post your reason in the forum, and we will help to find proper solutions.


     

    c)     Where should I write per-user data of my non-administrative application?   [Top]

     

    If you are writing a non-administrative application, such as a LOB application or a user application, such as a game, you must always write application data to a location that standard users can access. The following are some of the recommended requirements:

     

    ·         Write per-user data to:

    o    Option 1: FOLDERID_RoamingAppData / System.Environment.SpecialFolder.ApplicationData

    The user would never want to browse here in Explorer, and settings changed here should roam with the user. The default location is %appdata%, which is a hidden folder, on an installation of Windows Vista.

     

    o    Option 2: FOLDERID_LocalAppData / System.Environment.SpecialFolder.LocalApplicationData

    The user would never want to browse here in Explorer, and settings changed here should stay local to the computer. The default location is %localappdata%, which is a hidden folder, on an installation of Windows Vista.

     

    o    Option 3: FOLDERID_Documents / System.Environment.SpecialFolder.MyDocuments

    The user would want to browse  in Explorer and double click to open the file. The default location is %userprofile%\documents, which has explicit links throughout Explorer, on an installation of Windows Vista.

     

    ·         Write per-computer data to:

    o    Option 1: FOLDERID_ProgramData / System.Environment.SpecialFolder.CommonApplicationData.

    The user would never want to browse here in Explorer.  Settings changed here should affect every user on the machine. The default location is %systemdrive%\ProgramData, which is a hidden folder, on an installation of Windows Vista. You'll want to create your directory and set the ACLs you need at install time.

     

    o    Option 2: FOLDERID_Public / FOLDERID_PublicDocuments / System.Environment.GetEnvironmentVariable("public")

    The user would want to browse here in Explorer and double click to open the file. The default location is %public%, which has explicit links throughout Explorer, on an installation of Windows Vista. You'll want to create your directory and set the ACLs you need at install time.

     

    Please remember:

    1. Do not write per-user information or user-writable information to Program Files or Program directories.
    2. Do not use hard-coded paths in the file system. Take advantage of the KnownFolders API and ShGetFolderPath to find where to write data.


    Related documents:

     

    Where Should I Write Program Data Instead of Program Files? By Chris Jackson

     

    Related Threads:

     

    Will Vista let users access program files?


     

     

    d)     How do I patch application for standard user?   [Top]

     

    User Account Control (UAC) patching enables the authors of Windows Installer installations to identify digitally-signed patches that can be applied in the future by non-administrator users.

     

    http://msdn.microsoft.com/en-us/library/aa372388(VS.85).aspx

     

    Related thread:

     

    Question about UAC patching on Vista-patch certificate is not recognized.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, August 21, 2009 2:53 AM
    Moderator
  • 4.    Windows 7 Software Logo Program

     

    a)     What are the technical requirements of Windows 7 Client Software Logo Program?  [Top]

     

    1

    Clean, reversible, installation

    A clean, reversible, installation allows users to successfully manage (deploy and remove) applications on their systems.

    2

    Install to the correct folders by default

    Users should have a consistent and secure experience with the default installation location of files, while maintaining the option to install an application to the location they choose. It is also necessary to store application data in the correct location to allow several people to use the same computer without corrupting or overwriting each other's data and settings.

    3

    Digitally sign files & drivers

    An Authenticode digital signature allows users to be sure that the software is genuine. It also allows detection if a file has been tampered with, for example, infection by a virus.

    Kernel-mode code signing enforcement is a Windows feature known as code integrity (CI) that improves the security of the operating system, by verifying the integrity of a file each time the image of the file is loaded into memory. CI detects if malicious code has modified a system binary file. CI also generates diagnostic events and a system-audit log event when the signature of a kernel module fails to verify correctly.

    4

    Support x64 versions of Windows

    As 64-bit hardware becomes more prevalent, users expect application developers to take advantage of the benefits of 64-bit architecture by migrating their applications to 64-bit, or that 32-bit versions of the application run well under 64-bit versions of Windows.

    5

    Do not block installation or application launch based on OS version check

    It is important that customers are not artificially blocked from installing or running their applications when there are no technical limitations. In general, if applications were written for Windows Vista or later releases, they should have no reason to check the OS version.

    6

    Follow User Account Control (UAC) Guidelines

    Some Windows applications run in the security context of an administrator account, and many require excessive user rights and Windows privileges. Controlling access to resources enables users to be in control of their systems against unwanted 19 changes. The most important rule for controlling access to resources is to provide the least amount of access “standard user context” required for a user to perform his or her necessary tasks. Following UAC guidelines provides applications with the necessary permissions when needed, without leaving the system constantly exposed to security risks.

    7

    Adhere to Restart Manager Messages

    In the vast majority of cases, when users initiate shutdown they have a strong desire to see shutdown succeed.  They may be in a hurry to leave the office and "just want” their computers to turn off. Applications must respect this desire by not blocking shutdown.   While in most cases, a shutdown may not be critical, applications must be prepared for the possibility of a critical shutdown.

    8

    Do not load Services and Drivers in Safe Mode

    Safe mode allows users to diagnose and troubleshoot Windows. Unless needed for basic operations of the system (for example, storage device drivers) or for diagnostic and recovery purposes (for example, anti-virus scanners), drivers and services must not be set to load in safe mode.

    9

    Support Multiuser Sessions

    Windows users should be able to run concurrent sessions without conflict or disruption. Applications must ensure that when running in multiple sessions either locally or remotely, the normal functionality of the application is not impacted. Application settings and data files should not persist across users. A user’s privacy and preferences should be isolated to the user’s session.

     

    For additional information about Windows 7 Client Logo Program requirements, please see

     

    http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=27028822-b172-4cec-91a3-26b610a4da79.


     

    b)     Where do I download the Windows 7 Software Logo toolkit and how do I get help if I have problems running the toolkit?    [Top]

     

    You can download the documents of Windows 7 Software Logo Program from the link:

     

    https://connect.microsoft.com/Downloads/DownloadDetails.aspx?SiteID=831&DownloadID=17920

     

    The final release of Windows 7 Client Software Logo toolkit is available in the link:
      

    https://connect.microsoft.com/Downloads/DownloadDetails.aspx?SiteID=831&DownloadID=22783

     

    The final release Windows 7 Client Software Logo toolkit is supported through the Connect site.  Please use the Feedback section for any bugs or questions:

     

    https://connect.microsoft.com/feedback/default.aspx?SiteID=831


     

    c)     Can the final release of Windows 7 Software Logo toolkit be installed on a 32-bit system?    [Top]

        

    No, the final release of toolkit requires a 64-bit processor and 64-bit Windows 7 operation system.

    For more Technical FAQs, please refer to:

     

    https://connect.microsoft.com/content/content.aspx?ContentID=11911&SiteID=831

     

    For more Business FAQs, please read:

     

    https://connect.microsoft.com/content/content.aspx?ContentID=11912&SiteID=831

     

    Related thread:

     

    Windows® 7 logo program help...

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, August 21, 2009 2:55 AM
    Moderator
  •  

    5.    Where do I find additional references about Windows 7 development and application compatibility?  [Top]

     


    Windows 7 Development General


     

    Windows 7 Training Kit for Developers

    The Windows 7 Training Kit for Developers includes presentations, hands-on labs, and demos designed to help you learn how to build applications that shine on Windows 7. Key features include Win7 taskbar, libraries, multi-tough, sensors & location, ribbon, trigger start services, instrumentation, ETW, application compatibility.

     

    Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1

    The Windows SDK for Windows 7 and .NET Framework 3.5 SP1 provides documentation, samples, header files, libraries, and tools designed to help you develop Windows applications using both native (Win32®) and managed (.NET Framework) technologies.

     

    Windows 7 Developer Guide, MSDN version
    Build applications on a solid foundation; enable richer application experiences; and integrate the best of Windows and web services. The features and technologies of the Windows 7 operating system enable you to build the next generation of software applications. Download this guide to read descriptions of those features and see vivid screen shots from the pre-Beta version of Windows 7 released at PDC.

     

    A Developer's First Look at Windows 7

    This series of videos introduces Windows 7 with an emphasis on those new features that will be of most interest and use to developers. It consists of: two introductory sessions, one focusing on the new user interface, and one on behind-the-scenes features, two hour-long sessions that cover compatibility and security issues, six shorter sessions which focus on coding for a single new feature

     

    Engineering Windows 7 Blog

    Official blog dedicated to the engineering of Microsoft Windows 7

     

    Windows 7 Team Blog

    Announcements and updates of Windows 7


     

     

    Windows 7 Application Compatibility related Programs


     

    Windows 7 Software Logo Program

    The Windows 7 logo program aims to help customers make better purchase decisions by identifying products via the “Compatible with Windows 7” logo that have passed Microsoft-designed tests for compatibility and reliability on Windows 7. For software publishers looking to build on Windows 7, the program provides partners not only increased visibility through marketing support but also tools to help partners deliver products that they, and their end-users, can be confident will “just work” on Windows 7.

     

    Application Compatibility Factory (ACF)

    The Application Compatibility Factory (ACF) program is an initiative that teams Microsoft with Service Partners to help customers overcome application compatibility.  Partners can take advantage of the ACF Proof of Concept (PoC) Program to assist in accelerating EA renewals and to help customers more easily deploy Windows 7

     

    Front Runner

    Front Runner is an early adopter program that helps you get your applications compatible with the latest Microsoft technologies.  It can help Microsoft ISVs have their applications be listed in Windows 7 Compatibility Center.

     


     

    Windows 7 Application Compatibility


     

    Windows 7 and Windows Server 2008 R2 Application Quality Cookbook, MSDN version

    This document familiarizes Application Developers with how to verify the compatibility of their applications with the new operating system and provides an overview of the few known application compatibility issues in Windows 7 and Windows Server 2008 R2. It also points out differences in performance, reliability, and usability, and provides links to detailed white papers and other developer guidance.

     

    Developing Compatibility Applications for Windows 7

    This video discusses the top breaking changes moving an application from XP to Windows 7 – UAC and Session 0 isolation. It also covers possible impacts moving an application from Vista to Windows 7.

     

    ACT Windows 7 Application Compatibility Partner Training

    This is a recommended online training for Application Compatibility. 

     

    Application Compatibility: Windows 7 and Windows Server 2008 R2 Series

    This series of web seminars dive into business aspects of making your applications compatible with Windows 7/Windows Server 2008 R2.

     

    How-To-Guides: Application Compatibility for Windows 7 and Windows Server 2008 R2: New Features

    This series of short how-to sessions describe a number of enhancements to Windows 7 and Windows Server 2008 R2 that may have an impact on new or existing software applications and explains how you can correctly use the new features in new applications, as well as how to avoid problems they could cause in existing applications.

     

    How-To-Guides: Application Compatibility for Windows 7 and Windows Server 2008 R2: Known Causes of Incompatibility

    This is a series of short how-to sessions on issues known to cause compatibility problems. Each video in the series describes one or more issues and explains how they can be avoided in new applications, as well as how they can be mitigated in existing applications.

     

    How-To-Guides: Application Compatibility for Windows 7 & Windows Server 2008 R2: Writing High Quality Software

    This series of short how-to sessions presents information that can help developers write high quality software for Windows 7 and Server 2008 R2. It includes how to use new tools for troubleshooting and deployment.

     

    Inside Windows 7 User Account Control by Mark Russinovich

    Windows 7 carries forward UAC's goals with the underlying technologies relatively unchanged. However, it does introduce two new modes that UAC's PA account can operate with and an auto-elevation mechanism for some built-in Windows components. In this post, Mark covers the motivations behind UAC's technologies, revisits the relationship between UAC and security, describes the two new modes, and explains how exactly auto-elevation works. Note that the information in this post reflects the behavior of the Windows 7 release candidate, which is different in several ways from the beta.

     

    Chris Jackson’s Blog: The App Compat Guy

    Chris Jackson is an Architect and the Technical Lead for the Windows Application Experience SWAT Team. He is a geek of Win7 compatibility issues.

     

    Internet Explorer 8 new features, Internet Explorer 8 Compatibility View List

    This topic introduces the platform features of Internet Explorer 8.

     


     

    Related tools to troubleshoot Windows 7 Application Compatibility issues

     


    Microsoft Application Compatibility Toolkit 5.5

    The Microsoft Application Compatibility Toolkit (ACT) 5.5 helps customers understand their application compatibility situation by identifying which applications are compatible with the Windows 7 RC and Windows Vista® operating system and which require further testing. ACT helps customers lower their costs for application compatibility testing, prioritize their applications, and deploy Windows more quickly.

     

    Microsoft Application Verifier (download link)

    Application Verifier is a runtime verification tool for native code that assists in finding subtle programming errors that can be difficult to identify with normal application testing.

     

    Sysinternals tools

    Advanced system utilities to manage, troubleshoot and diagnose Windows systems and applications. Process Explorer and Process Monitor are particularly useful for application compatibility issues.

     

     

     

    Friday, August 21, 2009 2:57 AM
    Moderator