October 27, 2006

Woodworking: 4×3 Picture Frame Finished

Filed under: Uncategorized — Anthony Park @ 10:50 pm

I recently finished making a picture frame for a 4ft x 3ft painting. This was a pretty small project, taking about 8 hours to complete. This is my third picture frame, and I’ve come to realize that picture frames just aren’t very interesting to make.





More pics on my woodworking page

October 22, 2006

Frustrations with Vista Feedback Process

Filed under: Uncategorized — Anthony Park @ 7:12 pm

I mentioned before that I had problems using Windows Vista Media Center. I also mentioned that I couldn’t figure out how to provide feedback to Microsoft about my specific issues. Shortly after my post, I received several emails from people stating that there is a feedback icon on the desktop in Windows Vista. Oops, guess I overlooked that…

The biggest issue that is preventing me from making the switch is that when I turn off my 52″ DLP and turn it back on, the display never comes back on.

Back when I originally had the problem, I tweaked a whole bunch of things to try and resolve it (installed various drivers, played with power settings, etc.) After trying a whole bunch of things (including some pretty drastic measures), my machine wouldn’t boot anymore.

Yesterday I decided to reinstall Vista JUST TO SUBMIT MY FEEDBACK. That’s right, I spent two hours reinstalling the OS just so I could submit my little bug in hopes that it would be fixed in some future version.

Once I reinstalled the OS and applied all of the latest updates and drivers, I was still able to recreate my issue 100% of the time. Great! So, I double-click on the feedback icon on the desktop and click on the link in there to download the feedback tool. Then, I see this:



Grr… So, I try it a couple of more times with the same result. After taking a break to eat lunch, I came back and tried it again. It worked! Okay, maybe Microsoft was having some server issues… I can forgive that.

The tool asks for a reasonable amount of information, so I fill it in:



After that, it takes a couple more steps and I give my consent for the tool to grab anything it needs off of my machine and send it off. When it’s all done compiling the information, I click the send button. That’s when I get this:



So, I took a break and tried again a little later. This time it made it a little further, but now I got a different error:



and, this one:



I tried several times over a timespan of four hours. Still not working. By the way, every time one of these errors happened, I lost all of the information I entered. After the second time, I learned that I’d better save it before clicking the “Send” button.

I know what you’re thinking… Well, Anthony, it looks like a connectivity problem. Are you sure your internet connection is working? YES, I checked all of that stuff. My internet connection was working fine. In fact, in between retries I was surfing YouTube. Yep, working fine.

So, I have the cab file it generated with my issue in it and all the info about my machine. But, it never got sent to Microsoft. That was a waste of 6 hours.



The bottom line is this: The feedback tool is the ONE THING that should ABSOLUTELY, POSITIVELY work in Windows Vista. If not, why are you having a beta period? I spent WAY more time on this than most people probably would have. And, what did you get out of all my efforts, Microsoft? What did I get out of it? A big fat nothing.

October 19, 2006

MCML Featured on the Media Center Show

Filed under: Uncategorized — Anthony Park @ 7:00 pm

Ian Dixon posted a new podcast episode of “The Media Center Show” today, and this one features Media Center Markup Language (MCML) development with Windows Vista.

If you’re interested in getting started with MCML development, this would be a good place to start.

The Media Center Show #79 – Media Center Development (Part 1)

The Media Center Show Extra #2

October 16, 2006

Presenting at Desert Code Camp on October 28

Filed under: Uncategorized — Anthony Park @ 5:49 pm

I will be presenting a session about Windows Vista Media Center development at the upcoming Desert Code Camp on October 28, 2006 in Tempe, AZ.


Windows Vista Media Center Development


There is a new development language for Media Center development: Media Center Markup Language (MCML). In this one hour session, we will cover a brief overview of Media Center and create, install, and test a simple application in MCML from scratch.


Keeping with the goals of a Code Camp, the session will be very “code-centric”.

—-

What is a Code Camp? In short, it is a free developer conference. Who is welcome? Anyone!

To get a better understanding, here’s the Code Camp Manifesto:

By and For the Developer Community


Code Camps are about the developer community at large. They are meant to be a place for developers to come and learn from their peers. Topics are always based on community interest and never determined by anyone other than the community.

Always Free


Code Camps are always free for attendees.

Community Developed Material


The success of the Code Camps is that they are based on community content. All content that is delivered is original. All presentation content must be provided completely (including code) without any restriction. If you have content you don’t want to share or provide to attendees then the Code Camp is not the place for you.

No Fluff only Code


Code Camps are about showing the code. Refer to rule #1 if you have any questions on this.

Community Ownership


The most important element of the Code Camp is always the developer community. All are welcome to attend and speak and do so without expectation of payment or any other compensation other than their participation in the community.

Never occur during work hours


We need to understand that many times people can’t leave work for a day or two to attend training or even seminars. The beauty of the Code Camp is that they always occur on weekends.

The community leaders in the desert have worked together to arrange this venue for our software developer communities. It’s not a “one-technology” event. There will be sessions on Java, Flash, open source, Microsoft, database, and all other technologies. Nothing is off limits.

Visit http://www.desertcodecamp.com for more information.

October 14, 2006

Creating an MCML Application for Windows Vista Media Center

Filed under: Uncategorized — Anthony Park @ 1:35 pm

I recently posted instructions for creating a Media Center AddIn: Soup to Nuts


I am currently working on a new MCML (Media Center Markup Language) application for Media Center, so I thought I would post the same instructions with respect to MCML applications. Setup projects are a little different for MCML applications than they are for AddIns, and Media Center AddIns for Windows Vista can be created in Visual Studio 2005. Hooray!

This guide assumes a couple of things:

1. You are using Windows Vista
2. You have Visual Studio 2005 installed and working
3. You have installed the Windows Vista Media Center SDK

Media Center Markup Language is “an XML based declarative language that instructs the Windows Media Center renderer in how to display a user interface within the Windows Media Center Presentation Layer.” MCML is a welcome addition to the Media Center development platform because it provides developers with the control of .NET code, while allowing them to tap into the rich UI that Media Center users are used to. In this short guide we will create a very basic “Hello World” MCML application, install and register it with Media Center, and test it out.

Step 1: Create the MCML Application


- Open Visual Studio
- Select File | New | Project
- Select “Visual C#” | Windows Media Center | Windows Media Center Presentation Layer Application
- Type in a location, and a name for the project.



After you click OK, Visual Studio will create shell project for you with a couple of files. AddIn.cs is the class that will launch our MCML application. The AddIn class implements two interfaces: IAddInModule and IAddInEntryPoint. In the IAddInModule interface, the method “Launch” contains the code required to navigate Media Center to our MCML application. The Default.mcml file contains our MCML code that will display when the application is launched.

- In the Solution Explorer, rename the AddIn.cs file to something appropriate. In our case, MCMLHelloWorld_Start.cs.



- Inside MCMLHelloWorld_Start.cs, rename the class name, and set the namespace to something meaningful.



- The Default.mcml file contains the MCML code that will display when our application is launched. Let’s customize it a little bit.



- Now that we have our code in place, build and run the solution. Our application launches in McmlPad.


Step 2: Secure our Assembly


Media Center will only load assemblies that have been signed. So, we need to create a secure assembly.

The first step is to generate a keypair. If you already have a keypair that you use for other projects, you can just use that one. If not, it’s easy to create one with the “Strong Name Utility” that comes with Visual Studio.

- Open the Visual Studio Command Prompt by selecting it from the Start menu (in my case: Start | All Programs | Microsoft Visual Studio 2005 | Visual Studio Tools | Visual Studio 2005 Command Prompt)

- Change to your project folder (in my case c:\MediaCenter\MCMLHelloWorld\MCMLHelloWorld)
- Generate a public/private keypair by typing: sn -k MCMLHelloWorld.snk



The Strong Name Utility generates a filed called “MCMLHelloWorld.snk”, which contains our public/private keypair.

Next, we need to add our keypair to the project.

- In Visual Studio, open the AssemblyInfo.cs file that is in the Properties folder in the Solution Explorer.
- Change the AssemblyTitle to MCMLHelloWorld
- Change the AssemblyVersion to 1.0.0.1
- Change the AssemblyFileVersion to 1.0.0.1



- Right-click on the MCMLHelloWorld project in the Solution Explorer, and click Properties.
- On the Signing tab, make sure the “Sign the assembly” checkbox is checked.
- Under “Choose a strong name key file”, click “Browse…” and select the MCMLHelloWorld.snk file we just created.



- Now that the keypair is hooked up, build the project again.

Step 3: Build Setup Project


Now that we have an awesome MCML application that we want to run inside of Media Center, we need a Setup project to install the assembly in the Global Assembly Cache (GAC) and register it with Media Center.

Step 3A: Create a new setup project


- Right-click on your Solution in the Solution Explorer, and select Add | New Project
- Choose “Other Project Types” | “Setup and Deployment” | Setup Project
- Type in a location and a name for the project.



When you click OK, Visual Studio will create a new setup project within your existing Solution.

Step 3B: Setup Project Settings


- In the Solution Explorer, select the Setup project.
- In the properties window, fill in the relevant project properties. In my case, I filled in Author, Manufacturer, ProductName, Title, and Version.



Step 3C: Add Files


- Click on the “File System Editor” toolbar button in the Solution Explorer to open the File System Editor
- Right-click “File System on Target Machine”, select “Add Special Folder” | “Global Assembly Cache Folder”



- Right-click on “Global Assembly Cache Folder”, select Add | Project Output
- Select Project: MCMLHelloWorld
- Select Primary Output



At this point, we have a setup project that installs our MCML assembly into the GAC. Visual Studio has detected that our setup project is dependent on the .NET Framework, so it has included a Launch Condition for us to make sure the Framework is installed.

Step 4: Add Media Center Launch Condition


One of the requirements of any good setup project is that it will prevent the user from installing on a non-supported operating system. We can accomplish this task by using a launch condition.

- In the Solution Explorer, click the “Launch Conditions Editor” toolbar button to open the Launch Conditions Editor.

- Right-click on the “Search Target Machine” folder and select “Add Registry Search”.
- Name the new item something meaningful, like “Vista Media Center Required”.
- In the properties window, set the Property, RegKey, Root, and Value properties. According to Aaron Stebner, this is the correct way to check for the existence of Media Center in a setup project.



- Right-click on the “Launch Conditions” folder, and select “Add Launch Condition”.
- Name the new item something meaningful, like “Vista Media Center Required”.
- In the properties window, set the Condition, and Message properties. An Ident of “3.0″ is for Media Center 2005.





Step 5: Register your Application with Media Center


Okay, before we can complete this step, we need to generate two guids for our application. Luckily, Visual Studio has a “Create GUID” tool that will do the job.

- Run GuidGen.exe from Program Files\Microsoft Visual Studio 8\Common7\Tools.
- Select the “Registry Format” in the tool, and copy your new guid to the clipboard using the Copy button.



Okay, I said we needed two guids, right? The SDK recommends that you use sequential GUIDs to register your application to make troubleshooting and locating them in the registry easier. We’ll call our two GUIDs the “Application GUID” and the “Entry Point GUID”.

- Application GUID: {C52CC2FE-6771-4e33-B384-BC445B482265}
- Entry Point GUID: {C52CC2FE-6771-4e33-B384-BC445B482266}

Now that we have our two GUIDs, we’re ready to create the registry keys we need…

- In the Solution Explorer, click the “Registry Editor” toolbar button to open the Registry Editor.
- Right-click on the “User/Machine Hive” folder in the Registry Editor and select “New Key”. Create a structure that looks like this:



Notice how we use our “Application GUID” under the “Applications” key, and our “Entry Point GUID” under the “Background” and “Entry Points” keys?

- On each of the GUID keys, change the “DeleteAtUninstall” property to true. This will unregister the application when it is uninstalled.

- Under the Applications\[GUID] folder, create two string values called “CompanyName” and “Title”.



Under the Categories\More Programs\[GUID] folder, create a string value called “AppId” and a DWORD value called “TimeStamp”. Put the Application GUID in the Value property of the AppId, and put your favorite timestamp in the Value property of the TimeStamp.



- Under the Entry Points\[GUID] folder, create string values called “AddIn”, “AppId”, “Description”, “Title”, and a DWORD value called “TimeStamp”.

This is where it gets a little tricky! If you have problems with running your MCML AddIn later, chances are that you made an error in THIS STEP.

The “AddIn” String value contains the information that Media Center needs to launch your AddIn. In my case, the string looks like this:

AnthonyPark.MediaCenter.MCML.MCMLHelloWorld_Start, MCMLHelloWorld, Version=1.0.0.1, Culture=neutral, PublicKeyToken=091b5809569f1055, processorArchitecture=MSIL

This is what is known as the “strong name” of your assembly. To construct this name, use the following formula:

FQCN + “, ” + SASN

Where:
- FQCN is the Fully Qualified Class Name of the class that implements IAddInEntryPoint (the class that Media Center is supposed to launch). In my case, it is AnthonyPark.MediaCenter.MCML.MCMLHelloWorld_Start (which is the namespace that my class is in, plus the class name).

- SASN is the Strong Assembly Name of your assembly. The easiest way that I have found to determine this is to install your assembly into the GAC using the GACUtil, and then use GACUtil -L to list your assembly:



- Put the Application GUID in the Value property of the AppId, and put your favorite timestamp in the Value property of the TimeStamp.



Step 6: Install and enjoy your MCML AddIn!



October 12, 2006

MCEBrowser Version 2.2 Released

Filed under: Uncategorized — Anthony Park @ 10:19 am

I just released MCEBrowser version 2.2. It is now posted on download.com, you can download it here.

Version 2.2 includes the following changes:

1. Added support for Windows Vista Media Center
2. Fixed various installer issues, including removing the dependency on the .NET Framework.
3. Added the Japanese language translation

October 2, 2006

Launch MCEBrowser from Command-Line

Filed under: Uncategorized — Anthony Park @ 11:41 pm

Nick Clark asks: “Hey, is there a way to call MCEBrowser from the command line and open it up in Media Center at a certain web page?”

Well, yes there is. The executable for Media Center (ehshell.exe) supports several command-line options. One of them is the /url option, which allows you to specify the URL of a Hosted HTML Application to open.

In addition, MCEBrowser allows you to specify a URL to open as a parameter to it’s own URL.

So, in order to launch Media Center and open MCEBrowser to anpark.com, just create a batch file with the following command:

start c:\windows\ehome\ehshell.exe /url:”file:///C:/Program Files/ANPARK/MCEBrowser/MCEBrowser.html?url=http://www.anpark.com&”

Don’t forget the ampersand (&) after the url, since there’s an oddity (read: bug) in MCEBrowser that requires it. You may need to modify the paths included in this example, depending on your configuration.

This does cause some weird navigation behavior in Media Center. If you press the back button, Media Center will close. So, if you want to go to the Start page in Media Center, you’ll have to press the green button on the remote. Try it and you’ll see what I mean :)