Welcome

You have reached the blog of Keith Elder. Thank you for visiting! Feel free to click the twitter icon to the right and follow me on twitter.

Deep Fried Bytes #30: New Ideas for the Web with Thomas Krotkiewski

Posted by Keith Elder | Posted in Podcast | Posted on 21-04-2009


http://deepfriedbytes.com/podcast/episode-30-new-ideas-for-the-web-with-thomas-krotkiewski/

 

In this episode we went all the way across the big pond to Poland to talk with Thomas Krotkiewski about some interesting work he’s doing pushing the boundary of the web.  For example, imagine a web site without a single navigation menu on the site.  How would you build that and what technologies would you use?  We also discuss how mobile phones are being used in Europe, viral marketing videos, and much more.  

How To Run a ClickOnce Application on Startup

Posted by Keith Elder | Posted in .Net, Smart Clients | Posted on 18-04-2009

When .Net 2.0 launched several years ago, WinForm developers got a brand new technology baked into the framework that allowed WinForm applications to be deployed similar to a Web application.  The technology was called ClickOnce.  ClickOnce has seen a few enhancements since it’s initial release such as the ability to add a desktop icon when an application is installed along with better support for ISVs.  One feature still missing from ClickOnce is to make an application start automatically after login.  Let’s solve this problem.

The Problem

When a ClickOnce application is installed the user doesn’t know the directory location it is installed in on their computer.  Honestly they shouldn’t care.  Not only does the user not know, but the developer doesn’t know either!  ClickOnce applications are installed in random directories on each computer in a hidden folder within the user account called the “AppData” folder.  For example, here is a screen shot where the ClickOnce version of Witty Twitter that I publish on this site is installed on my newly built machine.

image

As you can see it is in a random place and this is the problem because a ClickOnce application doesn’t have a fixed path like c:\program files\somewhere\myapp.exe.  Why?  Well, because the ClickOnce team at Microsoft didn’t build in the ability for Developers to specify a location as to where the application is installed, nor can the user select one.  The purpose of a ClickOnce app is the end-user clicks a URL that ends in .application and the application installs.  Simple, quick, easy.  If the application path was set outside of the user’s account it would require escalated permissions.  A feature of ClickOnce is it allows the user to install an application without administrative permissions on the computer (great for internal apps at companies for example).  Since the ClickOnce apps are installed in the user’s local directory and randomized as to their whereabouts, we can’t place a shortcut URL in the startup folder that points to the executable.

Now some of you might be thinking that a Developer can programmatically figure out the location of the executable and place the shortcut in the Startup folder within the menu, thereby allowing the application to start.  That would be the wrong thing to do.  The reason is ClickOnce applications version themselves as they are installed.  If you took this approach, the next time the application was updated, a new version would be installed and the old version still remains.  Essentially there are two versions on the machine (this is a feature because it allows end-users to roll back to the previous version if they want to in case the latest version of the application is broke).  As you see, creating a shortcut programmatically and placing it in the startup folder on the machine won’t work because it is constantly changing locations.

The Solution

The solution to the problem is actually really simple.  So simple in fact it escapes most.

Remember that a ClickOnce application is launched from a URL ending in .application.  For example, the Witty Twitter application I publish has a URL like the following:

http://keithelder.net/software/witty/witty.application

The .application extension is something your computer knows how to process after the .Net framework gets installed. 

What most developers do is they open up the folder the location where the ClickOnce application installed the shortcut to view the shortcut in notepad.  Here’s an example  using Witty:

image

If we view the Witty shortcut in Notepad++ it looks like this:

image

The first thing you’ll notice is the extension of this shortcut is different, it ends with .appref-ms.  So what happens is developers copy this file to the startup folder, but then it doesn’t work in all cases.  It will work on some versions of Windows but not others.

Here’s the fix.  Right click on your desktop and in the menu create a new shortcut.

image

Next, enter the URL of your application.  Here’s a sample using Witty:

image

Click next and give it a name:

image

After saved, open the shortcut in notepad and remove everything but the first two lines.  You should have something like this left when you get done:

[InternetShortcut]
URL=http://keithelder.net/software/witty/witty.application

Now you have your shortcut.  Wait, that’s just a standard Internet Shortcut?  Right!  That’s all you need since the application is launched from a URL anyway.  You’ll notice after doing this the new shortcut is showing the default browser’s icon (not your application icon), this is perfectly ok.  Now that you have your file, simply drag and drop the shortcut into the Startup folder.  The next time the computer boots, the application will automatically launch. 

If you are a developer you are home free now because programmatically writing a file to the user’s Startup folder with this information is simple.  In your application you can place a menu option to start the application on startup or not. 

Their are two downsides using the method I can think of.  One, your application shows the default browser’s icon.  Secondly, when the computer launches the browser will open for a split second to launch the application but then it closes (at least that’s been our experience). 

Google Pushing Chrome to Internet Explorer Users

Posted by Keith Elder | Posted in Internet | Posted on 17-04-2009

Just a few minutes ago I went to Google to search for something.  I was using Internet Explorer at the moment because that’s all I had installed within the Virtual Machine I was working in.  When I went to the site, something new and awkward hit me as I started typing in my search.  Here’s what caught my attention.

image

I thought to myself, hmmm, this is kind of interesting.  Then I thought, hmmm, I wonder if Firefox users get the same thing.  Curious, I flipped over to Firefox on my machine and pulled up the page.  Here’s the result.

image

Wow!  Can you say target marketing?  Is this war?  Has Google opened a can of worms by doing this?  This is pretty brazen if you ask me.  Yep, Google has officially declared war on Internet Explorer it seems.  And you know what?  They’ll get away with it.  Thoughts?

Speaking at Tampa Bay, FL .Net User Group

Posted by Keith Elder | Posted in Speaking | Posted on 13-04-2009

Thursday, April 23rd, I’ll be speaking in Tampa Bay, FL at the local .Net User Group.  This time of the year the weather should be great and the fish should be biting.

While in Tampa I’ll be speaking on WCF, you know, that technology that makes the world go around?  Think about where we’d be without services today? Things that make the Internet fun like Twitter, Facebook, Mobile Apps and more would have a very hard time working.  Think about it, they are ALL built on services.  Some don’t look at services as a sexy piece of technology but I do because it is so important.  The next time you open your mobile phone up and search for the nearest gas station you can thank a service.

Services aren’t just just for public facing applications but for companies as well.  Without services, we’d all be resorting to storing all of our data on our PC’s instead of being able to store things in the cloud. Not to mention we’d have that interoperability problem between platforms.  So yes, services are sexy!

In Tampa I’ll be breaking down WCF and showing a melting pot of things that’ll hopefully keep everyone on the edge of their seats.  I’ll also have some Deep Fried Bytes swag to give away.  If you are in the area, I hope to see you there. 

image image

(DFB wall clock and BBQ apron)

Ask The Elder: Recommendations for a Home Media Server Project

Posted by Keith Elder | Posted in Computer Hardware | Posted on 11-04-2009

One of my friends from college recently sent me a question about what I’d recommend for a home media server project.  He explained he had an old HP Pavilion 6835 PC (800MHz Celeron, 256MB, 30GB, 100watt PS) that he was thinking about turning into a media server.  He went on to say he didn’t want to turn this into a home theater pc (which is good because it would never hold up) and he was thinking about putting Linux on it to serve files.  He asked for hardware tweaks and then at which point would he be better off just building a new machine from scratch.  Here’s my recommendation.

The Bad News

Let’s start with the bad news first.  The first thing we need to get out of the way is upgrading this machine.  It is a “Pavilion”.  That means “end-user” in regards to HP’s line of computer offerings.  It is a consumer based PC.  As a matter of fact this PC shipped with things like Microsoft Works, Real Audio Player, America Online, CompuServe, EarthLink etc.  It has an integrated graphics chip (Intel 810 using shared memory) and while cheap when originally purchased, it just isn’t something that is upgradeable. 

Then there is the hard drive problem.  Obviously more and bigger hard drives will be needed.  The 1TB drives that we see today for $100 will not work on the machine (bios limitations and connectors have changed).  Basically this machine would need to be gutted to make it even workable.  About the only thing this machine would be good for I can think of is setting up a Linux firewall.

The Good News

imageWhen I have an itch I want to scratch I like to find solutions that fit the problem at hand and fit it well.  While “piece-milling” things together sometimes works,  I have found it turns into more headache and ultimately wastes time and money.  This is a perfect case to recommend something that has already solved this problem. 

The solution provides easy setup, configuration, and offers more features as a specialized device than trying to build a full blown computer to just store files.  Enterprises have been using them for years and now we are starting to see them creep into the consumer space as home networks get more complicated.   The best part of all is my friend can get what he wants all for about $234.00, still run Linux (without even knowing it), and store all of his media files.  Answer: Media Network Attached Storage

Since he’s a Mac user primarily, iTunes integration is of course going to be key for him.  The HP Media Vault 500GB Network Attached Storage device solves the specific problem of centrally locating files within the home while also allowing iTunes and other media devices to see the files. 

image

The unit also allows for additional drives, works with the Xbox 360, and works from Windows, Mac and Linux based computers.  It also supports automatic backups, media streaming across the home network and many more features.  It is a great way to centralize and backup files and even supports advanced features such as RAID 1 for mirroring data.  All in all a fantastic device.

Of course there are some other options as well.  Netgear has a device as well that is a little more pricey but has some other features.  Check out both options if you are in the market.

But I’m Not a Mac User, What Would You Recommend?

Another option for those that have Windows computers and networks is to purchase a Windows Home Server.  We have one of these and couldn’t live without it.  It provides a central location for files similar to the NAS (network attached storage) but does a lot more.  It backs up all computers on the network each night and provides an easy way to restore files.  And when I mean it backs up the computers, I mean everything, not just certain folders.  It allows you to access your computers from remote locations, share photos with family and much more.  Mine even backs up all my important files to the cloud for off site backups.  If you want more information about Home Server, check out the interview we did on Deep Fried Bytes last September.  If you are curious, a new Home Server will cost about $499, but it is well worth every penny.