Wednesday, September 23, 2009

Rogue msiexec processes after installing VS2010

I need to give big props to Mebyon Kernow for his blog post here with the answer to this problem.

After installing VS2010 on my HP Mini, i noticed the cpu usage constantly sitting at 50+%. Upon looking at thr process manager, i saw that there were two rogue msiexec processes working hard and chewing up cpu cycles. As the HP Mini is a netbook, constant work on the cpu chews up battery life. A quick google* turned up the aforementioned blog post. Ten minutes after adding the appropriate folder, the msiexec instances finished their business and disappeared.

The answer in Mebyon's post was quite simple, and finding it meant i didn't have to think too hard for myself.

* I actually used Bing, but saying "a quick bing" doesn't have the same zhoosh as saying "a quick google".




Keywords: VS2010, rogue process, msiexec

Monday, August 3, 2009

SourceSafe history report - from the command line

Sometimes it is really useful to be able to do a history report on your SourceSafe archive. For instance, what check-ins did the developer called X make between 1 June 2009 and 30 June 2009?

Surprisingly it can be tough to search out the exact info you need to make this work effectively. Having this sort of reporting is also really helpful when putting together release notes, especially if developers use the 'comment' feature when checking items in, and mention specific bug cases (you are using a bug tracking product, aren't you?).


Here is how you do it. Open up a command prompt. Then you need to set an environmental variable called SSDIR, this is so the following commands know what repository we will be working with. To do this type the path to the folder containing the srcsafe.ini file of the repository:

C:>set SSDIR=c:\Program Files\Sourcesafe\

Note the trailing slash, and note that the filename itself is not included. Then you need to navigate to the folder where sourcesafe is installed:

C:>cd C:\Program Files\Microsoft Visual SourceSafe

Then we use ss.exe to generate the history report. This particular command gives me all the files that were checked in between 0900 on the 1st July and 0900 on the 30th July.

C:\Program Files\Microsoft Visual SourceSafe>ss history "$/Projects/My Project" -Oc:\history.txt -R -vd30/07/09;09:00a~01/07/09;09:00a

Breaking down the command line arguments:


















Command optionWhat it means
history ss.exe can be used for many things - we are telling it to do a history report.
"$/Projects/My Project"Path to the project i want reported on in the SourceSafe repository pointed to by SSDIR.
-Oc:\blah.txt-O means output, and then i specify the file i want the data outputed to.
-RThis is the recursive flag, IOW it means do all projects (folders) under the project specified as the start point.
-vdThis is the bit that limits the date. In my case the dates are in real english format (dd/mm/yy), not US format. The later date is listed first. The tilde (~) indicates that it is a range. The time is included with the date by separating it with a semi-colon, and the AM/PM is indicated by using either 'a' or 'p'.


This gives me a nice little text file called history.txt that i can scan through (or programmatically parse), it looks a little like this:

**********************
Label: "1.0.0.635"
User: Builder Date: 31/07/09 Time: 5:02p
Labeled
Label comment: Automated Build of Version 1.0.0.635

***** AssemblyInfo.cs *****
Version 29
User: Builder Date: 31/07/09 Time: 5:02p
Checked in $/Projects/My Project/Properties
Comment: Automated Build of Version 1.0.0.635

***** GridView.cs *****
Version 41
User: Shane Date: 16/07/09 Time: 4:27p
Checked in $/Projects/My Project/Controls/GridView
Comment: case 12345, changed how a column was rendered







Keywords: sourcesafe, history report, command line

Saturday, July 4, 2009

Activating Office 2007 on Windows 7 RC

I was trying to activate Office 2007 running on Windows 7 RC, but i kept getting an error message saying that there was an error communicating with the server, please try again in a few minutes. Selecting the option to activate by phone instead caused the activation dialog to disappear, it would not give me a product code or allow me to enter in an activation code.

The solution to this was simple - i needed to run the Office product (whichever one i was using to do the activation, Outlook in my case) as admin. I am in the admin group, but that is not sufficient (because even when you are logged in as administrator, processes you spawn still run at a reduced privilege level) - you need to run the process as administrator. There is an extra step involved when trying to do this with an Office product, as the installed shortcuts don't give you the Run as administrator option when you right click on them.


  • determine where the Office product is installed to*, i.e. it will usually be C:\Program Files (x86)\Microsoft Office\Office12
  • find the exe of one of the products, so you want to find WINWORD.EXE, EXCEL.EXE, OUTLOOK.EXE or MSACCESS.EXE, right click on the file, select Run as administrator
  • click Yes on the UAC prompt, or select the Administrator user and enter the admin password if you get that prompt
  • if you are running Word/Excel/Access, click on the launch orb in the top left corner, select Word Options/Excel Options/Access Options, in the Options popup dialog select Resources, then select activate Microsoft Office
  • if you are running Outlook from the step above, select Help->Activate Product
  • in the activation dialog, select the activate via internet option, click Next
  • Office should now activate. If it doesn't then you may have a firewall, proxy, or general connection problem.


*note that because the Office products have a special sort of shortcut installed, you cannot just right click on the short cut and go Properties->General to find the path to the executable, as the path shown in that tab will be the path to the shortcut file itself, not the product executable



Keywords: Office 2007 activation, activation error, Windows 7

Saturday, April 11, 2009

Goodbye RSS Bandit

I've been using RSS Bandit as my RSS feed aggregator and reader for a couple of years now, but today was the day i finally got annoyed enough to ditch it and switch to a new feed aggregator. I chose FeedBurner.

What annoyed me the most about Bandit?
- it kept losing blog posts. Whenever the app started, the latest blog posts were from 10th Dec 2008 (i'm not sure what happened on that date or what is special about it). If i right clicked on the feed and selected Update, the missing posts from the last 4 months would appear again, along with any new posts. This only affected some feeds, there was no pattern to which ones (the feeds affected had anywhere from 10 to 1000+ posts in them), but it was the same feeds each time. This smells like a data store issue to me.

- the delete functionality was incredibly slow. If the deletes folder had maybe a couple of hundred posts in it, and i deleted one post from another feed, then the speed was ok. But if i select ten posts and delete them then it takes ages. And it gets worse the more posts you have sitting in the deletes folder. Taking 30sec to delete 10 posts is IMHO suboptimal.

- it wouldn't shut down correctly. If i started it up and then closed it down in the next hour or so, then it terminated properly. But if i left it running overnight and then shut it down the next morning, the main process would continue to run. Sometimes an app will do this when it is doing a bit of shutdown processing, like maybe tidying up its data store and rebuilding indexes, so i gave Bandit the benefit of the doubt at the start and just let that process run. In fact at one stage i let it go several days, and the process just kept on running in the background. This means it is buggy, and the trouble is that in cases like this if you terminate the process forceably, you risk corruption of its data store if it was in the middle of doing something when you terminated. This might actually be what caused problem #1 above.

-it was also an enormous memory hog. When running Bandit under XP or Vista i would get regular out of memory errors (a termination because of this could also cause problem #1). I should mention that i've got 4GB RAM, and i was running a 64bit version of Vista. I'm now running a 64 bit version of Windows7, and the memory consumption is a lot more stable. While some might blame the OS for the memory management problems, i blame Bandit, as it must have been doing something in a way that triggered the memory issue (when i shut down Bandit the memory got freed up again). They were probably loading the entire database into memory, which would not be particularly efficient on most desktop machines.

Now, i am a software engineer, so i could have just grabbed the source and debugged and fixed the problem instead of whining about it, but i really can't be bothered for a number of reasons. First, i am too busy already. And i hate debugging other people's shit, it can be incredibly tedious. Once i found the problem, it might be a quick fix, or it could be a major rewrite depending on how the app is written. And in any case, there is no guarantee that they would accept my fix, as is their right. It is just simpler to find and install a new aggregator.

So i installed FeedDemon, and in my first 5mins with it i had already started to like it more than RSS Bandit. My only complaint is that when i went to import my RSS Bandit feeds/posts, it threw an error saying i needed to reinstall Bandit, and didn't give me any more details than that. Once again it was probably an issue with Bandit, not FeedDemon. But apart from that little glitch i am happy - FeedDemon is massively faster, it deletes fast, uses considerably less memory, and it shuts down when i tell it to shut down :)

To anyone considering installing RSS Bandit: don't, give it another evolution or two before you try it. Bandit is not very scalable, and doesn't handle feeds with large numbers of posts very well (i have around 130 feeds containing approx 23100 posts). The data store (database) is slow and possibly inefficient. Some improvements need to be made; i need to be able to crunch the database and rebuild indexes, and i need to be able to specify where it should cache its feed data without having to alter the config file directly. Filtering functionality would also be super, so i could automatically delete unwanted posts on high volume feeds.

I might revisit Bandit it in a year and see what progress has been made. Until then, c'est la vie.




Keywords: rss bandit, losing posts, feeddemon, rss

Thursday, February 5, 2009

I have been developing a Silverlight application, and i deployed it to a demo server. When i went to test it, the demo gods immediately kicked into gear and i received a script error message instead of seeing my control:

Error: Sys.InvalidOperationException: InitializeError error #2104 in control '[insert my control id here]': Could not download the Silverlight application. Check web server settings

So of course i googled the error message. It turns out this one is very easy to solve, but there is a bit of random rubbish and partial answers floating around out there. It turns out that IIS would not serve the control to the browser because i had not set up the correct MIME types in IIS, so IIS had no idea what the browser was requesting.

The best solution i found was this blog post: http://web.iotap.com/Blogs/tabid/277/EntryId/65/Configuring-Silverlight-2-0-Application-in-IIS.aspx

You need to ensure that the website hosting the Silverlight control has the following MIME types registered:


ExtensionMIME type
.applicationapplication/x-ms-application
.deployapplication/octet-stream
.manifestapplication/manifest
.xamlapplication/xaml+xml
.xapapplication/x-silverlight-app
.xbapapplication/x-ms-xbap
.xpsapplication/vnd.ms-xpsdocument






Realistically you probably only need the xaml and xap entries, but i entered them all and the demo gods smiled once again. Once you have done that, Ctrl-F5 your web page (or just F5 for some other browsers), and you should see your Silverlight control appear.

As per that blog article, i also enabled the content expiration, but i'm not sure of the relevance of that in this particular case (maybe it stops the Silverlight control from being cached?).




keywords: silverlight 2, deploy, error 2104, silverlight mime types