<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jeff Wilcox &#187; Windows</title>
	<atom:link href="http://www.jeff.wilcox.name/topics/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jeff.wilcox.name</link>
	<description>Silverlight, rich client apps and web development</description>
	<lastBuildDate>Mon, 26 Jul 2010 17:56:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Getting started with code signing for under $100</title>
		<link>http://www.jeff.wilcox.name/2010/02/codesigning101/</link>
		<comments>http://www.jeff.wilcox.name/2010/02/codesigning101/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 05:33:47 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/02/codesigning101/</guid>
		<description><![CDATA[I recently documented the steps to "code signing 101": acquiring a trusted cert/key pair, the process, and then signing an app.]]></description>
			<content:encoded><![CDATA[<p><strong>Update 3/15/10: Silverlight 4 supports code signing elevated trust .XAP files</strong></p>
<p>I recently jumped in and acquired an Authenticode code signing certificate &amp; key pair. It’s great being able to sign my .NET executables, installers, and even Visual Studio 2010 extensions.</p>
<p>I’m documenting my efforts here in the hope that others would be able to follow the relatively straightforward process – there’s not much magic other than learning to export and work with the certificate mechanisms inside Windows. But I know a lot of devs see it as a black magic art, and really it’s just about time, money, and some quick learning.</p>
<h4>Which dialog would you click ‘Yes’ on?</h4>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="FakeFirefox" border="0" alt="FakeFirefox" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/FakeFirefox.png" width="498" height="295" /></p>
<p>Windows 7 is leaps and bounds ahead of Vista in terms of usability. The improved User Account Control experience is nice. I think that a lot of people are finally becoming more wary of unsigned software, especially installers.</p>
<p>With the net full of stories of mirror servers becoming compromised, or people blinding clicking yes on many dialogs, the assurance of the dialog without the scary orange warning banner is the one I think every software developer would like to offer their customers. It’s the professional thing to do.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="UacFirefox" border="0" alt="UacFirefox" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/UacFirefox.png" width="498" height="295" />&#160;</p>
<p>So here we are, from start (no cert) to finish (signing a .NET app). It only took about two days to go through the identity verification process, but the time was well worth it – and the rest is easy given the nice signing tools in Windows and Visual Studio.</p>
<p>We’ll be getting a certificate &amp; private key through a trusted root certificate authority (CA) provider, not test signing or self-signing. If you’ve ever purchased an SSL certificate for your web servers, similar process.</p>
<p>For a list of current program members, see <a href="http://support.microsoft.com/kb/931125">this download</a> on the Microsoft site – there are hundreds of businesses and governments in the program.</p>
<p>Some corporate IT departments will have their own internal CA, so although those companies can sign apps for internal use, using them on machines without that CA cert installed will yield the un-trusted publisher dialog.</p>
<h4>What is Authenticode?</h4>
<p>Authenticode is the name for the code signing system on Windows. There are <a href="http://msdn.microsoft.com/en-us/library/ms537364(VS.85).aspx">many tools from Microsoft</a> that are core to code signing and ship in the Windows SDK.</p>
<p>Code signing certificates have an expiration date, but as long as a timestamp server is used when signing, signed apps can still be used and verified. Certificates can also be revoked if ever compromised.</p>
<p>For good measure, here’s a short Wikipedia page on <a href="http://en.wikipedia.org/wiki/Code_signing">code signing</a>, and the MSDN document “<a href="http://msdn.microsoft.com/en-us/library/ms537361(VS.85).aspx">Introduction to Code Signing</a>”.</p>
<h4>What code signing is not</h4>
<p>Signing is only a way of proving that some person or company is who they say they are. It doesn’t tell you whether there’s a nice person, or in any way validate functionality of an app.</p>
<p>Also, .NET projects have a “Signing” tab, but this is actually a feature called <a href="http://msdn.microsoft.com/en-us/magazine/cc163583.aspx">Strong Naming</a>, and is different. Most commercial software products using .NET will be both strong named, <em>plus</em> be code signed.</p>
<h4>What all can you use your $99/year key for?</h4>
<ul>
<li>Signing Windows executables</li>
<li>.NET programs, class libraries, ClickOnce apps</li>
<li>.MSI installer files</li>
<li>Adobe AIR apps</li>
<li>Java JARs</li>
<li>Microsoft Office/VBA macros</li>
<li>Mozilla objects and extensions</li>
<li>Signing Visual Studio extension packages (.vsix files), although SignTool doesn’t directly support this (no SIP module)</li>
</ul>
<p><em>Note that only Verisign offers code signing certificates for Windows device drivers through a special program for kernel-mode code signing.</em></p>
<h4>How does Microsoft do code signing?</h4>
<p>Obviously the Microsoft corporate keys are extremely secure and private. All signing is performed through a set of intricate systems that accept builds, check conditions, scan for viruses, and who knows what else… and eventually provide the signed binaries.</p>
<p>It’s pretty much a black box to us as engineers, but it works for hundreds of thousands of files.</p>
<p>As a dev, I’ve had more than my share of wild Friday nights trying to get code strong named and signed: there’s a big process and it revolves around a lot of people, smart cards, and it eventually works out.</p>
<h2>Step-by-step guide to purchasing a certificate</h2>
<p>Here’s my experience with getting a certificate. Different certification companies may have different processes, but in general you can be sure that you will need to do a lot to provide proof and authenticity of your name/company.</p>
<p>You can purchase a personal certificate (independent developer, professional geek) quicker than a corporate certificate given the different proof requirements.</p>
<p>Since the name/company name is what will be shown in the publisher field, you obviously wouldn’t want to get a personal certificate for company use. Also, be aware that the address you provide to a signing company will be embedded inside the certificate.</p>
<p>I purchased my code signing cert through <a href="https://secure.ksoftware.net/code_signing.html">K Software</a>, which is an official reseller of <a href="http://www.comodo.com/">Comodo</a> certificates, a popular Level 2 CA whose certificates are part of the root CA program on computers everywhere. The certificate costs $99 per year. I’ve heard of other companies sometimes offering specials as low as $65 a year, and others such as Verisign asking $499 a year.</p>
<p>Since there is some pain in the process (producing copious amounts of evidence) and waiting for that to be validated, you may want to consider purchasing a multi-year certificate and skip having to renew yearly.</p>
<p>You must use Windows and either Internet Explorer or Firefox to make the initial request. After the entire process is complete and the certificate is issued (days later), you will need to use the same computer and browser to complete the process. You will then export the certificate and private key to a file so you can store it safely somewhere.</p>
<h4>What proof will be required</h4>
<p>This is a partial list, the authentication process may require other documents. Most verification can be done through fax, mail, or even email.</p>
<p>If you’ve ever purchased an SSL certificate, it’s almost the same exact process.</p>
<ul>
<li>Your own domain name:</li>
</ul>
<ul>
<li>The domain’s WHOIS records must match the information you provide in your order.</li>
<li>If you use Private Registration services, you’ll need proof from the private registration company that you own the domain and your address matches. This can be a pain.</li>
</ul>
<li>Corporate entities:</li>
<ul>
<li>Articles of Incorporation</li>
<li>Business License</li>
<li>Other documentation such as DUNS details</li>
</ul>
<li>Individuals:</li>
<ul>
<li>Driver’s license or passport</li>
<li>Recent utility statements with matching data</li>
<li>Phone statement with matching information, name, and phone number where final phone verification will be performed</li>
</ul>
<p>This information will be asked for after you order and pay for the service. It is performed by the CA (Comodo in my case), <em>not</em> by the company or reseller you buy the service from.</p>
<p>For the remainder of this section, everything will be specific to Comodo. I found them helpful, quick and responsive, and professional, so I would definitely recommend their service. It is a great value when purchased through a reseller.</p>
<h4>Step 1: Register with the CA to track your validation tickets and receive support</h4>
<p>You’ll need to do this with an email address at your domain name. You register with the same email you’ll use in the next step.</p>
<p>If you don’t usually receive mail at your domain, you should be able to easily setup mail forwarding to your normal mail address. On a Windows server, <a href="http://www.smartertools.com/SmarterMail/Free-Windows-Mail-Server.aspx">SmarterMail Free</a> sets up in minutes and is great for this.</p>
<p>Simply create an account at Comodo Support for this: <a title="https://support.comodo.com/index.php?_m=core&amp;_a=register" href="https://support.comodo.com/index.php?_m=core&amp;_a=register">https://support.comodo.com/index.php?_m=core&amp;_a=register</a></p>
<h4>Step 2: Submit basic data and purchase</h4>
<p>Start at the K Software site, which is a reseller of Comodo’s: <a title="https://secure.ksoftware.net/code_signing.html" href="https://secure.ksoftware.net/code_signing.html">https://secure.ksoftware.net/code_signing.html</a></p>
<p>Current prices are $99 US for one year, $198 for 2 years, and so on.</p>
<p>After navigating to the page, click Buy Now. Internet Explorer will pop up a message that the site is attempting to perform a digital certificate operation. Click Yes.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="WebAccessConfirmation" border="0" alt="WebAccessConfirmation" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/WebAccessConfirmation.png" width="528" height="291" /> </p>
<p>On the order form page, you will submit your details, including address, email, etc. The email address needs to be an email address on your domain name that can be verified, <em>not</em> a Hotmail or Google Mail address. Note that this information will be embedded inside the final issued certificate.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="OrderForm" border="0" alt="OrderForm" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/OrderForm.png" width="685" height="419" /> </p>
<p>Important values at the end of the page:</p>
<ul>
<li>CSP should be Microsoft Enhanced Cryptographic Provider v1.0 (the default)</li>
<li>Key size: 2048 is fine for most people</li>
<li>Exportable: definitely – if you don’t check this, you can’t get a PKCS 12 (.pfx on Windows) file to use for signing, and would have to do all signing on that machine</li>
<li>User protected: Leave this unchecked</li>
</ul>
<p>After clicking Submit Order, you’ll go to a payment page. I used PayPal and was done in seconds.</p>
<h4>Step Three: You’ll be contacted</h4>
<p>At this point you’re done with the K Software order. You will be contacted via e-mail from Comodo, and they’ll step you through what verification they need at that time, and how to submit it.</p>
<p>In my case I had to go through several rounds of verification, including sending a recent phone bill.</p>
<p>I ran into some hiccups because the domain name I used for the e-mail address, though owned by me, is hard to prove: my WHOIS data all says ‘Domains By Proxy’, which is the provider of private registration services for GoDaddy. I had to find a way to provide proof that I own the domain.</p>
<p>The final verification step is when they eventually call your phone number. After that call, they’ll issue the certificate approval, and you’ll receive a final e-mail about 20 minutes later to go pick up the certs.</p>
<p>This step took me 1.5 business days including waiting time.</p>
<h4>Step Four: Pick up your key</h4>
<p>On the same computer you started the operation on, and same browser, click on the link provided in the e-mail Comodo sent when the key was ready.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="KSoftwarePickup" border="0" alt="KSoftwarePickup" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/KSoftwarePickup.png" width="685" height="531" /> </p>
<p>On this page, you’ll again receive a notification about a certificate operation. That’s fine. At this point you now have the key stored in your browser certificate system.</p>
<h4>Step Five: Export your key</h4>
<p>This step is for Internet Explorer users. If you’re using Mozilla Firefox, <a href="http://blog.ksoftware.net/2009/10/exporting-your-code-signing-certificate-to-a-pfx-file-from-firefox/">here’s some other instructions</a>.</p>
</p>
<p>In IE now, click Tools | Internet Options. Click on the Content tab, and then the Certificates button:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="InternetOptions" border="0" alt="InternetOptions" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/InternetOptions.png" width="455" height="573" /> </p>
<p>Within the Personal (first) tab of the Certificates dialog, click on the new certificate issued by UTN-USERFirst-Object (this is one of the many Comodo level 2 CAs in the Windows root CA program):</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Certificates" border="0" alt="Certificates" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/Certificates.png" width="551" height="509" /> </p>
<p>Then click ‘Export…’. In the Certificate Export Wizard, read the useless text and click Next.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="ExportWizardStart" border="0" alt="ExportWizardStart" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/ExportWizardStart.png" width="545" height="498" /> </p>
<p>Select the option ‘Yes’ for exporting the private key along with the certificate.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="ExportPrivateKeyPlease" border="0" alt="ExportPrivateKeyPlease" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/ExportPrivateKeyPlease.png" width="545" height="498" /> </p>
<p>Next, you pick the file format. Only PFX/PKCS #12 should be available. I checked both ‘Include all certificates in the certification path if possible’ and ‘Export all extended properties’, though to be honest I haven’t a clue whether this is needed.</p>
<p>I wouldn’t recommend clicking the delete private key option, I like knowing that on this particular machine I can still re-export the cert as needed in the future.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="ExportTypeAndOptions" border="0" alt="ExportTypeAndOptions" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/ExportTypeAndOptions.png" width="545" height="498" /> </p>
<p>Now, come up with a password to protect the file. You will need to use this password when using tools such as SignTool.exe, or setting up an automated code signing process of your own.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="ExportKeyPasswordDialog" border="0" alt="ExportKeyPasswordDialog" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/ExportKeyPasswordDialog.png" width="545" height="498" /> </p>
<p>Finally, pick where you want your .PFX file stored.</p>
<h4>Step Six: Protect your key</h4>
<p>Although code signing certificates have a mechanism through the CA to revoke keys, <strong>you do not ever want to have to do this.</strong></p>
<p>Take precautions. It is your duty to protect your key. Many people find ways to store this information through smart card or other physical security mechanisms.</p>
<p>As an individual, it’s pretty easy for me: Only I know the password, I have the file securely stored, and I don’t need to worry about sharing it with others.</p>
<p>Business entities and groups will have more trouble coming up with the appropriate processes and systems for this. Ideally some sort of automated system should be used to perform the code signing, with alternative authentication; providing the key file and a password is not the best method.</p>
<h4>Import Wizard Note</h4>
<p>To manually sign on another machine, you’ll want to double-click on the .pfx file. An import wizard will open up that will allow you to install the cert and private key on your machine.</p>
<p>For manual signing you typically select from your private certificate store on the machine, instead of using the .pfx file directly. For automated signing, you probably will use the .pfx.</p>
<h2>How to sign your apps and libraries</h2>
<p>Now the fun part. Armed with your new code signing certificate and private key, you’re ready to go SignTool.exe’ing.</p>
<p>SignTool is included with the Windows 6.0 and 7.0A SDKs, and you’ll have it in your path if you have Visual Studio 2008 or 2010 installed and are using the associated Visual Studio Command Prompt.</p>
<p>You can create scripts to sign quickly using command line parameters, or even write .NET apps using types in the System.Security.Cryptography.X509Certificates namespace.</p>
<p>It’s easiest to get started by manually signing, using the Digital Signature Wizard. From a Visual Studio 2008 Command Prompt, for instance, run:</p>
<blockquote><p>signtool.exe signwizard</p>
</blockquote>
<p>This will popup the wizard that will walk you through.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Digital Signature Wizard" border="0" alt="Digital Signature Wizard" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/DigitalSignatureWizard.png" width="545" height="431" /></p>
<p>Select the file you want to sign:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Digital Signature Wizard (3)" border="0" alt="Digital Signature Wizard (3)" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/DigitalSignatureWizard3.png" width="545" height="431" /></p>
<p>The ‘Typical’ option will let you pick from the certificate store on your machine. You don’t actually select the previously-exported .PFX file when manually signing.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Digital Signature Wizard (4)" border="0" alt="Digital Signature Wizard (4)" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/DigitalSignatureWizard4.png" width="545" height="431" /></p>
<p>Here I click ‘Select from Store…’:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Digital Signature Wizard (5)" border="0" alt="Digital Signature Wizard (5)" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/DigitalSignatureWizard5.png" width="545" height="431" /></p>
<p>Which pops up a Windows dialog listing available code signing certificates.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="SelectACertificate" border="0" alt="SelectACertificate" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/SelectACertificate.png" width="471" height="266" /> </p>
<p>Here I can verify the goods:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Digital Signature Wizard (6)" border="0" alt="Digital Signature Wizard (6)" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/DigitalSignatureWizard6.png" width="545" height="431" /></p>
<p>On the next wizard page, you can optionally offer more information here as appropriate.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Digital Signature Wizard (7)" border="0" alt="Digital Signature Wizard (7)" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/DigitalSignatureWizard7.png" width="545" height="431" /> </p>
<p>The last optional, but highly recommended step, is to use the timestamp server provided by the CA. This is a service that authenticates when the data (your app) was signed.</p>
<p>This means that your app will continue to be valid, even after the certificate expires, as long as the cert is not revoked.</p>
<p>For Comodo, their timestamping server is: <a title="http://timestamp.comodoca.com/authenticode" href="http://timestamp.comodoca.com/authenticode">http://timestamp.comodoca.com/authenticode</a></p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Digital Signature Wizard (8)" border="0" alt="Digital Signature Wizard (8)" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/DigitalSignatureWizard8.png" width="545" height="431" /></p>
<p>Click Next and you’ll see the summary of what signing is to take place.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Digital Signature Wizard (9)" border="0" alt="Digital Signature Wizard (9)" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/DigitalSignatureWizard9.png" width="545" height="431" /></p>
<p>After clicking Finish, the dialog will go away, and pretty soon you should receive a success/failure message.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Digital Signature Wizard (10)" border="0" alt="Digital Signature Wizard (10)" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/DigitalSignatureWizard10.png" width="440" height="203" /></p>
<h4>CodeSign.exe Parameters</h4>
<p>You can also code sign in scripts and the command line using arguments. For instance, here’s a sample made-up signing argument list. You can specify any number of files to sign as the final arguments.</p>
<blockquote><p>signtool.exe sign /f PathToKeysAndCert.Pfx /p “MySuperSecretPasswordToUseThePfxFile” /v /t http://timestamp.comodoca.com/authenticode “C:\MyFileToSign.exe”</p>
</blockquote>
</p>
<p>For all the parameters, type ‘signtool sign /?’</p>
<h4>That’s it!</h4>
<p>You can use a variety of tools to check that the signing works fine, including just examining the file in the Windows explorer.</p>
<p>Authenticode-signed executables, MSIs and libraries will have a ‘Digital Signatures’ tab in the properties window (though not irregular file types, such as Adobe AIR files).</p>
<p>Here’s the .exe I signed:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="FileProperties" border="0" alt="FileProperties" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/FileProperties.png" width="451" height="565" />&#160;&#160;&#160; </p>
<p>And that’s it! <strong>Ship it!</strong></p>
<p>Your customers will have that extra level of confidence when using your application. At some point, the more more professional software developers and software companies code sign, the more likely customers will be able to make proper security decisions about their computers… and the real benefit of the crisp user account control user interface comes to light.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VerifiedPublisher" border="0" alt="VerifiedPublisher" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/VerifiedPublisher.png" width="498" height="295" /> </p>
<p>Hope this helps. Let me know how your experiences with code signing go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/02/codesigning101/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Renaming Xap to Zip is dead. Long live renaming Xap to Zip!</title>
		<link>http://www.jeff.wilcox.name/2008/11/long-live-renaming/</link>
		<comments>http://www.jeff.wilcox.name/2008/11/long-live-renaming/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 01:16:20 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2008/11/01/long-live-renaming/</guid>
		<description><![CDATA[Teach Windows to treat Xap files as first class compressed folders with this simple registry entry. After applying, you&#8217;ll be able to open .Xap files and view their contents, and get the same shell experience as Zips have: If you&#8217;ve ever had to do the &#34;rename .Xap to .Zip&#34; routine while doing Silverlight development, then [...]]]></description>
			<content:encoded><![CDATA[<p>Teach Windows to treat Xap files as first class compressed folders with this simple registry entry. After applying, you&#8217;ll be able to open .Xap files and view their contents, and get the same shell experience as Zips have:</p>
<p><img src="http://media.jeff.wilcox.name/blog/view/XapExtension.png" /> </p>
<p>If you&#8217;ve ever had to do the &quot;rename .Xap to .Zip&quot; routine while doing Silverlight development, then you&#8217;ll enjoy this fix. The entry also sets the MIME type of .Xaps to &quot;application/x-silverlight-app&quot;, so it relates to my <a href="http://www.jeff.wilcox.name/2008/11/01/xap-mime-type/">earlier post about the MIME type</a>, too.</p>
<p>I&#8217;ve been using this on my Windows Vista and Windows Server 2008 workstation, but have not tried it on XP.</p>
<p><strong>XNA users:</strong> <a href="http://blog.j-maxx.net/default.aspx">Jeff Klawiter</a> pointed out in the comments that part of the XNA Framework uses .xap for its project file extension. So, beware. Sucks that there is overlap.</p>
<p><strong>Disclaimer: Use this registry file at your own risk. I am not responsible in any way for the results. As developers like to say, &quot;it works great on my machine!&quot;</strong></p>
<p>Download and run this registry patch: <a href="http://media.jeff.wilcox.name/blog/view/silverlight/xap.reg">Xap.reg</a></p>
<p>Here&#8217;s the contents of the registry patch:</p>
<blockquote><p>Windows Registry Editor Version 5.00 </p>
<p>[HKEY_CLASSES_ROOT\.xap]     <br />&quot;PerceivedType&quot;=&quot;compressed&quot;      <br />&quot;Content Type&quot;=&quot;application/x-silverlight-app&quot;      <br />@=&quot;CompressedFolder&quot; </p>
<p>[HKEY_CLASSES_ROOT\.xap\CompressedFolder] </p>
<p>[HKEY_CLASSES_ROOT\.xap\OpenWithProgids]     <br />&quot;CompressedFolder&quot;=&quot;&quot; </p>
<p>[HKEY_CLASSES_ROOT\.xap\PersistentHandler]     <br />@=&quot;{098f2470-bae0-11cd-b579-08002b30bfeb}&quot;</p>
</blockquote>
<p>The experience before the patch:</p>
<p><img src="http://media.jeff.wilcox.name/blog/view/XapExtensionBefore.png" /> </p>
<p>And after:</p>
<p><img src="http://media.jeff.wilcox.name/blog/view/XapExtensionAfter.png" /> </p>
<p>Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2008/11/long-live-renaming/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Using IELaunchURL in C# to launch a protected mode Internet Explorer 7 window</title>
		<link>http://www.jeff.wilcox.name/2008/09/using-ielaunchurl-in-c-to-launch-a-protected-mode-internet-explorer-7-window/</link>
		<comments>http://www.jeff.wilcox.name/2008/09/using-ielaunchurl-in-c-to-launch-a-protected-mode-internet-explorer-7-window/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 00:49:40 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2008/09/25/using-ielaunchurl-in-c-to-launch-a-protected-mode-internet-explorer-7-window/</guid>
		<description><![CDATA[By popular demand, here&#8217;s the C# equivalent of the C/C++ program I posted earlier today. As things work in the Windows native code world, the C# equivalent takes about 80 lines of code (vs 30). Might be the XML comments though. The main method to the program; if the URL is passed in as a [...]]]></description>
			<content:encoded><![CDATA[<p>By popular demand, here&#8217;s the C# equivalent of the C/C++ program I posted earlier today. As things work in the Windows native code world, the C# equivalent takes about 80 lines of code (vs 30). Might be the XML comments though.</p>
<p>The main method to the program; if the URL is passed in as a parameter, it will be sent to IE.</p>
<div class="wlWriterSmartContent" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:dcc98cba-b2a0-41bf-aa08-4916bf9d23bb" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre name="code" class="c-sharp">class Program
{
    static int Main(string[] args)
    {
        string url = args.Length &gt; 0 ? args[0] : null;
        return ProtectedModeHelper.LaunchInternetExplorer(url);
    }
}</pre>
</div>
<p><strong>Structures that need to be defined:</strong></p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa767955(vs.85).aspx">IELAUNCHURLINFO</a> (can be found in the Windows SDK iepmapi.h header file)<br /><a href="http://msdn.microsoft.com/en-us/library/ms684873(VS.85).aspx">PROCESS_INFORMATION</a> (used by CreateProcess, found on <a href="http://www.pinvoke.net/default.aspx/Structures/PROCESS_INFORMATION.html">PInvoke.net</a>)</p>
<p><strong>Safe native methods:</strong></p>
<p>ieframe.dll: <a href="http://msdn.microsoft.com/en-us/library/aa767962(VS.85).aspx">IELaunchURL</a></p>
<p>Here&#8217;s the helper class and native methods that I came up with. The return value of LaunchInternetExplorer is the PID, or 0. If the machine is not running Windows Vista, then you&#8217;ll receive a NotSupportedException.</p>
<p><strong>ProtectedModeHelper.cs</strong></p>
<p><div class="wlWriterSmartContent" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:483e2c80-0320-4c32-a361-359e7e2e87b3" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre name="code" class="c-sharp">using System;
using System.Runtime.InteropServices;

namespace YourNamespaceHere
{
    // Engineered from iepmapi.h in the Windows SDK
    [StructLayout(LayoutKind.Sequential)]
    internal struct IELAUNCHURLINFO
    {
        public int cbSize;
        public int dwCreationFlags;
    }

    // PInvoke.net
    // http://www.pinvoke.net/default.aspx/Structures/PROCESS_INFORMATION.html
    [StructLayout(LayoutKind.Sequential)]
    internal struct PROCESS_INFORMATION
    {
        public IntPtr hProcess;
        public IntPtr hThread;
        public int dwProcessId;
        public int dwThreadId;
    }

    /// &lt;summary&gt;
    /// Native methods class.
    /// &lt;/summary&gt;
    internal static class SafeNativeMethods
    {
        /// &lt;summary&gt;
        /// The Internet Explorer UI library.
        /// &lt;/summary&gt;
        private const string InternetExplorerUILibrary = "ieframe.dll";

        /// &lt;summary&gt;
        /// Launch a URL with Internet Explorer. Works with IE's protected
        /// mode.
        /// &lt;/summary&gt;
        /// &lt;param name="url"&gt;The URI to navigate to.&lt;/param&gt;
        /// &lt;param name="pProcInfo"&gt;Process information struct by reference
        /// that will contain the opened process ID.&lt;/param&gt;
        /// &lt;param name="lpInfo"&gt;The launch information struct.&lt;/param&gt;
        /// &lt;returns&gt;Returns a value indicating whether the native call was
        /// successful.&lt;/returns&gt;
        [DllImport(InternetExplorerUILibrary)]
        internal static extern bool IELaunchURL(
            [MarshalAs(UnmanagedType.LPWStr)] string url,
            ref PROCESS_INFORMATION pProcInfo,
            ref IELAUNCHURLINFO lpInfo);
    }

    /// &lt;summary&gt;
    /// Launch a protected mode IE and provide the process ID.
    /// &lt;/summary&gt;
    public static class ProtectedModeHelper
    {
        /// &lt;summary&gt;
        /// Launch Internet Explorer and return the PID. Requires Vista; an
        /// Exception will be thrown on platforms prior to it.
        /// &lt;/summary&gt;
        /// &lt;param name="url"&gt;The url to navigate to. Providing null will
        /// navigate the browser to the user's homepage.&lt;/param&gt;
        /// &lt;returns&gt;Returns the IE process ID if successful, or 0.&lt;/returns&gt;
        public static int LaunchInternetExplorer(string url)
        {
            if (Environment.OSVersion.Version.Major &gt;= 6)
            {
                PROCESS_INFORMATION pi = new PROCESS_INFORMATION();
                IELAUNCHURLINFO li = new IELAUNCHURLINFO();
                li.cbSize = Marshal.SizeOf(typeof(IELAUNCHURLINFO));
                return SafeNativeMethods.IELaunchURL(url, ref pi, ref li) ?
                    pi.dwProcessId : 0;
            }
            else
            {
                throw new NotSupportedException("Protected Mode requires Windows Vista or later.");
            }
        }

        /// &lt;summary&gt;
        /// Launch Internet Explorer and returns the PID.
        /// &lt;/summary&gt;
        /// &lt;returns&gt;Returns the IE process ID if successful, or 0.&lt;/returns&gt;
        public static int LaunchInternetExplorer()
        {
            return LaunchInternetExplorer(null);
        }
    }
}</pre>
</div>
<p>Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2008/09/using-ielaunchurl-in-c-to-launch-a-protected-mode-internet-explorer-7-window/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using IELaunchURL to launch and retrieve the PID of a protected mode IE7 window</title>
		<link>http://www.jeff.wilcox.name/2008/09/using-ielaunchurl-to-launch-and-retrieve-the-pid-of-a-protected-mode-ie7-window/</link>
		<comments>http://www.jeff.wilcox.name/2008/09/using-ielaunchurl-to-launch-and-retrieve-the-pid-of-a-protected-mode-ie7-window/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 22:46:00 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2008/09/25/using-ielaunchurl-to-launch-and-retrieve-the-pid-of-a-protected-mode-ie7-window/</guid>
		<description><![CDATA[With the release of Windows Vista, Windows Internet Explorer 7 introduced the Protected Mode feature for having a more secure experience in the browser. More information from one of the original IE Blog posts and the Protected Mode Internet Explorer Reference on MSDN. Earlier today I put together a super simple app to get me [...]]]></description>
			<content:encoded><![CDATA[<p>With the release of Windows Vista, Windows Internet Explorer 7 introduced the <a href="http://www.microsoft.com/windows/windows-vista/features/IE7-protected-mode.aspx">Protected Mode feature</a> for having a more secure experience in the browser. More information from one of the <a href="http://blogs.msdn.com/ie/archive/2006/02/09/528963.aspx">original IE Blog posts</a> and the <a href="http://msdn.microsoft.com/en-us/library/ms537312(VS.85).aspx">Protected Mode Internet Explorer Reference</a> on MSDN.</p>
<p>Earlier today I put together a super simple app to get me the PID of the protected mode and wanted to share that.</p>
<p>On my team, we have a test harness that handles automating the web browser. To run a test using the <a href="http://code.msdn.microsoft.com/silverlightut/">Silverlight Unit Test Framework</a>, our console application needs to launch the new browser process, retrieve its process ID (PID), and then wait for completion. During this time, we also poll the process to make sure that it is still alive.</p>
<p>Well, if the test harness is run from an unelevated command prompt (the ideal way to run it), then we were finding that the Internet Explorer process was immediately exiting. The simple pattern was:</p>
<ul>
<li>Test harness launches iexplore.exe and retrieves PID 5860.  </li>
<li>iexplore.exe uses launches a Protected Mode process (let&#8217;s say PID 9600), and then the initial process ends.  </li>
<li>The test harness thought that the process had ended prematurely, even though iexplore.exe PID 9600 was actually running the test scenarios.</li>
</ul>
<p>The simple solution was to write a simple C++ shim for Windows Vista that would use the protected mode &#8220;<a href="http://msdn.microsoft.com/en-us/library/aa767962(VS.85).aspx">IELaunchURL</a>&#8221; API (by including iepmapi.h from the Windows SDK) and simply return the protected mode PID as the application&#8217;s return value. In a failure state, it would return 0. The harness can then special case the Windows situation and use the return value PID to monitor the state of the protected mode browser.</p>
<p>Here&#8217;s the C++ source code that I wrote as a proof of concept. It expects that you provide the URL to navigate to as the single parameter.</p>
<div class="wlWriterSmartContent" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:1148c160-a17e-477b-8697-b358177ced92" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre name="code" class="c-sharp">#include "stdafx.h"

#include &lt;windows.h&gt;
#include &lt;iepmapi.h&gt;

HRESULT LaunchIE(LPCWSTR pszURL)
{
    PROCESS_INFORMATION processInformation;
    IELAUNCHURLINFO launchInfo;

	launchInfo.cbSize = sizeof(IELAUNCHURLINFO);
    launchInfo.dwCreationFlags = NULL;

	DWORD pid = 0;
    HRESULT hr = IELaunchURL(pszURL, &#038;processInformation, &#038;launchInfo);
    if (SUCCEEDED(hr))
    {
        WaitForInputIdle(processInformation.hProcess, 2000);
		pid = processInformation.dwProcessId;
		CloseHandle(processInformation.hProcess);
        CloseHandle(processInformation.hThread);

		return pid;
    }
    return 0;
}

int _tmain(int argc, _TCHAR* argv[])
{
	if (argc == 2)
	{
		return LaunchIE(argv[1]);
	}
	return 0;
}</pre>
</div>
<p>Download the <a href="http://media.jeff.wilcox.name/blog/ut/ie7/StartInternetExplorer.exe">32-bit StartInternetExplorer.exe</a> application. Note: This is totally unsupported, use at your own risk, all that jazz. This isn&#8217;t a utility I&#8217;m using any longer, but did want to share since I didn&#8217;t find a whole lot of information on the web.</p>
<p>If building in Visual Studio, you should also modify the C++ project properties (under the Linker) to include the additional dependency of iepmapi.lib.</p>
<p>Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2008/09/using-ielaunchurl-to-launch-and-retrieve-the-pid-of-a-protected-mode-ie7-window/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple clocks: Great travel tool built into Windows Vista</title>
		<link>http://www.jeff.wilcox.name/2007/11/vista-multiple-clocks/</link>
		<comments>http://www.jeff.wilcox.name/2007/11/vista-multiple-clocks/#comments</comments>
		<pubDate>Tue, 06 Nov 2007 16:37:34 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows Vista]]></category>

		<guid isPermaLink="false">http://linux.jeff.wilcox.name/2007/11/06/vista-multiple-clocks/</guid>
		<description><![CDATA[The multiple clock feature of the date/time area in the taskbar of Windows Vista is great! I’m in Shanghai for a few weeks, and since Silverlight is a truly global collaboration, it’s a great feature to keep track of many time zones. Simply open up the date/time settings in the taskbar to add additional clocks.]]></description>
			<content:encoded><![CDATA[<p>The multiple clock feature of the date/time area in the taskbar of Windows Vista is great!  I’m in Shanghai for a few weeks, and since Silverlight is a truly global collaboration, it’s a great feature to keep track of many time zones.</p>
<p>Simply open up the date/time settings in the taskbar to add additional clocks.</p>
<p><img src="http://media.jeff.wilcox.name/blog/view/windows/vista_multiple_clocks.jpg" title="Multiple clocks in Windows Vista" style="width: 540px; height: 272px" alt="Multiple clocks in Windows Vista" border="0" height="272" width="540" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2007/11/vista-multiple-clocks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Vista&#8217;s &#8220;Restore Previous Versions&#8221; feature is a lifesaver</title>
		<link>http://www.jeff.wilcox.name/2007/03/vista-file-restore/</link>
		<comments>http://www.jeff.wilcox.name/2007/03/vista-file-restore/#comments</comments>
		<pubDate>Sun, 01 Apr 2007 07:45:06 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows Vista]]></category>

		<guid isPermaLink="false">http://linux.jeff.wilcox.name/2007/03/31/vista-file-restore/</guid>
		<description><![CDATA[[RAW] Last week a lot of my hard work was saved by Windows Vista and its updated System Restore capabilities.&#160; There are a lot of features hiding in Vista that not everyone is aware of, and this is one of those that is a real lifesaver but hidden away with that right mouse click. While [...]]]></description>
			<content:encoded><![CDATA[<p>[RAW]<br />
<P>Last week a lot of my hard work was saved by Windows Vista and its updated System Restore capabilities.&nbsp; There are a lot of features hiding in Vista that not everyone is aware of, and this is one of those that is a real lifesaver but hidden away with that right mouse click.</P></p>
<p><P>While cleaning up an enlistment to some code, I accidentally permanently deleted a very large tree that included some important code changes, representing a few hours of work over two days on refactoring.&nbsp; “Oops.”&nbsp; At this point, my first instinct was to run to one of those great undeleted tools such as <A class="" href="http://www.handyrecovery.com/" mce_href="http://www.handyrecovery.com/">HandyRecovery</A>… Until Windows actually recovers and overwrites the data on the drive, your deleted data is really still sitting there waiting to be reused.</P></p>
<p><P>However, I then remember that Volume Shadow Copy Service (or some form of it) had been meshed together with System Restore, and should be running on the machine.&nbsp; Thankfully it was, and it is really pretty easy to use—you can restore to a previous version, or simply save the previous version elsewhere.</P></p>
<p><P><IMG title="Vista - sample Restore Previous Versions dialog" style="WIDTH: 377px; HEIGHT: 503px" height=503 alt="Vista - sample Restore Previous Versions dialog" src="http://www.jeff.wilcox.name/blog/view/windows/restore_previous_versions_Doc.jpg" width=377 border=0 mce_src="http://www.jeff.wilcox.name/blog/view/windows/restore_previous_versions_Doc.jpg"></P></p>
<p><P>To use the tool, simply right-click on a file that you would like to&nbsp;examine previous versions of, and select &#8216;Restore previous versions&#8217;.&nbsp; If you&#8217;ve deleted an entire directory or directory tree like I have,&nbsp;right click on the parent directory&nbsp;and start from there.&nbsp;</P></p>
<p><P>Everything was right where I’d remembered it, no data lost, and a big feeling of relief (and thanks to the Windows client guys).</P></p>
<p><P>Technical details: <A href="http://channel9.msdn.com/ShowPost.aspx?PostID=286303">http://channel9.msdn.com/ShowPost.aspx?PostID=286303</A>&nbsp;(Channel 9 video)<BR>Marketing speak: <A href="http://www.microsoft.com/windows/products/windowsvista/features/details/shadowcopy.mspx">http://www.microsoft.com/windows/products/windowsvista/features/details/shadowcopy.mspx</A>&nbsp;</P></p>
<p>[/RAW]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2007/03/vista-file-restore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perform a full IIS 7 + ASP.NET install from the command prompt</title>
		<link>http://www.jeff.wilcox.name/2007/01/aspnet-full-iis7-install/</link>
		<comments>http://www.jeff.wilcox.name/2007/01/aspnet-full-iis7-install/#comments</comments>
		<pubDate>Mon, 29 Jan 2007 17:52:43 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Windows Vista]]></category>

		<guid isPermaLink="false">http://linux.jeff.wilcox.name/2007/01/29/aspnet-full-iis7-install/</guid>
		<description><![CDATA[[RAW] If you have a need to install the full version of IIS 7.0 (all features, options, and modules—including ASP.NET 2.0), you can do this from the command line using the new Package Manager tool as an alternative to the Add/Remove Windows Features interface. Simply execute the following from an elevated command prompt (it will [...]]]></description>
			<content:encoded><![CDATA[<p>[RAW]<br />
<P>If you have a need to install the full version of IIS 7.0 (all features, options, and modules—including ASP.NET 2.0), you can do this from the command line using the new Package Manager tool as an alternative to the Add/Remove Windows Features interface.</P></p>
<p><P>Simply execute the following from an elevated command prompt (it will also output a log file, that&#8217;s an optional parameter only):</P></p>
<p><P><TT>start /w %windir%\system32\pkgmgr.exe /l:logStep.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;IIS-FTPPublishingService;IIS-FTPServer;IIS-FTPManagement;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI</TT></P></p>
<p><P>This should work with Windows Vista Business, Enterprise, and Ultimate SKUs.&nbsp; On x64 machines, you’ll want to make sure to execute this from an elevated 64-bit command prompt.</P></p>
<p><P>Background:<BR>A useful new feature of IIS 7 is its componentization; if you don’t need a particular feature of the server, such as CGI, simply exclude it.</P></p>
<p><P>Often while performing testing or preparing a development workstation, using pkgmgr.exe can save a little time if you’re looking for all the features.&nbsp; You can also modify the parameters to leave off specific features.</P></p>
<p><P>Update:<BR>Looks like there&#8217;s finally a document on this at the IIS web site as well, so if you&#8217;re using Home Premium or want to learn more about pkgmgr.exe, check out the article at <A href="http://www.iis.net/default.aspx?tabid=2&amp;subtabid=25&amp;i=958" mce_href="http://www.iis.net/default.aspx?tabid=2&amp;subtabid=25&amp;i=958">http://www.iis.net/default.aspx?tabid=2&amp;subtabid=25&amp;i=958</A>.</P></p>
<p>[/RAW]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2007/01/aspnet-full-iis7-install/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Upgrading ASP.NET Applications to the Integrated Pipeline</title>
		<link>http://www.jeff.wilcox.name/2006/12/aspnet-upgraging-pipeline-mode/</link>
		<comments>http://www.jeff.wilcox.name/2006/12/aspnet-upgraging-pipeline-mode/#comments</comments>
		<pubDate>Tue, 12 Dec 2006 04:51:55 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Windows Vista]]></category>

		<guid isPermaLink="false">http://linux.jeff.wilcox.name/2006/12/11/aspnet-upgraging-pipeline-mode/</guid>
		<description><![CDATA[[RAW] There&#8217;s a helpful article at the IIS.NET site detailing a lot of what it means to upgrade your developer workstation to Vista, what changes IIS 7.0 brings, and ASP.NET application compatibility.&#160; Direct link to the article. The most important content in this article, in my opinion, is that which outlines the specific ASP.NET changes. [...]]]></description>
			<content:encoded><![CDATA[<p>[RAW]<br />
<P>There&#8217;s a <A class="" href="http://www.iis.net/default.aspx?tabid=2&amp;subtabid=25&amp;i=1223&amp;p=1" mce_href="http://www.iis.net/default.aspx?tabid=2&amp;subtabid=25&amp;i=1223&amp;p=1">helpful article</A> at the IIS.NET site detailing a lot of what it means to upgrade your developer workstation to Vista, what changes IIS 7.0 brings, and ASP.NET application compatibility.&nbsp; <A class="" href="http://www.iis.net/default.aspx?tabid=2&amp;subtabid=25&amp;i=1223&amp;p=1" mce_href="http://www.iis.net/default.aspx?tabid=2&amp;subtabid=25&amp;i=1223&amp;p=1">Direct link to the article.</A></P></p>
<p><P>The most important content in this article, in my opinion, is that which <A class="" href="http://www.iis.net/default.aspx?tabid=2&amp;subtabid=25&amp;i=1223&amp;p=5" mce_href="http://www.iis.net/default.aspx?tabid=2&amp;subtabid=25&amp;i=1223&amp;p=5">outlines the specific ASP.NET changes</A>.</P></p>
<p><P>Here is the list of known changes with IIS 7.0 at this time:</P></p>
<p><UL><br />
<LI>In Integrated mode, Application_OnError is not called for exceptions that occur in HttpApplication::Init</LI></p>
<p><LI>Server.ClearError in EndRequest does not clear exception message in Integrated mode</LI></p>
<p><LI>Integrated mode applications may write to a response in EndRequest after an exception has been formatted and written to the response</LI></p>
<p><LI>In Integrated mode, ASP.NET no longer suppresses the content type when the response is empty</LI></p>
<p><LI>Different windows identity in Forms authentication</LI></p>
<p><LI>Default Authentication_OnAuthenticate event does not raise in Integrated mode</LI></p>
<p><LI>In Integrated mode Request.RawUrl contains the new query string after RewritePath is called</LI></p>
<p><LI>Passport Network credentials authentication is not supported in Windows Vista</LI></p>
<p><LI>PassportAuthentication module is not part of the Integrated pipeline</LI></p>
<p><LI>Large, valid forms auth tickets (length &lt;= 4096 bytes) present in the query string are rejected by IIS 7.0</LI></p>
<p><LI>In Integrated mode, the ASP.NET request time-out is applied multiple times during the request, allowing the request to execute longer</LI></p>
<p><LI>Trace settings are not transferred to Server.Transfer target page</LI></p>
<p><LI>The method Httpcontext.Current.Response.Write() cannot work in Application_Onstart()</LI></p>
<p><LI>HttpRequest.LogonUserIdentity throws an exception when accessed before PostAuthenticateRequest</LI></p>
<p><LI>In Integrated mode, ASP.NET modules will receive the first unauthenticated request to IIS when Anonymous authentication is disabled</LI></p>
<p><LI>ASP.NET cannot impersonate the client identity until PostAuthenticateRequest</LI></p>
<p><LI>Content-Type header is not generated when charset and content type are set to empty string</LI></p>
<p><LI>In Integrated mode, both synchronous and asynchronous events raise for each module before the next module executes</LI></p>
<p><LI>Response headers are removed in Integrated mode after calling ClearHeader in a custom IHttpModule</LI></p>
<p><LI>Using Windows and Forms authentication together in Integrated mode is not supported</LI></p>
<p><LI>In Integrated mode, IIS always rejects new lines in response headers (even if ASP.NET enableHeaderChecking is set to false)</LI></p>
<p><LI>PreSendRequestHeaders and PreSendRequestContent events will raise together for each module</LI></p>
<p><LI>The ordering of modules is reversed for PreSendRequestHeaders and PreSendRequestContent when using Integrated mode</LI></p>
<p><LI>In Integrated mode, threading and queuing settings in are ignored</LI></p>
<p><LI>If a configuration file error is encountered when using Integrated mode, IIS, not ASP.NET, generates the error message</LI></p>
<p><LI>In Integrated mode, ASP.NET applications must subscribe to pipeline events during a module’s Init call</LI><br />
</UL></p>
<p>[/RAW]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2006/12/aspnet-upgraging-pipeline-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick guide: Installing ASP.NET v1.1 on Windows Vista</title>
		<link>http://www.jeff.wilcox.name/2006/11/aspnet-v11-vista-install/</link>
		<comments>http://www.jeff.wilcox.name/2006/11/aspnet-v11-vista-install/#comments</comments>
		<pubDate>Fri, 10 Nov 2006 04:48:14 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Windows Vista]]></category>

		<guid isPermaLink="false">http://linux.jeff.wilcox.name/2006/11/09/aspnet-v11-vista-install/</guid>
		<description><![CDATA[[RAW] Vista ships with .NET Framework 2.0 in the box, but ASP.NET v1.1 is still fully supported if you need it-and here&#8217;s how. If you&#8217;re trying to diagnose this problem, the error message you will receive without allowing v1.1 is a 404.2 – Not Found; the description is &#8220;the page you are requesting cannot be [...]]]></description>
			<content:encoded><![CDATA[<p>[RAW]<br />
<P>Vista ships with .NET Framework 2.0 in the box, but ASP.NET v1.1 is still fully supported if you need it-and here&#8217;s how. </P></p>
<p><P>If you&#8217;re trying to diagnose this problem, the error message you will receive without allowing v1.1 is a 404.2 – Not Found; the description is &#8220;the page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server.&#8221;</P></p>
<p><P><IMG title="Error message when v1.1 is not enabled" style="WIDTH: 540px; HEIGHT: 405px" height=405 alt="Error message when v1.1 is not enabled" src="http://www.jeff.wilcox.name/blog/view/iis/v11_enable_error.jpg" width=540 border=0 mce_src="http://www.jeff.wilcox.name/blog/view/iis/v11_enable_error.jpg"></P></p>
<p><H2>Install .NET Framework v1.1 &amp; v1.1 SP1 </H2><br />
<P>Prerequisite: You have installed IIS on the machine already (Control Panel – Add/Remove Windows Features) </P></p>
<p><UL><br />
<LI>Download and Install <A href="http://www.microsoft.com/downloads/details.aspx?familyid=262D25E3-F589-4842-8157-034D1E7CF3A3&amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=262D25E3-F589-4842-8157-034D1E7CF3A3&amp;displaylang=en">.NET Framework v1.1</A> </LI></p>
<p><LI>Download and install <A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=A8F5654F-088E-40B2-BBDB-A83353618B38&amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=A8F5654F-088E-40B2-BBDB-A83353618B38&amp;displaylang=en">v1.1 Service Pack 1</A> </LI><br />
</UL></p>
<p><H2>Enable ASP.NET v1.1 in InetMgr </H2><br />
<P>Run &#8220;InetMgr&#8221; (even though the Run menu&#8217;s not in the Start Menu by default, you can still reach it by pressing [ <STRONG>Windows key</STRONG> ] + [ <STRONG>R </STRONG>]) </P></p>
<p><P>Click on your computer name in the tree, not the web site. This should be the top-most tree element. Double-click on &#8220;ISAPI and CGI Restrictions,&#8221; this is an icon in the center of the screen within the IIS group. </P></p>
<p><P><IMG title="v1.1 Enable Restrictions" style="WIDTH: 540px; HEIGHT: 405px" height=405 alt="v1.1 Enable Restrictions" src="http://www.jeff.wilcox.name/blog/view/iis/v11_enable_restrictions.jpg" width=540 border=0 mce_src="http://www.jeff.wilcox.name/blog/view/iis/v11_enable_restrictions.jpg"></P></p>
<p><P>Right-click on the ASP.NET list item entry and &#8220;Allow&#8221; it. You do not need to reset the web server. </P></p>
<p><P><IMG title="Right click and Allow" style="WIDTH: 540px; HEIGHT: 405px" height=405 alt="Right click and Allow" src="http://www.jeff.wilcox.name/blog/view/iis/v11_enable_allow.jpg" width=540 border=0 mce_src="http://www.jeff.wilcox.name/blog/view/iis/v11_enable_allow.jpg"></P></p>
<p><P><STRONG>You can also do this from an elevated command prompt using AppCmd.exe: </STRONG></P></p>
<p><P><TT>%windir%\system32\inetsrv\appcmd set config -section:isapiCgiRestriction /+.[path='%windir%\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll',allowed='true']</TT></P></p>
<p><H2>Creating v1.1 Applications </H2><br />
<P>Another obvious note, within the IIS Manager, you need to specify the application pool of choice when adding a new application. There is no concept of a v1.1 &#8220;integrated&#8221; mode, so your choices with v1.1 installed are: Integrated Pipeline 2.0, Classic/ISAPI 2.0, and Classic/ISAPI 1.1. </P></p>
<p><P><IMG title="Creating an ASP.NET v1.1 Application in InetMgr 7" style="WIDTH: 540px; HEIGHT: 405px" height=405 alt="Creating an ASP.NET v1.1 Application in InetMgr 7" src="http://www.jeff.wilcox.name/blog/view/iis/v11_enable_add_app.jpg" width=540 border=0 mce_src="http://www.jeff.wilcox.name/blog/view/iis/v11_enable_add_app.jpg"></P></p>
<p><P>Simply select the v1.1 application pool and you&#8217;re good to go!</P></p>
<p>[/RAW]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2006/11/aspnet-v11-vista-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Vista RTM: Making it happen for ASP.NET</title>
		<link>http://www.jeff.wilcox.name/2006/11/testing-asp-net-for-vista/</link>
		<comments>http://www.jeff.wilcox.name/2006/11/testing-asp-net-for-vista/#comments</comments>
		<pubDate>Thu, 09 Nov 2006 12:21:25 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Windows Vista]]></category>

		<guid isPermaLink="false">http://linux.jeff.wilcox.name/2006/11/09/testing-asp-net-for-vista/</guid>
		<description><![CDATA[[RAW] With the release of Windows Vista, the next generation Microsoft Platform for web developers looking to explore better integration between their applications and the web server. We&#8217;ve logged many hours over the last year making sure that the ASP.NET and IIS 7.0 experience is a success story, and I wanted to open by introducing [...]]]></description>
			<content:encoded><![CDATA[<p>[RAW]</p>
<p>With the release of Windows Vista, the next generation Microsoft Platform for web developers looking to explore better integration between their applications and the web server. We&#8217;ve logged many hours over the last year making sure that the ASP.NET and IIS 7.0 experience is a success story, and I wanted to open by introducing the new integrated mode and diving into some of what went on for the test team to bring the release to you.</p>
<h1>Integrated Mode: ASP.NET + IIS</h1>
<p>ASP.NET 2.0 shipped in October 2005 and was full of useful features, but on IIS 6 it still executed like a well-oiled Perl script would have a decade ago. For the most part, it sat on top of the web server, relying on an archaic native interface (ISAPI) to make it all happen. Simply enabling Windows authentication took two steps: One enabling it in the IIS manager, and the other configuring it your web.config file.</p>
<p>With Vista, all this is in the past: Handler mappings, authentication … it&#8217;s all a single story. One step to get a task done, a great new administrative interface to go with it. Being familiar with the work that&#8217;s gone on to make managed code a first-class citizen with IIS, I intend to use this blog as a place to share that experience.</p>
<p>I don&#8217;t intend to duplicate the great resources already online, so as a starting point, if you&#8217;re new to all this, please check out:</p>
<ul>
<li><a href="http://www.mvolo.com/">Mike Volodarsky&#8217;s &#8220;server-side&#8221;</a> blog</li>
<li>IIS.Net community site run by Microsoft, specifically the IIS7 <a href="http://www.iis.net/default.aspx?tabid=7">technical resources overview</a></li>
<li>The <a href="http://forums.iis.net/">IIS discussion forums</a> or <a href="http://forums.asp.net/">ASP.NET forums</a>, the best place to get your questions answered</li>
</ul>
<h1>Testing: Automation updates, new tools, overall process</h1>
<p>Testing ASP.NET, IIS, and Windows Vista together was a lot of work. It consisted of automation improvements, using new product features, adding test coverage, fixing test cases, and analyzing hundreds of thousands of automation results. Here&#8217;s a little bit of the behind-the-scenes work that happened from my perspective.</p>
<p>We rely on automation so much on the ASP.NET test team that it was critical to get our tests running on the new OS as soon as possible. Being able to kick off tests to run overnight means that I can devote the day to everything else: Resolving and fixing bugs, learning about and providing feedback on the product, and working on other exciting projects. This wouldn&#8217;t be possible without the large automation infrastructure we have in place. <a href="http://weblogs.asp.net/scottgu/archive/2004/10/28/249458.aspx">Scott Guthrie&#8217;s testing post</a> a few years ago really provides a great look at what&#8217;s involved in our testing.</p>
<h2>Integrated and classic application pool types</h2>
<p>As you can now place ASP.NET applications in either the IIS7 Integrated application pool or the Classic/ISAPI pool, we expanded the scope of our tests to run in both the integrated and classic modes. The default application pool type is now integrated; however, the classic mode is still around for compatibility, ASP.NET 1.1 SP1 applications, and other scenarios. If you&#8217;re impacted by a breaking change in the integrated mode, you can always just flip the application into the classic pool.</p>
<p>Expanding the possible contexts for all our tests to run in both modes meant more test results would be generated for each run, but the cost in additional time for execution is made up for by the presence of historical data and side-by-side results. Having results for the same underlying test, running into both pipeline modes, was really helpful for identifying bugs.</p>
<p>They weren&#8217;t all bugs either, some differences were as verifying the new <a href="http://blogs.iis.net/bills/archive/2006/10/19/Improving-Custom-Errors-for-IIS7-Server.aspx">IIS 7 error messages</a>.</p>
<h2>User account control</h2>
<p>The sweeping security improvements within Windows Vista made automation a little more difficult at first (that&#8217;s a good thing). Instead of just modifying some registry values to open the necessary firewall ports, changing a configuration file, or running a set of batch files, we had the fun challenge of interacting with User Account Control (UAC). Even though ASP.NET is a server-side process, our automation system is full of tools that run within the context of an end user session. Elevation to administrative privileges is needed for reimaging machines, configuring the product, and running tests. It took a lot of hard work by many people within the company to get us to where we are today.</p>
<h2>New tools like AppCmd</h2>
<p>The Microsoft philosophy of testing your products using your products is pretty fun at times. A good example that I have is the ability to take a snapshot of the web server configuration files with IIS 7—I can&#8217;t tell you how many times I use an older Windows 2003 machine and wish I could use this feature.</p>
<p>The AppCmd tool, located at %windir%\system32\inetsrv\appcmd.exe, is a great command-line interface to the web server. When we initially install IIS on a Vista machine, the scripts make a backup of the important IIS configuration files by calling &#8220;appcmd add backup Initial&#8221;. &#8220;Initial&#8221; is just the unique name for the backup. If you ever destroy the configuration files, you can simply issue an &#8220;appcmd restore backup Initial&#8221; command and you&#8217;re back in business, without having to examine what you did incorrectly.</p>
<p><img border="0" width="506" src="http://www.jeff.wilcox.name/blog/view/iis/AppCmdBackup.jpg" alt="AppCmd.exe sample console window" height="253" style="width: 506px; height: 253px" title="AppCmd.exe sample console window" /></p>
<h2>Testing Process</h2>
<p>Finally, there was the actual testing experience that had to happen. Part of the process:</p>
<ul>
<li>Creating a new run with a set of tests and the contexts in which they execute</li>
<li>Cross your fingers, hoping that the machines install Vista, the product, and come back online</li>
<li>Waiting as thousands of tests execute and log their results</li>
<li>Spending days investigating fun new Vista changes, improvements, bugs, fixing tests, and fixing the product</li>
<li>Repeat!</li>
</ul>
<p>We frequently performed &#8220;nightly&#8221; tests, which consist of the highest priority automation, along with a combination of Vista SKUs, product types, and languages. Test the SDK one week, and the full Visual Studio the following week; English, Arabic, Japanese, German; AMD64, x86, the list goes on!</p>
<p>Before each significant Vista milestone, we signed off by performing a major full automation test pass on the product. This was a major undertaking: one such test pass lasted a month and really pinpointed the work that needed to be done to finalize ASP.NET on Vista. If you haven&#8217;t already given the new IIS a try, run the IIS Manager after installing Vista and the web server, and try the &#8220;new&#8221; ASP.NET.</p>
<h1>In Closing</h1>
<p>I&#8217;m really proud of the quality of our product and hope that you find the new features and improvements really helpful in your work. Between the union of IIS + ASP.NET and the <a href="http://ajax.asp.net/">ASP.NET AJAX story</a>, there are some great reasons to use the Microsoft platform today. And you can <a href="http://www.iis.net/News/Item.aspx?i=1204">still use PHP too</a>!</p>
<p>Please let me know if you found this useful.</p>
<p>[/RAW]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2006/11/testing-asp-net-for-vista/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
