Scott Hanselman

Top 10 Tips Working Developers Should Know about Windows 7

August 9, '09 Comments [36] Posted in Win7
Sponsored By

Windows 7 Logo I've been tweeting about Windows 7 lately but I had a flash tonight that I should write some of this stuff down. Here's my list of the Top 10 Things Working Developers Should Know about Windows 7. I say "working developers" because if you're a .NET developer you either have run into these questions or you will, so why not put them in one place.

These are in no particular order. Also, in case it's not clear, each heading here is a link.

Windows 7 includes .NET 3.5SP1

If you're developing apps for Windows using .NET you'll be happy to hear that Windows 7 comes with .NET 3.5SP1 already installed. It's in the box, so one less thing to install for you.

Visual Studio 2008 works great on Windows 7

Have no fear. I run VS2008SP1 all day long on my Windows 7 machines (4 of them now) and it works fine*. Remember also that even though you're running Windows 7 and .NET 3.5 SP1, you can still compile for and target .NET 2.0 and Windows Vista or Windows XP clients.

You can write a single app for XP, Vista and Windows 7

...and that single EXE can "light up" on the newer OS's. I'm going to blog more about this soon, but there's a great Reference App called "PhotoView" (yes, I know, another photo app, but at least it's not Northwind). The point is that this managed WPF application runs nicely on XP, but if you run it on Vista you get Windows Search and UAC, and if you run it in Windows 7 you get Taskbar Integration, Transactional File System, Libraries, etc. One app on three Windows, working well and looking nice on all of them.

You can code to Windows 7 features today using the .NET Framework

There's a great Windows API Code Pack for the .NET Framework that's a library of source code that lets .NET folks access these new features even though they're not baked into the framework. That means .NET 3.5 SP1 developers can be writing Windows 7 apps today. This includes all the new shell features, search, the new Explorer Browser, new Dialogs and controls, and hundreds of new APIs. Check out the Windows 7 Developer Guide as well. Also, if that's not enough details there's dozens and dozens of new Win32 Samples and articles to go with them in the newly released and plainly named Windows SDK for Windows 7 and .NET Framework 3.5 SP1.

PowerShell is built-into Windows 7

You don't need to wonder if a machine has PowerShell. If it's running Windows 7, it's there and it's PowerShell 2.0. This not only means you can use PowerShell Scripts to automate things in your development process, but you can also use the PowerShell scripting engine in your apps without installing anything extra.

There's an extensive Windows 7 UX Guide

 Also available as a PDF, this guide helps you design your User Experience such that it fits into Windows 7 seamlessly. This includes guides for resolution, DPIs, windows sizing, alignment and control spacing. There's a great section on aesthetics as well.

There are Free Book Chapters for Upcoming Windows 7 Books

There will no doubt be a flood of Windows 7-specific books coming out soon. For now, there's a bunch of free chapters for "Windows 7 Inside Out," "Windows 7 Resource Kit" and "Windows 7 for Developers" that you can download now in PDF or XPS.

Windows 7 Training Kit for Developers

This is a nice rolled-up download of presentations, hands-on-labs and demos. It's got examples on how to use  new Windows 7 features like the Taskbar, Libraries, Multi-Touch, Sensors/Location, Ribbon Controls, and more.

There's a new "Windows on Channel 9" Site

This is a whole new section of Channel9 on MSDN that's dedicated to Windows 7 content. There are dozens of great videos, in-depth interviews with folks like Larry Osterman (the guy that makes Windows go beep) and Mark Russinovich. There's a Programming Windows 7 area with video deep drives on the new Sensor and Location Platform, Multi-Touch, Animation, and the new Graphics Architecture.

Boot to VHD Saves You Time

I'm going to beat this drum until everyone is booting to VHD. For my development machine, I'm running Windows 7 and VS2008 on my C: drive, but I sometimes boot into a Windows 7 and VS2010 Beta running on a VHD. Not a VM, no, they're too slow for me, but the Hard Drive is virtualized on the VHD. It's a nice way to keep crazy (or old) stuff in a separate place without fear of messing up partitions or my main machine! Here's a video demonstration and how to turn your Windows 7 media into a VHD ready for booting.

Did I miss anything?

Related Links

* If you install SQL2008, you'll get a compatibility warning during install. Keep installing, then just get SQL2008 SP1 and you'll be all set on Windows 7.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Hanselminutes on 9 - Managing People (and wisdom with Chris Sells)

August 8, '09 Comments [35] Posted in Microsoft | Musings
Sponsored By

image An email went out to our organization (Server & Tools Online) by one of our GMs that had a bullet (it was bullet #2 I believe) that said:

As community engagement and quality of resources are key goals for STO we are broadening the responsibility of the community PMs who today report to Simon Muzio by creating the STO Community Team led by Scott Hanselman. Tim Heuer, Joe Stagner, Jesse Liberty and Rob Conery will report to Scott, and in addition to their strategic roles of spreading the good word about the latest developer division products and platforms with our customers and the community at large, they will help STO understand how to interact with the community, drive buzz, interest, and excitement around Microsoft technologies. The team will also broaden its mission by taking on accountability around Developer Compete technologies. We need to engage the community in an effective real conversation at the competitive level and decide which competing technologies and communities to engage with.  The team will also pilot a set of globally scalable approaches for community content contribution. This is about transitioning from Microsoft being the major content contributor on our sites to a community content contributor model. 

This means I now have a team of 4 people and, as an aside, I've got reqs (requisitions or "headcount") for possibly two more. There's no extra pile of money for me but they do tack on "Lead" at the end of my name, I think. Or "Group" at the front. I'm still not sure which, but one of them.

I have called myself, both internally and externally, and only half-joking, "The People's Programmer." I have said "Developer Liaison" and "Community Concierge." They're all fun titles, but they are all true.

Our team's job is to make sure that you're having a good time developing with Microsoft tools. I want you to feel empowered to make cool stuff. If you're not, we'll try to make it better through articles, tutorials, walkthroughs, videos, presentations, books, and more. We're worldwide multimedia professors, but we're learning from you as much as we're teaching.

Now that we've got some autonomy, we're also going to try to figure out how to reconcile all the different kinds of community people there are at Microsoft (there's lots) and how we can best work together.

We also feel that there's a lot of great content out there that's been written by you, Dear Reader, that Microsoft doesn't promote or make easily available. I want to get your content on MSDN, on ASP.NET, on Silverlight.NET. If you've got good content, we're trying to understand what roadblocks at Microsoft are making it a hard for you to contribute.

I hope you've figured out by now that I'm open to feedback. A lot of you have commented here or emailed me and I hope you've seen how we try to advocate for you. ALWAYS feel free to talk to me or *ahem* my team (that'll take a while to get used to) if you have feedback on anything we do.

<cheesy>
Thanks for being here for me Dear Reader, I really love being a part of this community.
</cheesy>

-- ScottHa

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Windows 7 Easy Upgrade Path Truth Table/Chart

August 7, '09 Comments [23] Posted in Win7
Sponsored By

Ed Bott's alternative Windows 7 Upgrade Chart Wow, everyone is moving up to Windows 7. I'm looking forward, as IT Manager for the Hanselman Family, to upgrading everyone. New OS for all the cousins and uncles and what-not is always a highlight of my year.

Personally, I think Windows 7 is a good time to do a "clean" install. Most people have decent internet speeds and there's just nothing quite like the fresh minty smell of a new install.

Disclaimer: I don't work for the Windows team and I wrote this post in the dead of night completely off the clock on a PalmPilot so there might be no confusion about my motives. I'm just a techie dude who happens to work for the Big Blue Monster. This is not official anything and it's a blog. It's very likely wrong or complete nonsense. One day you'll show up and I'll have been fired, drawn and quartered and this site will be all 404s. That is all. I may start selling T-shirts containing my disclaimers in case they are in any way unclear.

There's a few choices for you:

Clean Install + Migrate: You can certainly "migrate" your settings from an old machine to a new one still doing a clean install. It's a clean install, but you're saving time by bringing lots of little things over like browser history, favorites, usernames, passwords, subtle settings. Either way, you've got choices.

In-Place Upgrade: You can also "upgrade in-place," meaning you're installing Windows 7 to c:\windows (or whatever) and it'll upgrading your Vista installation directly. Once Windows 7 is installed, you can do an "Anytime Upgrade," for example, taking Win 7 Home Premium to Win 7 Pro if you like.

There's a chart that explains this, but visually, it's too complex in my opinion. I stated working on a simpler one, then Ed Bott in his wisdom beat me to it. It's a truth table of sorts, and technical folks LOVE to collapse their tables. What may have made sense to the original designer is begging for refactoring by one of us.

The original table looks scary and sends a negative message. However, as Ed points out "Most Vista users will have clear and logical upgrade paths from their current edition to the same edition of Windows 7."

Basically, if you're going from whatever version of Vista you have to a similar (or greater) version of Windows 7, you're all set. You'll only need to clean install if you're going from a "high sku" to a lower one. Go check out Ed's chart or click on the image above and enjoy your upgrade!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Vista Users - Uninstall Visual Studio 2010 Beta 1 before upgrading to Windows 7

August 6, '09 Comments [25] Posted in Win7
Sponsored By

Disclaimer: I do work for Microsoft, but is my opinion. If this walkthrough causes your ferret emotional distress, I'm sorry. Who is this? Stop calling! Jimmy no live here! You no call back!

I'm an early adopter so I've been running Beta 1 of .NET 4 and Visual Studio 2010 on a Vista machine. However, Beta 1 of .NET 4 doesn't survive an upgrade to Windows 7 and leaves the .NET Framework in a goofy and unfixable state. Beta 2 won't have this problem.

So, in a nutshell if you're running .NET 4 and Visual Studio 2010 Beta 1 on Vista you've got two options*.

1. Uninstall, Upgrade, Reinstall

  • Uninstall Visual Studio 2010 Beta 1
  • Uninstall .NET Framework 4
  • Upgrade to Windows 7
  • Reinstall .NET Framework 4 and Visual Studio 2010 Beta 1

Or:

2. Clean Install

  • You can do a clean install of Windows 7, which is what I did anyway, as I like my Major OS Upgrades to be fresh.

When you're talking about OS Upgrades and Early Beta Software, if you really want to be confident, I say clean install.

It an unfortunate Beta 1 bug, so tell your early-adopter developer friends (or blogs) so they don't have trouble upgrading.

Related Links

* You might be running Windows 7 RC and thinking to do an unsupported upgrade to Windows 7 RTM. If so, remember, it's not supported, but you'll have this problem upgrading too, so uninstall Dev10b1/.NET4 first.


Here's technical details on how to uninstall VS 2010 Beta 1 and .NET 4 Beta 1:

  1. Uninstall TFS Object Model (This step is Visual Studio 2010 Team Suite only)
    1. From Add/Remove, uninstall Microsoft Team Foundation Server 2010 Beta 1 Object Model
  2. 2. Uninstall Visual Studio 2010 Beta 1
    1. From Add/Remove, uninstall all instances of Visual Studio 2010 (Team, Pro, etc. You likely have just one, but one can't be sure.)
    2. Be sure to see the Visual Studio Setup wizard through to completion.
  3. 3. Uninstall .NET Framework 4 Beta 1
    1. From Add/Remove, uninstall in this order:
      1. Microsoft .NET Framework 4 Extended Beta 1 - Language Pack
      2. Microsoft .NET Framework 4 Client Profile Beta 1 - Language Pack
      3. Microsoft .NET Framework 4 Extended Beta 1
      4. Microsoft .NET Framework 4 Client Profile Beta 1
  4. Reboot
  5. Uninstall C++ 2010 Redistributable
    1. From Add/Remove, uninstall Microsoft Visual C++ 2010 Beta 1 Redistributable (x86 and/or x64)
  6. Reboot

Hope this beta hassle saves you a worse hassle when it comes time for you to upgrade to Windows 7. Again this won't be a problem in .NET 4 Beta 2.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Step-By-Step: Turning a Windows 7 DVD or ISO into a Bootable VHD Virtual Machine

August 4, '09 Comments [31] Posted in Tools | Win7
Sponsored By

I'm loving the Windows 7 "Boot to VHD" lifestyle. This isn't Virtual Machines, to be clear, and it's not Dual Booting. It's Boot to VHD.

Let me break it down:

Method Pros Cons
Dual Booting Your OS's always run at full speed. You can screw up your partition table. You have to partition which means disks of fixed size. Or you can have them all share the same disk, which is dangerous.
OS's aren't portable.
Virtual Machines Your OS's are completely separate from each other and can't hurt one other. Your OS's are very portable. You get Undo support for your disks. Everything is virtualized, so you're taking a perf hit on pretty much everything. Often not a good solution for laptops.
Boot to VHD Your OS runs on the hardware directly, except your disk, which is virtualized and runs inside a single file. Estimated 3%-5% perf hit. Seriously. Also is awesome on a laptop if you have the HD space. None! But I'm biased! Neener neener!

Only works on internal drives or ESATA. No USB Drive support. No undo disk support.

Making a VHD is easy with Windows 7 since you can create and mount/attach VHDs in the standard tools. VHD as a disk format is built into the Operating System (although, strangely, you can't mount ISOs.).

You can create a blank VHD, set it up in your boot menu with BCDEdit (details and walkthrough here and a video demo here) and then just boot off your VHD. If you want to install your OS (Windows Server 2008 and Win 7 Enterprise or Ultimate are the only ones supported) then you just install away.

However, this is STILL not convenient enough for me.

I'm always trying crazy new Daily Builds of big stuff that takes a while to be installed. The step where I install an OS onto my VHD takes too long, so I'd like a prepared VHD that's already to be started for the first time, kind of like when you buy a machine from Dell or whoever and you get that nice "starting your computer, detecting drivers" action on first boot.

Well, there's a script over at the MSDN Code Gallery to help with this. It's the Windows Image to Virtual Hard Disk Converter (WIM2VHD).

From their description:

The Windows(R) Image to Virtual Hard Disk (WIM2VHD) command-line tool allows you to create sysprepped VHD images from any Windows 7 installation source. VHDs created by WIM2VHD will boot directly to the Out Of Box Experience, ready for your first-use customizations. You can also automate the OOBE by supplying your own unattend.xml file, making the possibilities limitless.

Fresh squeezed, organically grown, free-range VHDs - just like Mom used to make - that work with Virtual PC, Virtual Server, Microsoft Hyper-V, and Windows 7's new Native VHD-Boot functionality!

I like this guy already.

How to SysPrep your Windows 7 Image

I copied my Windows 7 DVD to a folder on a drive with lots of space free. I probably didn't need to copy it over, but it likely made the process faster.

Then I downloaded and installed the Windows® Automated Installation Kit (AIK) for Windows® 7. This file is a large ISO (1.5G) so be aware. It's meant for admins, not humans. I didn't want to burn the ISO to disk, so I used 7-Zip to open the ISO as an archive and extract it. (If you're not using 7-Zip, you're missing out on life, BTW)

Now, go into C:\Program Files\Windows AIK\Tools and find ImageX.exe and copy it where you put the Windows Image to Virtual Hard Disk Converter (WIM2VHD) script.

Go read the Example Command Lines for Win2VHD, but since I had a Windows 7 Ultimate I ran this command-line. Note that d:\win7working is where I copied my DVD.

cscript wim2vhd.wsf /wim:d:\win7working\sources\install.wim /sku:ultimate

In this example, d:\win7working is the folder I copied the DVD to. Could be your DVD drive too, I suppose.

It chewed for a while, maybe seven minutes. You'll also here the "Device Plugged In" sound as the script automatically connects a VHD as a drive temporarily so don't panic:

D:\>cscript wim2vhd.wsf /wim:d:\win7working\sources\install.wim /sku:ultimate
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

Windows(R) Image to Virtual Hard Disk (WIM2VHD) Converter
Copyright (C) Microsoft Corporation. All rights reserved.
Version 6.1.7100.2

Check for updates at http://code.msdn.microsoft.com/wim2vhd!

MACHINE INFO:
Build=7600
Platform=amd64fre
OS=Windows 7 Ultimate
ServicePack=
Version=6.1
BuildLab=win7_rtm
BuildDate=090713-1255
Language=en-US

INFO: Looking for IMAGEX.EXE...
INFO: Looking for BCDBOOT.EXE...
INFO: Session key is E765F413-44E9-4F9B-AEA5-DBC8A726F7A6
INFO: Inspecting the WIM...
INFO: Configuring and formatting the VHD...
INFO: Applying the WIM...
[ 100% ] Applying progress
INFO: Making the VHD bootable with BCDBoot...
INFO: Unmounting the VHD...
Summary: Errors: 0, Warnings: 0, Successes: 1
INFO: Done.

Magical. Now I've got a 5 gig VHD file that I can setup to boot from directly as described here. The first time I start up, it'll be 95% into the setup process and just ready to detect my hardware. It's a nice "OEM-like" VHD that I can use again and again.

Since I'm only using these VHDs temporarily (for a week or two for testing) I won't use an activation key and instead leave that field blank during setup. That'll buy me 30 days of testing if I need to, and I can easily start over by just starting over with my new fresh VHD.

Enjoy! Now go tell Mike and his team that they're awesome. Go ahead. I'll wait here.

Related Links

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.