Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

September, 2006

  • Aaron Stebner's WebLog

    How Windows Installer interacts with UAC in Windows Vista

    • 0 Comments

    Robert Flaming has been posting a series of articles describing how Windows Installer interacts with the User Account Control (UAC) feature that is being introduced in Windows Vista.  These articles contain information not included in the Windows Installer SDK topics related to UAC.  So far, he has published 20 articles (linked individually below).  I highly encourage any setup developer who plans to build MSIs that target Windows Vista to read this series, and to check in on Robert's blog for possible future updates regarding Windows Installer and UAC.

    Introductory topics

    1. ...the UAC in MSI Notes series
    2. ...my view of the root problem
    3. ...the conflicting per-user definition
    4. ...it'll be just like Managed Installs
    5. ...the jagged edge to user
    6. ...my relief providing framework

    Architecture insights

    1. The "Saw Tooth" Diagram
    2. Credential Prompt and Permissions

    Common MSI package authoring mistakes

    1. The AdminUser Mistake
    2. Modify System with InstallUISequence Custom Action
    3. Modify System with InstallExecuteSequence Custom Action Outside of Script
    4. The NoImpersonate Bit Mistake

    More architectural insights

    1. The "Four Square" Diagram
    2. Challenges for a Beautiful Custom Action
    3. O Whitepaper, Where Art Thou?
    4. Read the Friendly Manual

    Conversations with customers

    1. Should I write my installer as a Standard User install? If yes, how?
    2. When General Custom Action Mitigation Fails
    3. How do I get the shield on the advertised shortcut?
    4. How do I troubleshoot UAC in MSI via log files?

     

  • Aaron Stebner's WebLog

    Algorithm for launching Windows Media Center and browsing to a specific experience

    • 5 Comments

    A while back, I posted an item on the Media Center Sandbox blog that described how to directly launch Windows Media Center and have it navigate to a specific experience using some command line parameters available within the Windows Media Center Shell application.  Since then, several folks have asked me about those command line parameters and whether there were more.

    The specific problem that most people noted was that the command line ehshell.exe /directmedia:tv navigates to the Recorded TV gallery and not to Live TV.  Unfortunately, there is not a command line parameter that allows direct navigation to Live TV.

    However, there is another mechanism that can be used to launch Windows Media Center and browse to a specific experience, including Live TV.  I'm going to describe the algorithm in words here:

    1. Call the Win32 FindWindow API and pass in Media Center Tray Applet for the class name and NULL for the window name
    2. If the FindWindow API returns NULL, display an error and exit
    3. Call the Win32 RegisterWindowMessage API, pass in Media Center Navigate To Page and save the result
    4. Call the Win32 SendMessageTimeout API and pass in the window returned in step 2, the message registered in step 3, and as the WPARAM and LPARAM, the desired values from the tables listed below
    5. If the SendMessageTimeout API returns 0, the browse failed

    WPARAM values to use for browsing

    • WPARAM = 0: Windows Media Center Start Menu
    • WPARAM = 1: Live TV
    • WPARAM = 2: TV Guide
    • WPARAM = 3: My TV
    • WPARAM = 4: Recorded TV
    • WPARAM = 5: My Music
    • WPARAM = 6: My Photos
    • WPARAM = 7: Scheduled Recordings
    • WPARAM = 8: My Videos
    • WPARAM = 9: Radio
    • WPARAM = 12: Online Spotlight (this value is only availabe in Update Rollup 2 for Windows XP Media Center Edition 2005 and later)
    • WPARAM = 13: Extensibility application (this value is only availabe in Update Rollup 2 for Windows XP Media Center Edition 2005 and later)

    LPARAM values to use for browsing

    • LPARAM = 0: Start Windows Media Center in the last used state (full-screen or windowed)
    • LPARAM = 1: Start Windows Media Center full-screen

    Notes:

    This algorithm works regardless of whether the Windows Media Center UI is currently running. It also correctly handles bringing the Windows Media Center UI to the foreground.  This is the only officially supported method of browsing to the Windows Media Center UI from an external application.  This mechanism was first made available in Windows XP Media Center Edition 2004.

    New values might be added to the WPARAM and LPARAM tables with new versions of Windows Media Center.

    I've also created a sample Win32 application that implements the above algorithm.  You can find more information about that sample application and download the source code and the executable from this blog post.

    <update date="1/14/2009"> Added a link to the sample application that I created to demonstrate how to implement this algorithm. </update>

     

  • Aaron Stebner's WebLog

    Visual Studio 2005 SP1 beta now available for download

    • 2 Comments

    I noticed a post on Soma's blog (vice president of the Developer Division at Microsoft) earlier today indicating that a beta version of Visual Studio 2005 SP1 is now available for download on the Microsoft Connect site.  I have had a few folks ask me via blog comments about the availability of this service pack, so I'm glad to see it is now available for download now. 

    I encourage you to sign up for this beta program using this link and then download it and try it out.  You can provide feedback on the beta version of the service pack on the Connect site as well.

     

  • Aaron Stebner's WebLog

    New Windows Media Center XBAP application now available: Big Screen Business

    • 2 Comments

    Niall Ginsbourg from Mobilewares (the same person who created the Flickr photo browser XBAP application for Windows Media Center for Windows Vista) recently released a public beta version of a new XBAP application for Windows Vista.  This application is named Big Screen Business.  It is a 3-dimensional graphical application that you can use to monitor business and financial information such as the following:

    • Monitor global markets and indices
    • Create custom stock watch lists
    • Monitor profits and losses on holdings and options
    • View world currency exchange rates

    You can find a more detailed list of features on this page, and you can download a version of the application from this page and try it out.

    Some interesting behind-the-scenes aspects of this application are the following:

    • It has been tested and verified to work on Windows Vista RC1 (both x86 and x64)
    • It uses this algorithm to ensure that only a single instance of the application will run at any given time
    • It uses this algorithm to manage backwards navigations within the application so that pressing back on the Windows Media Center remote control does not take the user all of the way out of the application
    • It ships as a standalone XBAP that can be run from a web browser and as an MSI package that will install and register the XBAP for use within Windows Media Center for Windows Vista
    • The MSI for the Windows Media Center package is built using WiX and is based on the example I described in this blog post

    I encourage you to try out this application even if you are not interested in the financial scenarios that it is designed to track, if for no other reason than to check out the 3D UI and visual effects.

    <update date="9/26/2006"> Added a new bullet to the behind-the-scenes facets of this application with a link to a post describing how to manage back navigations in XBAP applications </update>

     

  • Aaron Stebner's WebLog

    Important note about using RegisterMceApp and RegisterApplication

    • 0 Comments

    A couple of folks on the Windows Media Center team tried out the Veronica's Radio sample that Charlie Owen posted on the Media Center Sandbox site last week and ran into an issue that is worth mentioning to a wider audience.

    The installation batch file included with that sample application calls RegisterMceApp with the following command line:

    %windir%\ehome\registermceapp.exe veronicasradio.xml

    This command line registers this application for the currently logged in user only.  As a result, users who register this application on the console will not see this application when they access Windows Media Center using an extender device such as an Xbox 360 (because extenders run in the context of a separate user account on the system).

    If you want to install and register a Windows Media Center application and ensure that it will be available for Windows Media Center extenders as well as the user logged in on the console, you should call RegisterMceApp with the /allusers switch.  For example, to register Veronica's Radio you would use a command line like the following:

    %windir%\ehome\registermceapp.exe /allusers veronicasradio.xml

    If you run RegisterMceApp with the /allusers switch from a cmd prompt, you will need to make sure that the cmd prompt is running with elevated privileges because the /allusers switch causes RegisterMceApp to create registry entries under HKEY_LOCAL_MACHINE, which cannot be done with normal user permissions.  You can open an elevated cmd prompt by using the following steps:

    1. Go to the Start menu
    2. Choose All Programs, then Accessories
    3. Right-click on the Command Prompt item and choose Run as administrator
    4. Click continue on the pop-up dialog that appears

    Please note that the sample installer source files that I posted here and here call RegisterMceApp with the /allusers flag, so if you are using those as the basis for building your application installer, you will already be getting this behavior for free.

     

  • Aaron Stebner's WebLog

    Forum post for Windows Communication Foundation (Indigo) RC1 installation issues

    • 0 Comments

    A friend of mine sent me a link today to an MSDN Forum post with a list of known issues and suggested workarounds if you are having trouble installing the .NET Framework 3.0 (formerly WinFX Runtime Components) RC1 build.  This post focuses specifically on known issues that affect Windows Communication Foundation (WCF, formerly known as Indigo).

    If you are running into issues with .NET Framework 3.0 RC1 setup or are having trouble using WCF after uninstalling a previous beta and upgrading to RC1, check out this post on the MSDN Forums for more detailed troubleshooting suggestions.

     

  • Aaron Stebner's WebLog

    Mailbag: Creating an installable layout for non-English Visual Studio 2005 Express Editions

    • 0 Comments

    Question:

    I found your blog article describing how to create an installable network layout for the Visual Studio 2005 Express Editions.  I want to use these steps to create layouts for non-English versions of the Express Editions.

    I saw the section titled Additional notes for non-English Express Editions, and in that section you stated that the URLs are different in the non-English data files.  When I look at the data files for a non-English Express Edition, the URLs appear to be identical to the ones in the English data files.  Also, when I try to download the files from those URLs, it appears to be downloading the English binaries.

    How can I create an installable layout for a non-English Express Edition?

    Answer:

    The URLs for the binaries that are a part of the Express Editions are forwarding links (fwlinks) and they should automatically redirect to the correct non-English version if you attempt to navigate to them and download the binaries on a non-English OS.  For example, if you are downloading the files to create an installable layout on a Spanish version of Windows, the URLs will redirect to the Spanish version of the binaries.

    If you want more granular control over which language version is downloaded, you can add the specific language code information to the end of each URL when you download the binaries.  Although it is not listed in the previous blog article, you can add a variable to the end of each URL to specify the exact language to download.  The variable is named clcid and it can be set to the hexadecimal value that corresponds to the language code (LCID) for the desired language.

    For example, the previous article lists the URL http://go.microsoft.com/fwlink/?LinkId=51433 to download SQL Express.  If you want to download the Spanish version of SQL Express, you can add the clcid value 0x40C (which is the hexadecimal value 3082) and create a new URL that looks like the following: http://go.microsoft.com/fwlink/?LinkId=51433&clcid=0x40C.

    The following table lists the clcid value to add to the end of each URL listed in the previous blog article in order to download specific language versions of the Visual Studio 2005 Express Edition binaries and create an installable layout:

    Language LCID URL suffix
    Chinese (Traditional) 1028 clcid=0x404
    German 1031 clcid=0x407
    English 1033 clcid=0x409
    French 1036 clcid=0x40C
    Italian 1040 clcid=0x410
    Japanese 1041 clcid=0x411
    Korean 1042 clcid=0x412
    Chinese (Simplified) 2052 clcid=0x804
    Spanish 3082 clcid=0xC0A

     

  • Aaron Stebner's WebLog

    How to prevent Windows Media Center from launching multiple copies of your application

    • 3 Comments

    I posted an item on the Media Center Sandbox site today that I wanted to link here as well in case anyone is interested.  Windows Media Center maintains separate process spaces for each application that is launched and stores up to 8 of them in a back-stack to allow users to navigate back to their previous experiences.  Because of this feature, it is possible to launch multiple instances of a Windows Media Center application.  This can lead to performance bottlenecks and resource contention issues.

    Jossef Goldberg, a program manager on the Windows Presentation Foundation (WPF) team, recently published some sample code that demonstrates how to implement a solution that uses a mutex to prevent Windows Media Center from launching more than one instance of an application.

    I encourage you to check out my Sandbox blog post for a more in-depth description of the algorithm to address this issue, and also to check out this post from Jossef for a link to download a sample XBAP solution that uses this algorithm.

     

  • Aaron Stebner's WebLog

    Using the Q helix UI to create a custom streaming radio application

    • 0 Comments

    Charlie Owen posted an item on the Media Center Sandbox site today that I wanted to draw your attention to if you haven't seen it yet.  He took the twisted helix UI from the Q sample application that is a part of the Windows Media Center SDK, created a custom color skin for it, and added some calls to the Windows Media Center PlayMedia API to create an internet radio playback application.

    This application is a Windows Media Center Presentation Layer web application, so you do not have to install anything to try this out on your Windows Vista RC1 system.  You can use these steps to try it out:

    1. Download this ZIP file and extract the contents to your RC1 system
    2. Run the file named setup.veronicasradio.cmd by double-clicking on it
    3. Launch Windows Media Center, navigate to Online Media | Program Library and then click on Veronicas Radio

    This is just one simple example of the type of UI and functionality you can create in a very short amount of time using Media Center Markup Language.  Hopefully you'll give it a try and then create your own application using the Windows Media Center SDK for Windows Vista....

     

  • Aaron Stebner's WebLog

    How to directly launch a Windows Media Center application from Visual Studio 2005

    • 3 Comments

    I wrote this post on the Media Center Sandbox blog earlier tonight that I wanted to link to here as well in order to improve discoverability.

    In this post, I describe a set of steps that caon be used to modify the configuration for a Windows Media Center Presentation Layer Application (created from the project templates installed as part of the Windows Media Center SDK for Windows Vista) so that you can register and launch the application directly within Windows Media Center when you press F5 in the Visual Studio IDE.  I have found this type of configuration useful because it saves me from needing to uninstall and reinstall the application assembly to the GAC each time I rebuild it.

    I encourage you to check out this post for an additional debugging option for Windows Media Center applications in Windows Vista.

     

  • Aaron Stebner's WebLog

    Real world example of a Windows Media Center application setup built with WiX

    • 9 Comments

    I have previously posted an article and a follow-up blog post describing how to use WiX to build MSI packages for Windows Media Center applications.  I decided it would also be helpful to show a more concrete example of a setup package for a real Windows Media Center application, so I created a WiX source (WXS) file and a build script that can be used to create an installer for the Q Media Center Podcast and Videoblog Client sample application that ships as part of the Windows Media Center SDK for Windows Vista.

    I have posted a ZIP file at this location that contains the WXS file, a set of setup UI strings and a build script batch file that can be used to build an installer for the Q sample application.  The WXS file for Q (also available separately at this location) is fully annotated to describe what each part of the MSI is designed to do, and I encourage you to read those comments to get a better sense of how this installer functions behind the scenes.

    You can use the following steps to build an installer for the Q sample application on your own system using the setup files that I created:

    1. Install Windows Vista Release Candidate 1
    2. Install Visual Studio 2005 or Visual C# 2005 Express Edition
    3. Install the Windows Media Center SDK for Windows Vista RC1
    4. Create a directory named c:\wix on your Windows Vista RC1 system
    5. Download the latest WiX version 2.0 binaries ZIP file from this location and extract the contents to c:\wix on your Windows Vista RC1 system
    6. Download the WXS file and build script that I created from this location and extract the contents to c:\wix on your Windows Vista RC1 system
    7. Right-click on the shortcut for Visual Studio 2005 or Visual C# 2005 Express Edition, choose Run as administrator and click Continue to launch Visual Studio with elevated privileges
    8. Open the Q project - it will be installed to %programfiles%\Microsoft SDKs\Windows Media Center\v5.0\Samples\Windows Media Center Presentation Layer Samples\Q if you installed the Windows Media Center SDK to the default location
    9. Click on the Build menu and choose Rebuild Solution to build the Q binaries
    10. Click on the Windows Start menu, choose All Programs, then Accessories
    11. Right-click on the item named Command Prompt, choose Run as administrator and click Continue to launch an elevated command prompt
    12. Type cd /d c:\wix
    13. Type build_q.bat to build the installer for the Q sample application.  It will create an MSI named Q_Podcast_Client.msi at %programfiles%\Microsoft SDKs\Windows Media Center\v5.0\Samples\Windows Media Center Presentation Layer Samples\Q\bin\release by default.

    Now you can run Q_Podcast_Client.msi to install the application on a Windows Vista Home Premium or Ultimate system.

    There are a couple of important notes to keep in mind when using these sample setup files:

    • This is very important - do NOT change the component GUIDs of any of the Q components in q.wxs, and do NOT copy and paste these GUIDs into any other WXS files.  If you do so, you will end up violating the Windows Installer component rules, which causes problems for installing and uninstalling products.  Additional information about the component rules can be found in this blog post by Rob Mensching (which is highly recommended reading if you are building MSI packages).
    • The build_q.bat script requires that you have already built the Q binaries (Q.dll and Interop.Microsoft.Feeds.Interop.dll)
    • The build_q.bat script assumes that you have installed the Windows Media Center SDK to the default location.  You will need to open that batch file in a text editor such as notepad and update the Q_SRC_PATH variable if you installed to a non-default path or installed on a 64-bit OS.
    • The build_q.bat script uses the release build of the Q binaries by default.  If you run build_q.bat debug, it will use the debug binaries instead

    There is also an advanced technique you can use in the Visual Studio IDE to automatically build the MSI each time you recompile the Q binaries.  You can use the following steps to configure a post-build event in the Q project that will run build_q.bat each time you compile the project:

    1. Right-click on the shortcut for Visual Studio 2005 or Visual C# 2005 Express Edition, choose Run as administrator and click Continue to launch Visual Studio with elevated privileges
    2. Open the Q project - it will be installed to %programfiles%\Microsoft SDKs\Windows Media Center\v5.0\Samples\Windows Media Center Presentation Layer Samples\Q if you installed the Windows Media Center SDK to the default location
    3. Right-click on the Q project in the Solution Explorer and choose Properties
    4. Select the Build Events tab
    5. Add a new entry to the Post-build event command line text box that says c:\wix\build_q.bat.
    6. Click on the File menu and choose Save All
    7. Click on the Build menu and choose Rebuild Solution

    After adding build_q.bat as a post-build event and rebuilding the project in the Visual Studio IDE, you will see Q_Podcast_Client.msi created in %programfiles%\Microsoft SDKs\Windows Media Center\v5.0\Samples\Windows Media Center Presentation Layer Samples\Q\bin\release on your system.

    Hopefully you will find this real world example useful as you work on creating and deploying Windows Media Center applications for Windows Vista.  As always, please let me know if you have any questions or run into trouble getting the above steps to work correctly on your system.

     

  • Aaron Stebner's WebLog

    Windows Media Center SDK for Windows Vista RC1 is now available for public download

    • 2 Comments

    This afternoon, we posted the RC1 build of the Windows Media Center SDK for Windows Vista (build 5600.16384) on the Microsoft Download Center.  That means that anyone can download it and try it out - it is not restricted to members of the Windows Vista beta program.  You can download it from this location:

    http://www.microsoft.com/downloads/details.aspx?FamilyId=234F5003-F24E-4EF5-B930-442EC57737D0&displaylang=en

    We will be updating the link on the MSDN home page for Windows Media Center in the near future to point to this download location as well.

    Please let us know any feedback you have about the RC1 build of the Windows Media Center SDK and also ask any questions you might have at the Media Center Sandbox discussion forums.

     

  • Aaron Stebner's WebLog

    New episode of the Media Center Show that covers WPF development

    • 0 Comments

    Ian Dixon posted a new edition of the Media Center Show this past week that I wanted to point out in case you haven't seen it yet.  Ian had Jossef Goldberg (a program manager on the Windows Presentation Foundation team) and Unni Ravindranathan (a program manager on the Expression team) on the show to discuss WPF development for Windows Media Center for Windows Vista.

    They cover a range of topics, including where to go to get started, development and design tools that are available for WPF, Windows Media Center integration, testing, and examples of WPF XBAP applications already under development for Windows Media Center.

    You can listen to the entire broadcast of this episode by clicking on this link: Media Center Show #74 - WPF Development.

    Also, make sure to stay tuned to future editions of the Media Center Show.  I did an interview with Ian a couple of weeks ago about Media Center Markup Language development and he is planning a future 2-part show about this topic.

     

  • Aaron Stebner's WebLog

    What not to do when creating an MSI-based setup

    • 5 Comments

    A couple of days ago, I described a setup failure that I ran into and outlined how I approached solving it.  While investigating that issue, I found a couple of problems with the design of the setup package that I was trying to help the customer install.  I wanted to describe these problems and try to encourage anyone reading this to not do these things when developing your own installers.

    To provide a bit of background, the customer could not install the Enterprise Instrumentation Framework package because of a custom action failure for the action named IsDotNetInstalled.

    Issue #1: Jscript-based custom actions

    While investigating the original installation failure, I found that several custom actions in the Enterprise Instrumentation Framework setup package are implemented using JScript.  There are multiple reasons why this is a bad thing to do.  To paraphrase this post by Rob Mensching:

    1. Many anti-virus programs have script blocking functions that can cause setups with script custom actions to fail and roll back 
    2. Writing robust code in a scripting language is difficult to write
    3. Debugging script that is running in the context of a Windows Installer-based setup is difficult

    Issue #2: Implementing a custom action to do something a standard action can do

    Because the IsDotNetInstalled custom action in the Enterprise Instrumentation Framework setup package is script-based, I was able to extract it from the MSI using steps described here and examine it in more detail.

    When I did that, I found that the IsDotNetInstalled function in the custom action script queries registry values to determine whether or not the .NET Framework 1.0 and 1.1 are installed on the user's system.  This type of prerequisite checking can be accomplished with standard actions in Windows Installer - namely the AppSearch and RegLocator tables.

    Summary

    I want to point out the above issues because of this one overarching fact - if the above 2 issues had not existed in the Enterprise Instrumentation Framework setup package, the customer would have been able to install this product without needing to contact me for assistance despite the fact that one of the Windows script DLLs was not registered correctly on their system.  This setup failure was therefore totally avoidable had the setup been developed with some Windows Installer best practices in mind.

     

  • Aaron Stebner's WebLog

    New Windows Media Center add-in registration custom action DLL

    • 0 Comments

    Niall Ginsbourg from Mobilewares (the same person who is working on the Flickr photo browser for Windows Media Center for Windows Vista) has posted an item on the Media Center Sandbox discussion forum that I wanted to link to here as well.  He has created a custom action DLL that can be used to register an application with Windows Media Center when creating a setup package for a Windows Media Center application in Visual Studio 2005.

    The features of this new custom action DLL, which Niall has named MCECustomRegApp.dll are the following (paraphrased from Niall's post on the Sandbox forum):

    1. Support for the .NET Framework 2.0 and Windows Vista
    2. Allows targeting of multiple Windows Media Center versions
    3. Automatically selects the "best fit" XML registration file for the application
    4. Meaningful error messages and a debug mode to make it easier to debug setup issues

    You can download the DLL and some documentation about how to use it at this location.

    This DLL is designed as a replacement for the RegisterAddIn.dll that was included in old versions of the Windows Media Center SDK.  We have deprecated that DLL in the Windows Media Center SDK for Windows Vista in favor of 2 more robust alternatives - directly creating the registry values needed to register a Windows Media Center application in the Registry table of your MSI, or using WiX to develop setup packages and using RegisterMceApp.exe as a custom action in a WiX-based solution.

    If at all possible, I strongly recommend that you use WiX for developing the installer for a Windows Media Center application.  However, I understand that there is a learning curve currently while we work on better tools to support automating the trickier aspects of MSI-based installer development.  So this custom action DLL that Niall has written can provide a good stop-gap solution for building Windows Media Center application installers.

     

  • Aaron Stebner's WebLog

    Case study: How I approach debugging and fixing a setup failure

    • 2 Comments

    I received a mail from a customer this week regarding an installation failure that proved to be fairly interesting.  I wanted to describe the scenario and the steps I used to approach solving this issue in the hopes that it will help others who might need to debug setup related problems and find this post.

    The customer was trying to install the Microsoft Enterprise Instrumentation Framework package, but it continually failed and rolled back with error code 1720.  I had the customer send me a verbose log file from this installation using these steps, and then I used this technique to search through the vebose log file for the root cause.

    The verbose log file showed this error message immediately before the setup started to roll back:

    Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor.  Custom action IsDotNetInstalled script error -2146827859, Microsoft JScript runtime error: Automation server can't create object Line 1, Column 1, MSI (c) (80:98) [13:48:47:296]: Product: Enterprise Instrumentation -- Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor.  Custom action IsDotNetInstalled script error -2146827859, Microsoft JScript runtime error: Automation server can't create object Line 1, Column 1, 

    Action ended 13:48:47: IsDotNetInstalled. Return value 3.

    This error is a custom action failure for the action named IsDotNetInstalled.  Since the error code mentions a JScript runtime error, that means that the custom action is script-based, and I can extract the script from the MSI and look at the source code to try to debug further.

    I used the following steps to extract the custom action script from the MSI:

    1. Download the setup package (named EnterpriseInstrumentation.exe) and save it to my local hard drive
    2. Extract the contents of the setup package by running EnterpriseInstrumentation.exe /t:c:\temp /c
    3. Right-click on c:\temp\EnterpriseInstrumentation.msi and open it in Orca
    4. Go to the CustomAction table, locate the entry for the IsDotNetInstalled action and find that the Source value is set to XrayCustomJs
    5. Go to the Binary table, locate the entry for XrayCustomJs, and double-click on the [Binary Data] entry in the Data column
    6. In the dialog that appears, enter the filename c:\temp\isdotnetinstalled.js and choose the radio button labeled Write binary to filename
    7. Press OK to extract the jscript file

    The 1720 error message above stated that the error happened on line 1, column 1 and that it failed to instantiate an object.  After I finished running the above steps, I could open the file c:\temp\isdotnetinstalled.js in a text editor such as notepad to look at what appears on line 1:

    var FSO = new ActiveXObject ( "Scripting.FileSystemObject" );

    Based on that, it appeared to me that there was something wrong with instantiating a Scripting.FileSystemObject control on the customer's computer.  I searched for that object in the registry on one of my computers, and I found the following registration information:

    [HKEY_CLASSES_ROOT\CLSID\{0D43FE01-F093-11CF-8940-00A0C9054228}\InprocServer32]
    (default) = c:\windows\system32\scrrun.dll

    I made an educated guess at this point that something was wrong with the registration for this DLL, so I had the customer try to run regsvr32.exe scrrun.dll to try to fix the registration for the Scripting.FileSystemObject.  Once they ran regsvr32 and it succeeded, they were able to successfully install the Enterprise Instrumentation Framework on their system.

    The steps listed above are fairly specific to the problem that I was troubleshooting with the Enterprise Instrumentation Framework setup package, but hopefully the underlying approach I used to narrow down the problem and some of the tips and tricks listed above will be helpful to you for debugging other types of setup-related issues.

     

  • Aaron Stebner's WebLog

    Updated drivers to fix AMD dual-core video playback glitching in Windows Media Center

    • 2 Comments

    A while back, Dave Fleischman posted a link to a processor update package published by AMD that has helped a lot of customers fix glitching video playback that has been seen in Windows Media Center on some dual-core AMD systems.

    We found out over this past weekend that the update package pointed to in that old blog post is now out of date.  As a result, Dave has posted an update on his blog today that contains a link to a new version of the processor package that has been published by AMD.

    If anyone is still seeing video glitching issues in Windows Media Center and you have a dual-core AMD processor, please try installing the updated processor package and see if it helps solve this issue on your system.

     

  • Aaron Stebner's WebLog

    Updated example for building a Windows Media Center add-in setup package using WiX

    • 1 Comments

    I heard from a customer this weekend who was trying to follow the instructions that I posted a while back to create a Windows Media Center add-in setup using WiX but was running into some problems getting the MSI to compile correctly.

    I took a look at the current build of the WiX 2.0 binaries and the example WiX source (WXS) file that was posted in that article, and I found that there have been some changes to the Wixui library that was causing problems with the example that I had previously posted.

    I have updated the example WXS file in-place to correct the compilation issues and I also enhanced a few other things that I think you might find useful.  I made the following specific changes to the original sample setup that I originally posted in the article:

    Hopefully you will find these changes useful if you are working on a Windows Media Center add-in for Windows Vista.  I am also planning to create a real, working example in upcoming days to supplement this generic sample and provide some more specific details about why things are configured the way they are in the WXS file and the resultant MSI.

    Please let me know if you run into any problems or have any questions about this updated sample for a Windows Media Center add-in setup package using WiX.

     

  • Aaron Stebner's WebLog

    Solving setup errors by using the SubInACL tool to repair file and registry permissions

    • 310 Comments

    A while back, I wrote a blog post about a .NET Framework 2.0 beta 2 installation problem that was caused by incorrect access control list (ACL) permissions on some registry hives.  In that post, I described how to use a tool in the Windows Resource Kit named SubInACL to reset file and registry ACLs to help solve this problem.

    Ever since I wrote that post, I have run into installation errors for several other products that have been solved by using the SubInACL tool.  Therefore, I wanted to write a standalone set of instructions for how and when to use the SubInACL tool because the previous blog post is specific to the .NET Framework 2.0 setup and does not always appear in search results when people run into this kind of a problem and search the Internet for assistance.

    How to download and run SubInACL

    Here are some steps that can be used to download and run the SubInACL tool to repair file and registry permissions that are often needed to successfully install programs on Windows, particularly for MSI-based (Windows Installer) setups:

    1. Download the SubInACL tool and install it.  By default it will install to c:\Program Files\Windows Resource Kits\Tools
    2. If you are running Windows Vista, click on the Start menu, choose All Programs, then Accessories, then right-click on the item named Command Prompt and choose Run as administrator
    3. If you are running an OS other than Windows Vista, go to the Start menu, choose Run, type cmd and click OK
    4. In the cmd prompt, type notepad reset.cmd and click yes to open Notepad.exe and create a new text file named reset.cmd
    5. Copy and paste the following contents into reset.cmd (or download it from this location on my file server and rename it from reset.cmd.txt to reset.cmd):

      @echo off
      title Resetting ACLs...

      setlocal

      echo.
      echo Determine whether we are on an 32 or 64 bit machine
      echo.

      if "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" goto x86

      set ProgramFilesPath=%ProgramFiles(x86)%

      goto startResetting

      :x86

      set ProgramFilesPath=%ProgramFiles%

      :startResetting

      echo.

      if exist "%ProgramFilesPath%\Windows Resource Kits\Tools\subinacl.exe" goto filesExist

      echo ***ERROR*** - Could not find file %ProgramFilesPath%\Windows Resource Kits\Tools\subinacl.exe. Double-check that SubInAcl is correctly installed and re-run this script.
      goto END

      :filesExist

      pushd "%ProgramFilesPath%\Windows Resource Kits\Tools"

      echo.
      echo Resetting ACLs...
      echo (this may take several minutes to complete)
      echo.
      echo IMPORTANT NOTE: For this script to run correctly, you must change
      echo the values named YOURUSERNAME to be the Windows user account that
      echo you are logged in with.
      echo.
      echo ==========================================================================
      echo.
      echo.
      subinacl.exe /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f /grant=restricted=r /grant=YOURUSERNAME=f /setowner=administrators > %temp%\subinacl_output.txt
      echo.
      echo.
      subinacl.exe /keyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f /grant=restricted=r /grant=YOURUSERNAME=f /setowner=administrators >> %temp%\subinacl_output.txt
      echo.
      echo.
      subinacl.exe /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f /grant=users=r /grant=everyone=r /grant=restricted=r /setowner=administrators >> %temp%\subinacl_output.txt
      echo.
      echo.
      subinacl.exe /keyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f /grant=users=r /grant=everyone=r /grant=restricted=r /setowner=administrators >> %temp%\subinacl_output.txt
      echo.
      echo.
      subinacl.exe /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f /grant=users=r /setowner=administrators >> %temp%\subinacl_output.txt
      echo.
      echo.
      subinacl.exe /keyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f /grant=users=r /setowner=administrators >> %temp%\subinacl_output.txt
      echo.
      echo.
      echo System Drive...
      subinacl.exe /subdirectories %ProgramFilesPath%\ /grant=administrators=f /grant=system=f /grant=users=e >> %temp%\subinacl_output.txt
      echo.
      echo.
      echo Windows Directory...
      subinacl.exe /subdirectories %windir%\ /grant=administrators=f /grant=system=f /grant=users=e >> %temp%\subinacl_output.txt
      echo.
      echo.
      echo ==========================================================================
      echo.
      echo FINISHED.
      echo.
      echo Press any key to exit . . .
      pause >NUL

      popd

      :END

      endlocal

       
    6. Change the values named YOURUSERNAME to be the Windows user account that you are logged in with.

      Note:  The YOURUSERNAME value should match the name of your user folder at c:\Documents and Settings (or c:\users on Windows Vista and higher).  You can also find the value to use for YOURUSERNAME by launching Task Manager and looking at the user name listed in the User Name column of the Processes tab.

    7. Save and close reset.cmd. 
    8. In the cmd prompt, type reset.cmd and press enter to run the SubInACL tool.  This tool will take several minutes to run, and it requires that the user account you are using has administrator privileges on the system.  This is why it is necessary to run it from an elevated cmd prompt on Windows Vista.  Step 2 above can be used to start an elevated cmd prompt on Windows Vista.
    9. After reset.cmd completes, try to install the product that previously failed to install correctly on your system.

    Note: There are a couple of scenarios where installing or running SubInAcl can fail.  For example, some non-English versions of Windows have the name of the Administrators group translated to another language, and the command lines listed above will fail in that case.  I have posted workarounds for the issues that I know of in this separate blog post.

    Also note: Running the above command lines will cause SubInAcl to create a log file named %temp%\subinacl_output.txt.  If you see any errors reported in the cmd prompt after running SubInAcl, you can look in this log file for more detailed information about what file(s), folder(s) or registry value(s) are causing the errors.  To open this log file, you can click on the Start menu, choose Run, type notepad %temp%\subinacl_output.txt and click OK.

    When looking at this log file, you may see some errors reported with error code 5.  That error code means Access Denied, and it is typically caused by Windows or some other program running on your system that is holding files, folders or registry values in use so that SubInAcl is unable to update the permissions for them.  Most of the time, that type of error in the SubInAcl output can be safely ignored, but you may need to try to reboot and then manually fix the permissions for these files, folders or registry keys as a workaround.

    When is SubInACL useful

    I have found that the SubInACL tool is most useful when a setup package fails with error code 5 or 0x5 or 0x80070005.  All of these error codes mean Access Denied, and this type of error code is often caused by missing ACLs for the Administrators group or the built-in System account.  The Windows Installer service runs with System account permissions in most cases.  If the System account does not have sufficient permissions to access the file system or parts of the registry, an MSI-based setup package will fail with an Access Denied error.

    SubInACL can also help resolve Internet Explorer script errors caused by incorrect access control permissions for specific user accounts on the system.

    Example of a setup failure that was fixed by SubInACL

    A customer contacted me with a problem installing Visual Studio 2005.  I looked at the main Visual Studio log file located at %temp%\dd_vsinstall80.txt, and I found that Windows Installer 3.1 setup was failing.  Then, I looked at the Windows Installer 3.1 setup log file located at %windir%\KB893803v2.log.  It showed the following error:

    30.844: DoRegistryUpdates:UpdSpInstallFromInfSection Failed for MSI.Reg.Install: 0x5
    30.844: DoInstallation:DoRegistryUpdates failed
    30.875: Access is denied.

    I had the customer run the above steps to use the SubInACL tool to update the file and registry ACLs on their system, and then they were able to install Windows Installer 3.1 and Visual Studio 2005 with no further problems.

    <update date="11/15/2006"> Updated subinacl command lines to include recursive ACL updating for folders and files under %windir% </update>

    <update date="3/22/2007"> Updated the steps to make them easier to follow by moving the directory change into the batch file. </update>

    <update date="9/25/2007"> Updated the notes to indicate that some Internet Explorer script errors can be resolved with this tool as well. </update>

    <update date="5/30/2008"> Updated command lines based on customer feedback regarding their experiences on Windows Vista. </update>

    <update date="6/16/2008"> Updated command lines to cause SubInAcl to create a log file in the %temp% directory in case it is needed for troubleshooting afterwards. </update>

    <update date="6/17/2008"> Added a link to a blog post where I describe a couple of workarounds for problems that can occur while trying to install and/or run SubInAcl. </update>

    <update date="6/20/2008"> Updated command line to include a backslash after %SystemDrive% in the 2nd to last command. </update>

    <update date="6/24/2008"> Updated wording of link to the post for troubleshooting SubInAcl errors to try to make it more visible. </update>

    <update date="7/29/2008"> Updated directory ACL command lines to not affect the Documents and Settings sub-folders. </update>

    <update date="3/12/2009"> Fixed broken link to reset.cmd. </update>

    <update date="4/7/2009"> Added clarification about how to determine the correct value to substitute for YOURUSERNAME in the sample SubInAcl script. </update>

    <update date="5/18/2009"> Added clarification about where to run reset.cmd after creating it. </update>

     

  • Aaron Stebner's WebLog

    A couple of more random thoughts about Windows Vista

    • 1 Comments

    I posted an item a couple of days ago describing my experiences with using Windows Vista, and I wanted to post an update with a couple of additional items that I noticed this weekend, and also provide an update about one of the items that I previously mentioned that some readers posted solutions to in the comments on my other post.

    I mentioned that it frustrated me to have Internet Explorer 7 open a blank page each time I create a new tab.  Fortunately, there is a setting that you can use to change that, and I just hadn't dug around enough to find it yet.  If you press the Alt key, the classic menu system will appear.  Then you can choose Tools | Internet Options, then click the Settings button in the Tabs section.  In the Tabs Settings dialog, there is a check box that is off by default that is title Open home page for new tabs instead of a blank page.  Checking that and pressing OK provided me the behavior I was looking for!

    I have also noticed a couple of other odd behaviors that I didn't previously list.  The first one is something I run into all of the time on the test machines in my office and I can't believe I forgot about it because it really drives me nuts.  In previous versions of Windows, you can open a command prompt and then drag and drop files onto it to force the full path of the file to be displayed in the command prompt window.  I use this technique a lot to run a setup package with command line switches.  In Windows Vista, dragging and dropping a file onto a command prompt does not do anything, so I have to open the folder that contains the file in Windows Explorer and then copy and paste the folder name and paste it into the command prompt.  This is a pretty minor scenario in general, but it happened to be one that I used all of the time and I can't think of a reason offhand why this would have been changed.

    The second item I just noticed today is that each time I open Outlook to read my email, the Outlook window opens in windowed mode instead of being maximized.  In older versions of Windows, it remembered the windowed or maximized state from the previous time I closed Outlook and opened it the same way each time I launch it in the future.

     

  • Aaron Stebner's WebLog

    My random thoughts about using Windows Vista

    • 5 Comments

    After several months of periodic nagging, my friend and co-worker David Fleischman has finally re-entered the world of blogging this week with a couple of posts.  His most recent post describes a few features that have caught his eye while using Windows Vista in recent months.  This post has inspired me to write a similar post.

    I've been using builds of Windows Vista on my test systems for the past 2+ years, but I've taken a couple of key in recent months.  About 3 months ago I stopped using the built-in Administrator account on all of my test systems to force myself to experience Windows Vista like most end users will - with User Account Control (UAC) in full effect.  In addtion, about a month ago I installed Windows Vista on the laptop I use all the time in meetings at work and at home.

    After experiencing Windows Vista like this for the past few weeks, I've made some personal observations and developed a list of pet peeves and likes/dislikes about Windows Vista.  I want to emphasize that these items are my own personal opinions, and a lot of these opinions are formed by my personal work style and things I've trained myself to do over the years, so they should be taken with several grains of salt....

    Aero glass

    I really like how Aero glass looks on my system, and it is especially cool to press Windows+Tab and see the 3D flipping of open windows on my system.  That makes things much easier when I have multiple copies of an application open.  The thing that has been frustrating me about Aero is my inability to easily identify which window currently has focus when I have multiple windows open on my desktop.  More than once, I have started typing or pressing Ctrl+V to paste text into a Notepad window or cmd prompt, only to find that the Windows I thought had focus actually didn't.

    I also find it confusing that the desktop itself appears as a "window" when pressing Alt+Tab or Windows+Tab to switch between applications.  I understand why it is there - to make it easier to get to the desktop to use shortcuts that have been placed there.  However, I've trained myself to press Windows+D to get to the desktop and it is a little disconcerting to see an extra window in the Alt+Tab list if I only have 1 or 2 items currently running.

    Keyboard navigation

    I use keyboard shortcuts a lot in my day-to-day computing, especially on my laptop because it is a lot faster than the eraserhead and the touch panel.  I trained myself to click Ctrl+Esc to bring up the Start menu and then press R to bring up the run dialog to launch a new app, or press U to bring up the shutdown menu.  Neither of these shortcut combinations work in Windows Vista.  I can use Windows + R to bring up the run dialog as an alternative, but the problem with that on my laptop is that the Windows key is in the top right of my keyboard, so Windows + R requires both hands, whereas Ctrl+Esc+R required only the left hand and I could continue to use the mouse with my right hand.

    I haven't found a workaround for bringing up the shutdown menu so far, so I actually created a batch file to call shutdown.exe so I could get to it quicker and not have to tab around the start menu to try to navigate to the shutdown menu with only the keyboard.

    Internet Explorer 7

    I know that tabbed browsing has been around in other browsers for a little while, but IE7 is the first time I've experienced tabbed browsing.  I like the idea in general, but it takes some getting used to because I typically have many browser windows open and Alt+Tab around a lot.  The annoying thing I've run into so far is that when I click on the New Tab, it opens a blank page instead of using my default home page.  I use a local page I wrote with a list of my most commonly used links as my home page, and so I typically open a new browser window or tab and then want to click on one of my home page links.  Because a new tab opens a blank page, I have to go and click the home button after opening a new tab to get to my default home page.

    I enabled the anti-phishing filter when I first launched IE7, but then later on the filter flagged my own blog as a phishing site, even though it is hosted by Microsoft and I have no control over what user data it does or doesn't ask for behind the scenes.  Fortunately, there is an easy mechanism to appeal the reporting of a site as a phishing site, and so I clicked the link and reported my blog.  The next morning I checked my email and I had an automated mail indicating that my report was received and my blog would no longer be flagged as a phishing risk.

    User Account Control (UAC, formerly LUA)

    A lot of work has been done to make this feature less intrusive, but this still drives me crazy.  I understand protecting some system resources, like applications that try to write to the Windows directory or HKEY_LOCAL_MACHINE, but I don't understand why I should have to elevate Visual Studio in order to compile a sample application because that sample is installed under Program Files and Visual Studio tries to build in a relative path under the project directory by default.

    I also get frustrated by the screen dimming to show me that a UAC prompt has appeared.  It causes a lot of flashing and disorientation when UAC prompts appear on my system.  In some cases, the UAC dialog appears minimized or behind other windows I have open on my screen, so I am stuck with a dimmed display and I have to hunt for the reason.

    Some types of applications don't have "Run as administrator" in their context menues, so I have resorted to pinning the cmd prompt to my start menu in order to have an easy shortcut to create an administrator cmd prompt that I can then launch other elevated applications from without needing to specifically allow them each time I run them.

    I have also found some control panels that contain a mix of settings that do and do not require elevation, and this really confused me the first time.  For example, the Power Options | System Settings control panel has a set of radio buttons where you can tell Windows whether or not to require a password when resuming from standby.  By default, that radio button group is grayed out.  You have to click the link at the top of the control panel that says "Change settings that are currently unavailable."  That will prompt you for elevation, and if you choose to allow it, the control panel refreshes and the radio buttons are now active.  I'm having a hard time getting used to this kind of behavior.

    Miscellaneous

    The general philosophy of Windows Vista seems to be to hide system menus by default.  I have already found myself frustrated in Windows Explorer and IE7 by the lack of File, Edit, etc menus at the top of the screen.

    There are a lot of changes in the system that make me feel like I have to re-learn things I've gotten used to doing in previous versions of Windows.  In particular, the system of control panels seems almost universally different.  I can't decide if this change is for the better or not.  The other particularly annoying (though very minor) thing I've seen is the Windows default save as dialog.  Instead of Yes, No, Cancel, the buttons are now Save, Don't Save and Cancel.  I've gotten used to closing Notepad and pressing Y to save it, but now I have to press S.  Fortunately, the keyboard shortcut for Don't Save is N, which is the same as the No button I have been used to.

    I've also seen a couple of odd things related to the .NET Framework.  I installed the .NET Framework 1.1 and got a scary application compatibility dialog stating that I need to install the .NET Framework 1.1 SP1.  The dialog is accurate, because you could be affected by bugs like this and this (except that those bugs will block setup from working correctly, which makes it tricky to workaround them).  The problem is that the same dialog appears when trying to install .NET 1.1 SP1.

    Also, after I install .NET 1.1 SP1 and reboot, I get a system tray balloon from Windows Defender saying that some operations that are scheduled to happen at startup have been blocked.  One of the items in that list is an unclassified action that I know is the post-reboot process to re-NGEN .NET Framework 1.1 assemblies.  I can't find any way to change the Classification of that action in the Windows Defender dialog, so I'm not really sure if my system is in a state where nothing in the .NET Framework 1.1 is NGEN'ed or not.

    Summary

    Overall, I have been happy with my Windows Vista experience as I use it more and more in day-to-day work, despite the pet peeves listed above.  This is a huge OS overhaul (approximately analogous to the upgrade from Windows 3.1 to Windows 95), so I expect a learning curve for things that behave differently.  As much as I like the tricks I've learned in the past, it would also really tie our hands to try to maintain complete parity with previous behaviors, and I think we're getting to a good balance between making worthwhile changes while also making the new features relatively easy to learn and understand.

    Also, I know I'm biased, but it is really cool that I can just install Windows Vista Home Premium or Ultimate on my laptop and get Windows Media Center features by default.  I don't have to install a special edition of Windows like I did in XP, and if I install Ultimate, I can also join my system to a domain and have Windows Media Center and not have to choose between those features like in XP.  The UI changes within Windows Media Center really frustrated me at first, but I really like the color scheme now, and the work we've done to improve mouse controls really makes me happy, especially on my laptop that I am not using as a living room PC.  And I am most happy about the built-in codec so I don't have to install any special software to be able to watch a DVD in Windows Media Center in Windows Vista like I did for XP Media Center Edition.

    Again, I want to emphasize that all of these are my own personal opinions based on my personal preferences and the ways I've taught myself to use Windows to optimize my own personal efficiency.

     

Page 1 of 1 (21 items)