Thursday, April 29, 2004

I'm working in VS.Net, and I'm creating a setup package. I ran into an obscure problem that I just had to pass along. When you create a setup package, an MSI file, it doesn't include the ability to create any procedure based code like the old, really lousy setup funtionality under the old Visual Studio.

When you register users, you sometimes want to create a file, in my case an XML file containing configuration information, in the folder the user selects for the installed application. The problem is, you can't use "Application.StartupPath" in an EXE that is called from the MSI file, because that file runs in a temp folder, and there is no point in creating a settings file there. Obviously, you want to save the file to the folder where the application is running, but how do you pass the user's selection to your registration EXE at runtime?

The setup package offers a screen named "Installation Folder", which is where the user selects the deployment folder. You can get at the string the user selects using the attribute "TARGETDIR", however there is a trick to it, and that's what I wanted to pass along.

In your "Register User" screen, the one that calls your registration EXE, you have an attribute called Arguments. To correctly pass the path to your EXE, you have to make sure it can accept command line arguments, and example of which you can find here.

To put it short, the text you should enter in the arguments field is (in bold for clarity) "[TARGETDIR] . Notice the quotation mark at the beginning and not the end of the string. Isn't that nasty? If you don't add this, you are going to end up with an arguments array that automatically splits at any space characters, (" "), so if you try to read the value your going to get "C:\Program" because of the space in "Program Folders". If you add the quotation mark at the end, like "[TARGETDIR]", you end up with a path that includes a trailing quotation mark, such as C:\Program Files\Company\Application" . Another option would be to join the elements in the array within your EXE, but this is just easier, and gives you the ability to pass arguments as well, although I haven't teased out the syntax for this.

Cheers!

Wednesday, April 28, 2004

OK, so you are using moving to Windows XP from Windows 2000. You are on a laptop, or a machine with a keyboard with all these ridiculous little custom buttons at the top that do stuff like pull up your system manufacturer's PDF file. You like to lock your machine when you step away from it, like any sane person does, knowing that they are all out to get you, but you miss hitting Ctrl-Alt-Delete to gain access to the quick "Lock Machine" function that Windows 2000 offers.

Why not use one of those stupid "extra" buttons on your keyboard to lock your machine with? It just so happens I have an EXE you can use, I pulled it off of an HP Pavilion, but you can use it on any XP machine. Just map one of those buttons to the EXE, and you're all set. Here is the file... QuikLock.zip

Monday, April 26, 2004

Diving yesterday at Haigh Quarry was cold! It's about 40' in there, chilly even with the drysuit, particularly after you've been down for more that a half hour. First dive of the year, and it was great to get underwater again. Visibility was the best I've ever seen it, you could see the bottom of "the hole" from the edge of the cliff, that's looking downward from about 55' to 80'. I saw some sort of tank-treaded quarrying gadget I hadn't seen before, but other than that it was all pretty familiar. My new OMS gauntlet style gloves didn't live up to my high expectations.

Sunday, April 18, 2004

I just finished reading "Prey" (2002) by Michael Chrichton, and I just had to say something about what a complete waste of time it is. It's about nanotechnology, so I was hopeful because of the wide range of possibilities he could explore. Instead, it was a poorly concieved rehash of his brilliant Andromea Strain, without a shred of the story-telling ability of the original film. It just didn't make sense, in terms of either technology or character motivation.

The worst part for me was that the story was so obviously pandering to the current computer rendering capabilities of hollywood. I could easily picture all the gee-whiz graphics that would be installed in the flick to cover the absurd, slow-pitched storyline. Were you impressed with the sandstorms in "The Mummy Returns" (2001)? Well, so was Crichton, because right after he saw it, he undoubtedly rushed home, took the technology buzz de jour, nanotech, layered both over the plot of his first film success, and popped out this looser during a long weekend.

Perhaps, after the phenominal success of the Jurrasic Park series, he's just gotten lazy. Too bad, because there was a time when the guy could really put a yarn together. I'm just thankful I didn't pay for the book.

Saturday, April 17, 2004

I'm building some threaded SOAP client GUI stuff in C#, and it's pretty fun. I'm interested to see how this model is going to work on the Symbol PPT 2846 unit I'm working with to build barcoding/SOAP connectivity. For the desktop portion of the system, things are working wonderfully.

I'd been doing some work with AppForge, but unfortunately, nobody seems to give a crap about those devices that I've held so dear, namely the Symbian OS (Nokia phones) and the good old Palm Pilot OS. Everybody in industry seems to be fixated on Microsoft based handhelds.

Scuba diving season is now upon us again. I'm hoping to go diving with a couple of buddies on the 25th. It will be great to get back in the water, and I don't care how damn cold it is. Bill Prince of Nordic Diver is starting to spam all the divers again. It's great to see him really cranking up the communications. I hope I spend lots of time on his boat this year. Hopefully one of the guys will bring a camera on the 25th so I can finally start posting some dive pictures.

Monday, April 12, 2004

My buddy Ted is in Japan, and his is such a swell blog, I thought I'd link to it. Look, he's crawling all over the set of "Lost in Translation"...

http://www.vetana.com/ted/tokyo/

Thursday, April 01, 2004

So, you type in an invalid URL and you find yourself redirected to the absurd website "www.bestsearchonearth.info". Surprise, you're a victim of New.net services. You've probably downloaded some junky shareware that has New.net bundled in it.

If you're on IE or Netscape, do yourself a favor and follow the Netscape removal instructions, which are...
"To deactivate the Search Helper Service, go to the Add/Remove Programs tool in your Control Panel and uninstall the New.net Domains application."