Windows 7 E Best Practices for ISVs

We are intent on providing people with the best possible experience using their PCs with Windows. Building on that important principle, we will ship the same version of Windows 7 in Europe as in rest of the world on the  worldwide launch date of 22 October, 2009. This version of Windows 7 includes Windows Internet Explorer 8 to help people get the most from their PCs and the Internet.

We will not ship E editions of Windows 7, which would not have included Internet Explorer.  Customers who pre-order Windows 7 will receive versions of the product that include Internet Explorer. Customers participating in the Windows Upgrade Option available with select new PCs running Windows Vista will also receive versions of Windows 7 that include Internet Explorer.  Customers in Europe will also be able to choose between upgrade and full versions of Windows 7.

I asked Giorgio Sardo, to write about the E editions for Windows 7 and the changes developers need to be aware of. Since the E edition for Windows 7 will ship without  Internet Explorer 8. Giorgio is the Technical Evangelist working on IE and other web technologies.

Yochay

In a previous post, we explained how Microsoft is working to fulfill our legal obligations in Europe for Windows 7. In the meantime, we received some questions about what the E editions of Windows 7 will mean for ISVs and developers.

I took the most common questions and posed them to Arik Cohen, a Program Manager who is working on the E editions of Windows 7. If you have other questions about how this could affect your applications, please add your comments to the post to let us know and we’ll work to get your questions answered.

Q: What are the differences between standard editions of Windows 7 and E editions of Windows 7?

A: The only functional difference is that the Internet Explorer 8 component is not available. This is the same component that your users can turn off in the “Turn Windows features on and off” control panel in the Windows 7 RC build. The Internet Web Platform components (for example, WebOC) are still installed and available on all editions of Windows 7, since they are part of the Windows core.

image

Q: How should I test my application to ensure that it will work without IE?

A: To get the same functional behavior as a clean install of the E editions of Windows 7, go to “Turn Windows features on and off” dialog and uncheck Internet Explorer 8. We recommend testing your application both without a browser installed and with a browser installed (remember to set the installed browser as the default).

Q: What happens if I try to open a link without a browser installed?

A: You will get an “Application not found” exception.

image

Q: What general impacts of Windows 7 E editions have you seen on applications – especially ones that rely on the WebOC?

A: During our application compatibility testing, we’ve found that the vast majority of applications work on Windows 7 E editions without any changes. This includes applications that use many of the Internet Web Platform embedding methods (including WebBrowser control, hosting Trident, and HTML Help).

For instance, the following screenshot shows a .NET application that embeds the WebBrowser control running correctly on the E edition of Windows 7.

image

Q: My Windows application (WPF, Win Forms, Java, etc.) uses the Web Browser control. Is there any compatibility issue?

A: Everything should work as expected. However, we’ve seen some issues when applications depend directly on a specific browser. In particular, if while using the Web Browser control, you allow the application to open new windows that do not respect the user’s default browser choice, you may see some issues.

Q: What are the most common issues that you have found in your testing of applications? And what do you recommend ISVs do about them?

A: I have seen applications encounter three classes of issues on E editions of Windows 7:

  1. The application has hard coded dependencies to launch Internet Explorer when starting a browser to access the net. This is normally done by explicitly launching “iexplore.exe http://contoso.com” rather than running a ShellExecute on http://contoso.com. This generates an exception on a Windows 7 system without IE installed and enabled. There are times when this is intentional (for example, the Web site you are opening is only supported on IE), in which case you probably want to check for IE availability and provide a good error message to the user if it’s not available.

    We’ve seen this many times, especially in instances where the desired behavior is to open the application in the user’s default browser. You will need to switch to using the more generic case for these scenarios.

  2. The application allows launching a new window from within the WebBrowser control (for example, user accesses “Open in New Window” via the content menu, the page does a window.open() call, etc.).

    These links would always have opened in IE (regardless of the default browser on the system). If you designed your application to open in the default browser, you will need to provide a function that allows that.

    The recommended way to implement custom behavior when opening a new window is to use the NewWindow3 event. Sample code to hook this up in a C# .NET application would look like the following examples.

    In the form initialization code:

    webBrowser1.Navigate("about:blank");
    SHDocVw.WebBrowser web1 =
    (SHDocVw.WebBrowser)webBrowser1.ActiveXInstance;

    web1.NewWindow3 +=
    new SHDocVw.DWebBrowserEvents2_NewWindow3EventHandler(web1_NewWindow3);
    
    

    And the handler:

    void web1_NewWindow3(
    ref object ppDisp,
    ref bool Cancel,
    uint dwFlags,
    string bstrUrlContext,
    string bstrUrl )
    {
    Process.Start(bstrUrl);
    Cancel = true;
    }
    
    
     
  3. Applications don’t handle cases where no browser is installed on the system. We have seen applications that don’t handle this failure case when executing a URL.

    These tend to occur when users don’t have a default browser on their systems and then try to click a “go online for more information” link. We think this is going to be an extremely narrow case – even so, applications should handle these failures gracefully.

Q: How do I identify the user’s default browser?

A: Use the IApplicationAssociationRegistration::QueryCurrentDefault API to determine the registered browser by checking QueryCurrentDefault(“http”, AT_URLPROTOCOL,  AL_EFFECTIVE, out progID).

Q: My app needs to open the browser. What are the best practices?

A: Run shellexecute() without hard-coding the name of the browser. Respect the user’s choice of default browser and gracefully handle cases where no browser is installed on the system.

Q: How can I check if I’m running in one of the E edition for Windows 7?

A: The GetProductInfo() API (introduced in Windows Vista) is how to tell exactly what edition of Windows you are running. The new constant values for the E editions of Windows 7 will be available in the Windows 7 SDK.

Example of code to determine if you are running on Home Premium vs. Ultimate:

[DllImport("Kernel32.dll")]
internal static extern bool GetProductInfo(
int osMajorVersion,
int osMinorVersion,
int spMajorVersion,
int spMinorVersion,
out uint edition);


private void CheckEdition()
{
uint edition;
GetProductInfo(6, 1, 0, 0, out edition);

switch ((ProductEditions)(edition))
{

case ProductEditions.HOMEPREMIUM :
case ProductEditions.HOMEPREMIUME:
case ProductEditions.HOMEPREMIUMN:

MessageBox.Show("Running on a Home Premium edition");
break;

case ProductEditions.ULTIMATE :
case ProductEditions.ULTIMATEE:
case ProductEditions.ULTIMATEN:
MessageBox.Show("Running on an Ultimate edition");
break;

}
}


 

Q: Are the E editions of Windows 7 going to be available on MSDN? If so, when?

A: Yes, both the E editions of Windows 7 and the standard editions will be available on MSDN at the same time.

Q: What about the Internet Explorer 8 Feature Pack for Windows 7 E? If and when will Microsoft release it to the public?

A: Yes, the Internet Explorer 8 Feature Pack for Windows 7 E will be available on the Microsoft Download Center soon after Windows 7 becomes generally available.

Giorgio Sardo

IE Technical Evangelist – Microsoft Corp


Comments

  1. Posted on: July 13, 2009 at 9:16AM  

    Can you please tell me will chm help work in Win7 E? As far as I know it uses Internet Explorer. If no what would you recommend for help files creation?

    Thank you!

  2. Posted on: July 13, 2009 at 11:07AM  

    From the article (emphasis added)

    "the Internet Explorer 8 Feature Pack for Windows 7 E will be available on the Microsoft Download Center soon AFTER Windows 7 becomes generally available"

    Surely the feature pack should be posted BEFORE win7 comes out so that we can choose to download it in advance and thus avoid the inevitable slow downloads / crashed servers that will happen when everone who pre-ordered in Europe tries to download the pack at the same time!!

    Also if it is out after win7 then those of us with a single computer won't be able to install our new software until we have this pack, i.e. if we don't wait we won't be able to download it due to no web browser.

  3. Posted on: July 13, 2009 at 12:00PM  

    Some applications get proxy settings from Internet Explorer in order to access the internet (WinHttpGetIEProxyConfigForCurrentUser).  What's an alternative way to configure proxy settings on the E editions?  Thanks.

  4. Posted on: July 14, 2009 at 11:49PM  

    great post. thanks for being proactive.

  5. Posted on: July 14, 2009 at 11:49PM  

    great post. thanks for being proactive.

Trackbacks

  1. Posted by: Windows 7 E Best Practices for ISVs and developers on July 13, 2009 at 4:02AM

    Pingback from  Windows 7 E Best Practices for ISVs and developers

  2. Posted by: Windows 7 E Best Practices for ISVs « Jasper Blog on July 13, 2009 at 7:40AM

    Pingback from  Windows 7 E Best Practices for ISVs « Jasper Blog

  3. Posted by: Microsoft shares more developer-focused Windows 7 E details | All about Microsoft | ZDNet.com on July 13, 2009 at 9:27AM

    Pingback from  Microsoft shares more developer-focused Windows 7 E details | All about Microsoft | ZDNet.com

  4. Posted by: O wszystkim i o niczym » Szczeg????y techniczne na temat Windows 7 E on July 13, 2009 at 11:44AM

    Pingback from  O wszystkim i o niczym » Szczeg????y techniczne na temat Windows 7 E

  5. Posted by: NewsPeeps on July 13, 2009 at 12:05PM

    Thank you for submitting this cool story - Trackback from NewsPeeps

  6. Posted by: I'm a PC Blog on July 13, 2009 at 1:27PM

    Windows 7 information is just flying in right now, the latest is more news on Windows 7 E ( the EU version

  7. Posted by: 4sysops - Windows 7 availability for businesses – Microsoft Assessment and Planning Toolkit 4.0 RTM – Windows 7 E details emerge – Next-gen Forefront pricing on July 13, 2009 at 3:30PM

    Pingback from  4sysops -   Windows 7 availability for businesses – Microsoft Assessment and Planning Toolkit 4.0 RTM – Windows 7 E details emerge – Next-gen Forefront pricing

  8. Posted by: More Windows 7E details come to light | Windows 7 Center on July 13, 2009 at 7:28PM

    Pingback from  More Windows 7E details come to light | Windows 7 Center

  9. Posted by: More Windows 7 E details emerge : CRshare.com on July 13, 2009 at 8:52PM

    Pingback from  More Windows 7 E details emerge : CRshare.com

  10. Posted by: More Windows 7E details come to light on July 13, 2009 at 9:00PM

    Pingback from  More Windows 7E details come to light

  11. Posted by: More Windows 7E details come to light on July 13, 2009 at 9:00PM

    Pingback from  More Windows 7E details come to light

  12. Posted by: Windows 7 E Best Practices for ISVs - Computer Forums on July 13, 2009 at 9:28PM

    Pingback from  Windows 7 E Best Practices for ISVs - Computer Forums

  13. Posted by: Tech News, Resources from Blogosphere – 14 July 09(3) | Hostgator Hosting on July 13, 2009 at 10:25PM

    Pingback from  Tech News, Resources from Blogosphere – 14 July 09(3) | Hostgator Hosting

  14. Posted by: Windows 7 E Information For Developers | Windows 7 News on July 14, 2009 at 4:56AM

    Pingback from  Windows 7 E Information For Developers | Windows 7 News

  15. Posted by: Windows 7 E Details Emerge « Komplett Ireland on July 14, 2009 at 6:50AM

    Pingback from  Windows 7 E Details Emerge « Komplett Ireland

  16. Posted by: Windows 7 E Information For Developers | ProHostGold News & Blog Technology on July 14, 2009 at 8:00AM

    Pingback from  Windows 7 E Information For Developers | ProHostGold News &  Blog Technology

  17. Posted by: Windows 7 E Information For Developers | Windows 7 News,Themes,Tips,Downloads on July 14, 2009 at 8:15AM

    Pingback from  Windows 7 E Information For Developers | Windows 7 News,Themes,Tips,Downloads

  18. Posted by: No windows 7 upgrades in the UK - Multiplay UK Forums on July 14, 2009 at 8:56AM

    Pingback from  No windows 7 upgrades in the UK - Multiplay UK Forums

  19. Posted by: Como baixar um navegador no Windows 7 E » Guia do PC on July 17, 2009 at 1:21PM

    Pingback from  Como baixar um navegador no Windows 7 E » Guia do PC

  20. Posted by: Tune Up Your PC » Post Topic » Getting Ready for Windows 7 Part 2: Microsoft Programs to Help Get Apps Compatible on July 22, 2009 at 3:49AM

    Pingback from  Tune Up Your PC  » Post Topic   » Getting Ready for Windows 7 Part 2: Microsoft Programs to Help Get Apps Compatible

  21. Posted by: Como baixar um navegador no Windows 7 E | Arkanoidworld on July 22, 2009 at 7:42PM

    Pingback from  Como baixar um navegador no Windows 7 E | Arkanoidworld

  22. Posted by: Windows 7 for Developers on July 23, 2009 at 3:29AM

    Yesterday Windows 7 completed a major milestone-- release to manufacturing (RTM)! And in three months

  23. Posted by: Is Your Application Ready for Windows 7 RTM? | Windows Seven 7 on July 23, 2009 at 3:43AM

    Pingback from  Is Your Application Ready for Windows 7 RTM? | Windows Seven 7

  24. Posted by: Is Your Application Ready for Windows 7 RTM? | Windows 7 Information, News, Downloads, Support Forums on July 23, 2009 at 7:40AM

    Pingback from  Is Your Application Ready for Windows 7 RTM? | Windows 7 Information, News, Downloads, Support Forums

  25. Posted by: Como instalar um browser no Windows 7E - Explorando e Aprendendo on July 25, 2009 at 6:05AM

    Pingback from  Como instalar um browser no Windows 7E - Explorando e Aprendendo

  26. Posted by: Como instalar um browser no Windows 7E - Explorando e Aprendendo on July 25, 2009 at 6:07AM

    Pingback from  Como instalar um browser no Windows 7E - Explorando e Aprendendo

  27. Posted by: Empfohlene Artikel 14.07.2009 | funnydingo.de on August 03, 2009 at 7:14AM

    Pingback from  Empfohlene Artikel 14.07.2009 | funnydingo.de

  28. Posted by: Windows 7 na Europa permitir???? escolher entre alguns browsers » AKINFORM??TICA on August 29, 2009 at 5:58AM

    Pingback from  Windows 7 na Europa permitir???? escolher entre alguns browsers »  AKINFORM??TICA