<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Vista Sidebar Gadget Developer Experience</title>
	<atom:link href="http://cromwellhaus.com/2007/05/vista-sidebar-gadget-developer-experience/feed/" rel="self" type="application/rss+xml" />
	<link>http://cromwellhaus.com/2007/05/vista-sidebar-gadget-developer-experience/</link>
	<description>Improving my craft...</description>
	<lastBuildDate>Sun, 13 May 2012 11:35:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Ryan</title>
		<link>http://cromwellhaus.com/2007/05/vista-sidebar-gadget-developer-experience/#comment-7</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Thu, 20 Dec 2007 02:14:22 +0000</pubDate>
		<guid isPermaLink="false">/blogs/ryanc/archive/2007/05/02/vista-sidebar-gadget-developer-experience.aspx#comment-7</guid>
		<description>Christian,

I was able to get this working with the runas option which wouldn&#039;t work.  Here&#039;s what I did:

1. Run VS 2005/2008 as Adminstrator.  Not the user administrator, but the &quot;Run as Administrator&quot; right click item in Vista.  This runs it under your account still, but elevated.

2. My External Tool looks like this:
   Command: c:\windows\system32\cmd.exe
   Arguments: /k mklink /D &quot;%userprofile%\AppData\Local\Microsoft\Windows Sidebar\Gadgets\$(SolutionFileName)gadget&quot; $(ProjectDir)


I wish there were a better variable than $(SolutionFileName), but with a Web Site project this doesn&#039;t seem possible.  Hope that helps.</description>
		<content:encoded><![CDATA[<p>Christian,</p>
<p>I was able to get this working with the runas option which wouldn&#8217;t work.  Here&#8217;s what I did:</p>
<p>1. Run VS 2005/2008 as Adminstrator.  Not the user administrator, but the &#8220;Run as Administrator&#8221; right click item in Vista.  This runs it under your account still, but elevated.</p>
<p>2. My External Tool looks like this:<br />
   Command: c:\windows\system32\cmd.exe<br />
   Arguments: /k mklink /D &#8220;%userprofile%\AppData\Local\Microsoft\Windows Sidebar\Gadgets\$(SolutionFileName)gadget&#8221; $(ProjectDir)</p>
<p>I wish there were a better variable than $(SolutionFileName), but with a Web Site project this doesn&#8217;t seem possible.  Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Jacob</title>
		<link>http://cromwellhaus.com/2007/05/vista-sidebar-gadget-developer-experience/#comment-6</link>
		<dc:creator>Christian Jacob</dc:creator>
		<pubDate>Fri, 23 Nov 2007 12:02:01 +0000</pubDate>
		<guid isPermaLink="false">/blogs/ryanc/archive/2007/05/02/vista-sidebar-gadget-developer-experience.aspx#comment-6</guid>
		<description>Hi Ryan,
great hint. Thank you. However, I wanted to add this as an &quot;external tool&quot; to the Visual Studio menu. Since the mklink executable must be started as admin, I an into problems there.

I tried the runas.exe as command and the /user:Administrator mklink-stuff as parameter. However, there are a couple of problems.

1. Since this command will be run as admin, it&#039;s not possible to redirect to %userprofile% since this will result in a symlink not in the users profile, but in the admins profile.

2. The only internal parameter for the gadgetname that made sense to me was (%SolutionFileName) which however results in a GadgetName.sln instead of Gadgetname... so it would create a GadgetName.sln.gadget folder...

3. We have a quoting problem here also:
/user:Administrator &quot;mklink /D \&quot;C:\Users\UserName\AppData\Local\Microsoft\Windows Sidebar\Gadgets\$(SolutionFileName).gadget\&quot; \&quot;$(SolutionDir)\&quot;&quot;

As you can see, we need to enquote the parameters to mklink as well. For this we use \&quot;. However, for some reasons I don&#039;t understand, the command results in something like this:
... C:\Users\UserName\AppData\Local\Microsoft\Windows&quot; Sidebar\Gadgets ...

(with a quote character between Windows and Sidebar. Most probably because if the space character in between... i don&#039;t know how to get rid of this.

The goal would be that when executing this external command, a command prompt opens up asking for the Administrators password and then creating the proper symlink.

Are you able to get this working? Also, i don&#039;t know what can be done and cannot be done in the template itself. Maybe there is a way of (optionally) integrating this into it, so that when I create a new gadget based on this template, it lets me check something like &quot;Create Symlink&quot; and then while creating the project asking me for the admin password fr creating the symlink.

What do you think?</description>
		<content:encoded><![CDATA[<p>Hi Ryan,<br />
great hint. Thank you. However, I wanted to add this as an &#8220;external tool&#8221; to the Visual Studio menu. Since the mklink executable must be started as admin, I an into problems there.</p>
<p>I tried the runas.exe as command and the /user:Administrator mklink-stuff as parameter. However, there are a couple of problems.</p>
<p>1. Since this command will be run as admin, it&#8217;s not possible to redirect to %userprofile% since this will result in a symlink not in the users profile, but in the admins profile.</p>
<p>2. The only internal parameter for the gadgetname that made sense to me was (%SolutionFileName) which however results in a GadgetName.sln instead of Gadgetname&#8230; so it would create a GadgetName.sln.gadget folder&#8230;</p>
<p>3. We have a quoting problem here also:<br />
/user:Administrator &#8220;mklink /D \&#8221;C:\Users\UserName\AppData\Local\Microsoft\Windows Sidebar\Gadgets\$(SolutionFileName).gadget\&#8221; \&#8221;$(SolutionDir)\&#8221;"</p>
<p>As you can see, we need to enquote the parameters to mklink as well. For this we use \&#8221;. However, for some reasons I don&#8217;t understand, the command results in something like this:<br />
&#8230; C:\Users\UserName\AppData\Local\Microsoft\Windows&#8221; Sidebar\Gadgets &#8230;</p>
<p>(with a quote character between Windows and Sidebar. Most probably because if the space character in between&#8230; i don&#8217;t know how to get rid of this.</p>
<p>The goal would be that when executing this external command, a command prompt opens up asking for the Administrators password and then creating the proper symlink.</p>
<p>Are you able to get this working? Also, i don&#8217;t know what can be done and cannot be done in the template itself. Maybe there is a way of (optionally) integrating this into it, so that when I create a new gadget based on this template, it lets me check something like &#8220;Create Symlink&#8221; and then while creating the project asking me for the admin password fr creating the symlink.</p>
<p>What do you think?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: cromwellhaus.com @ 2012-05-19 08:51:47 -->
