Multi Boot into Windows 8 from VHD on Windows 7


Windows 8 is upon us, well at the time of writing Windows Developer Preview is available as a pre beta download.

I have written before on multi booting into VHD images in Windows 7 and so I wanted to see whether it is possible to multiboot into a Windows 8 VHD image from my Windows 7 desktop.

The short answer is no it doesn’t work, or at least not in the way I approached it. I need to read around a bit more, but I suspect I may need to be using the Windows 8 Boot Loader. It all seems to go well, except when I reboot and select the new Windows 8 multi boot menu item – when I do this it flips back into my default Windows 7 and runs the repair dialog. No harm is done, but the underlying error appears to be a failure to locate a boot loader.

Anyway, so as not to have wasted my time, below is what I tried to do :-(…all the below stuff works great for Windows 7 VHDs by the way 😉

For the purposes of this article, let’s first create a working folder at the root of C drive, called VHD.

Read more of this post

Installing Umbraco 4.5.2 on Windows 7


I was asked by a local business person whether I could help with their website but whilst being a competent .NET developer I have never used ASP.NET commercially.

The brief was based on some initial design documents they had paid a web designer for, but also to ensure the site was stylesheet driven and allowed the owner’s to maintain the content themselves. Some areas of functionality they were looking for beyond the typical business website were things like; eCommerce basket, blog, appointment booking, facebook and twitter integration, membership system and within this access to previous and future appointments and private records.

So, glossing over the rest of my research I found Umbraco (4.5.2 at the time) which seems to offer a good framework for what I needed, was a CMS (Content Management System) and so would allow maintenance by the owner and whilst there wasn’t a full library of components many people had already done what I wanted to do, the forums seemed very helpful and it was full ASP.NET based and so any ASP.NET component could be seamlessly integrated.

One route was to use the Web Installer but this wants to install SQL 2008 Express R2, which I am quite happy with but I had SQL 2005 already installed on my development system and did not want to also have 2008 on it. So, as I couldn’t use the Web Installer I was faced with a manual installation.

Read more of this post

Windows 7 Dual Boot to VHD


I recently got my shiny new copy of Windows 7 Professional (x64) so decided to give it a whirl. Now I was already using Vista Business (x64) and I have been quite happy with it, so will I find Windows 7 that much different?

Well, rather than migrate (which is an option with Vista) I chose to wipe and start again and the install was trivial – then I started to look into some of the new features and the one that has grabbed my attention the most is the ability to dual boot from a VHD. Why bother when you have Virtual PC to host the images you may ask? Well two reasons for me really:

  1. Running a Virtual PC requires the overhead of running you main OS as the host, so booting directly into it would eliminate that waste of memory, processor use etc.
  2. Booting directly into a VHD treats it like a real installation and so uses real driver onto the real hardware – it doesn’t behave like a Virtual machine and so you can test how installations of drivers may really affect the OS and you get a true OS performance rather than some slower interpretation.

So, here is my step by step on how I did it – because believe me it took a few goes and some to get it to work!

Read more of this post

Display driver nvlddmkm stopped responding, but has successfully recovered.


Time to upgrade my PC…I have being using a single core AMD 3200 Athlon for quite a while now and so I set forth on a new PC build. After many many hours of research (a.k.a. surfing) I have ordered all the parts I need:
 
Monitor: 22" LG Flatron LCD Wide (L226WTQ)
Motherboard: ASUS P5K-E/Wifi AP (P35)
Processor: E8400 Core 2 Duo (wolfdale 45nm) 3GHz, 6MB L2 with stock cooler
Graphics: Zotac 8800 GTS 512 (G92)
Memory: 2GB (2 x 1GB) Crucial Ballistix DDR2 8500 (1066MHz)
HDD: Samsung Spinpoint T166 500GB 16MB Cache (x2 arranged in RAID0, ‘striped’)
DVD RW: NEC Optiarc SATA II
Case: Antec Solo
PSU: Antec TruePower TRIO 550W (triple rail)
plus a new MS Keyboard and Optical Mouse
 
I managed to grab a new wolfdale on the first day of release so eagerly awaited its arrival, which despite using eBuyer’s 5 day free delivery came very quickly in just a couple of days.
 
Putting it all together was easy and the Solo case was simple to access. Turned it on and blimey it all worked first time. Single beep, BIOS POSTed successfully – brilliant…but I needed to flash the BIOS as the motherboard didn’t fully understand the wolfdale E8400. This was also a breeze, using a USB pen direct from the BIOS.
 
This was all going too well…installed Vista Business Edition (I was already using this on my existing Athlon 3200 1GB system) and that was easy too. It only takes about 20 minutes to get Vista fully installed. It did however take me another 20 minutes to get all the ASUS motherboard drivers installed :-(. Then I took an image using the built in Vista Backup software (in Control Panel) which takes a complete backup of the system while it is running and that fitted comfortable on a single DVD. This image can be restored by booting to Vista install disk and full recovery is done within 20 minutes.
 
I put a few additional bits of software on, like the monitor drivers and the NVidia driver (192.25) and I was just about to move on to installing the main software when I though I’d just have a browse at the graphics card setting in the NVidia Control Panel. Then it happened…the spinning ‘NVidia Eye’ graphic on the first tab paused and I got a task tray pop-up advising me that ‘The display driver nvlddmkm stopped responding, but has successfully recovered.". then the ‘eye’ moved a bit more then another pause and the same message appeared again…this continued happening every couple of seconds then the BSoD (Blue Screen of Death).
 
Vista had bombed out big time.
 
I rebooted, tried again and no matter what drivers I tried it just kept happening. I read around on the forums and it seems lots and lots of people are getting the nvlddmkm error and there is no single resolution for it. Even MS have tried releasing updates, but none of these things fixed my problem. All the posts I read were about freezes in games, but I was getting it every couple of seconds in the NVidia Control Panel.
 
So what is the problem then? I ram MEMTEST for almost 24 hours – perfect results. I ran Prime95 – utilising both cores for a few hours – perfect results. I could test the Graphics card as this was the problem – then I stumbled on some posts regarding underpowered PSUs.

Then I even tried wiping the system and installing XP. Whilst this was more stable, Far Cry graphics didn’t work properly and F.E.A.R. would even start, saying something like ‘Cannot initialize engine’. This found a couple of posts suggesting the system was underpowered – but I had bought a brand new Antec truePower TRIO 550W (SLI certified) – so this should be fine shouldn’t it – if it is SLI certified and I am only running 1 card surely this would be OK. A little more digging and I discovered that the BIOS reported by 12V only delivering 11.6V and when Vista was running (am I glad I took that image now!) SpeedFan showed on 11.31V.

I contacted Antec and they said based on my Voltage reading the PSU was faulty – but by the time they responded I had already taken it into my own hands and returned it to Amazon. Their returns service was excellent. I printed off a postage paid label, popped it in a box, completed DHLs online pickup request and DHL collected it from  my workplace the next day.

I have decided that a 3 rail PSU may or may not be an issue, but I am taking no changes this time, so I have prder a Corsair TX 750W single rail PSU, which shuld arrive this week…please oh please let it fix my Vista woes. I so want to get the PC working properly and I really wantr to be able to play some games in Vista to test out the new grapics card (8800 GTS 512)…plan to play F.E.A.R. then challenge it with Crysis.

All this has comsumed two weekends of my time (grrrrrr), but is that light I see at the end of the tunnel?

I shall update this BLOG once I have received the new PSU…pray with me…Oh Lord make my Vista work?!

 
 
Well – as promised, I am updating this Blog entry…the new Corsair PSU did arrive but it did not address the problem – however I returned the PSU as it was too noisey and swapped it for another (this is my thrid now!) – a Seasonic S12 Energy plus. I am very pleased with this PSU and it is lovely and quiet – but it also did not address the problem.
 
So – I think I can be confident it isn’t the PSU, but it still loks like a lack of power to me. Next, I tried returning the Graphics Card (Zotac 8800 GTS 512) and ordered a new replace – this time opting for a cheaper 8800 GT (Play Value 8800 GT 512, which turned out to be a Palet 8800 GT 512). I am very pleased with the Palet as the fan is very quiet during normal useage and only ramps up during gameplay and I like the little utility that came with it called VDOTool as apart from allowing me to manually control the fan spped also allows me to change the MHz setting on the 3 main Graphics Card chips/memory.
 
In-between these two graphics cards, I borrow a friends ‘retired’ 6800 GT and with that I had no issues with the driver so maybe it was the card all along – but then the 800 isn’t so power hungry.
 
8800 GT arrived – so popped it in and tried the NVidia control panel and so far so good, so ran 3DMark06 – which black screened on me and returned to the desktop with the same old driver problem…ahhhhhhhhhhhhh
 
Finally I started fiddling with various setting in the BIOS and to my surprise found that increasing the NorthBridge voltage fixed the problem – I can now run 3DMark all the way through without error (11333 btw).
 
So, on my ASUS P5K-E motherboard I am now using all the default settings but with the components I don’t nee turned off (such as Floppy, Wireless, JMicron, Firewire etc) and changing only 2 settings:
 
1) Change DRAM Frequency from Auto to 1066 (as otherwise it tries to use default 800 it seems)
2) Change NB Frequency from Auto to 1.4V (I am assuming it was running at 1.25V as that was the only explicit value available to select below 1.4V).
 
I’d love to hear from anyone who has had this problem and found that upping the NB Frequency has fixed for them too?
 

.NET Resources, Settings and user.config Upgrade


I mainly write .NET 2.0 winform/desktop applications and have been using the Visual Studio Resources and Settings "strongly typed" mechanism. I have found this feature, that effectively comes free with Visual Studio, to be fantastic.
 
The Resources mechanism allows me to very simply create Resources of various types and know that they do indeed exist at compile time, unlike .NET 1.0/1.1, where I could easily create entries but I could easily use the key wrong into the ResourceManager and not realise this until I got an empty string or similar at runtime when I was expecting a value of some sort.
 
The Settings mechanism is also very similar and allows me to specify whether the setting is application or user oriented. Generally I find most of my entries are user oriented as I mainly use Settings to store application options, such as those entries you might find in the Options dialog box and the location and state of the application window when it was closed.
 
This was all going really well, but each time I released a new version all the Settings would revert back to their original default settings. I needed to find a way to upgrade an application in such as way that the user settings would be kept from a previous version of the software.
 
Changes to the defalt settings are stored in a file called user.config in a location below the users "Documents and Settings" (XP) or AppData (Vista) …\Company Name\Application Name\Version, e.g. [user]\MyCompany\MyApplication\1.0.0.0. The next release of the software reads/writes the user.config to a different version folder, e.g. [user]\MyCompany\MyApplication\1.0.1.0.
 
I did the usual Google and found a few similar articles talking about ApplicationBase.Upgrade(), although it took me about two hours to actually get it to work!! and as it turned out I did it right within the first 10 minutes but thought it wasn’t working. So to save you all the hassle here is what I did. Now it may be that my problems stemmed from the fact I was using Vista, but the same issue that caught me out may also be true of XP.
 
In the main() method of my winform application (before calling Application.Run) I wrote (C#) code like this:

if (MyDefaultNamespace.Properties.Settings.Default.Application_UpgradeRequired)

{

    try

    {
        MyDefaultNamespace.Properties.

Settings.Default.Upgrade();

        MyDefaultNamespace.Properties.

Settings.Default.Reload();

    }

    catch (Exception exception)

    {

        // Squash and continue without performing the upgrade

    }

    finally

    {

        /* Whether we succeed or fail flag upgrade as done.

         * We don’t want to try again next time even if we failed
         * as once the app has been run up once the user may have made
         * manual changes and we don’t want to oberwrite them.
         */

        MyDefaultNamespace.Properties.

Settings.Default.Application_UpgradeRequired = false;

    }
}

You can see from the above code that all the work is really done in the MyDefaultNamespace.Properties.Settings.Default.Upgrade() but what happens when you call this?
 
Essentially, it somehow knows what the last version was (don’t know exactly how it knows, but I guess it is based on examining the sibling version folders and deducing the previous version). If there is not previous version then nothing happens. If there is a previous version but no user.config is found (or something is wrong with it) then it raises an exception. But given it finds a previous version, any entries in the previous version that still exist in the new version are carried forward, any that do not are ignored. It seems you can use "NoSettingsVersionUpgradeAttribute" on the Settings wrapper class to prevent it being upgradeable, so you could split you Settings into two (or more) resource files, one that is Upgradable and one that is not.
 
You can use MyDefaultNamespace.Properties.Setting.Default.GetPreviousVersion("MySetting") to retrieve a value of a specific previous setting, which can be useful if either you only want to upgrade a few select items, or perhaps you changed the name of a setting in the latest release and want to bring forward th value from the previous version when it was called something else.
 
The issue I fell foul of was that despite there being a previous version, calling Upgrade() didn’t seem to do anything. On examination I found that my original version had gone into a folder something like this:
[user]\MyCompany\MyApplication.exe_Url_hwk1afgxmxf35sa0voi4agxgxtjhgmdn\1.0.0.0
but the new version had gone to:
[user]\MyCompany\MyApplication.exe_Url_qibjmlo5qfk3hyz4ev3ujyddthf0njla\1.0.1.0
I figured that because the version folders were not siblings that was why it didn’t work – which as it turns out was right, but why was the application creating a different application folder? I tried running the application in Visual Studio in both Debug and Release mode but got the same results, then as a final test I updated my installer with the new application and installed it, and then it worked! Yes, once installed the version folder 1.0.1.0 appeared below the original "MyApplication.exe_Url_hwk1afgxmxf35sa0voi4agxgxtjhgmdn" folder…grrrrr.
 
I think maybe the reason there being a different application folder was down to Vista security stuff, as XP doesn’t seem to create such weird application folder names, so maybe this is just a "Vista Developer Beware" issue.
 
As an aside, and to explain a little of the other code above. I create a new Setting in my application called "Application_UpgradeRequired" as a boolean and set it to true. I then used this to determine whether I had tried to upgrade before, as the first time I upgrade I set this to false to prevent it upgrading again. I just squash any errors that might have occured, but you could offer MessageBoxes or whatever to ask "Do you want to try again next time" or to ask whether the user wants to migrate previous setting in the first place.
 
So, if you find it is not working during your development/unit testing don’t worry it is Visual Studio and/or Vista messing with you…all will be well once installed and tested as a real application.

InstallShield 2008


Well, seems like I finally got myself a Blog – now all I have to do is get into the habit of putting stuff on it…so to kick if of I am going to do my first blog about InstallShield 2008.
 
I recently had the dubious pleasure of having to create a brand new set of installer for my companies product set and to do this I opted to use InstallSheild 2008 Premier.
 
Why Premier – well the main reason was that we use MSBuild and to get the installer to be auto built I needed to have InstallShield installed on the build machine, but this is not where I want to work when I create the scripts, so the choice was either buy two copies of InstallShield 2008 Professional or buy a copy of Premier as that comes with 10 licenses for a StandAlone command line installer…the latter was the cheaper alternative. Sure I get other features too, but if I could have bought the standalone licenses separately I would have.
 
As a first attempt I just tried to keep things simple and replicate the current installer organisation, which was done with VS2005 deployment projects. This meant that I firstly needed to create about 12 MergeModules (MSMs) and a couple of MSIs. This proved to be harder than you might imagine so in the end I simplified it and stuck to just 8 MSMs and 2 MSIs.
 
Problems that I encoutered for which I found resolution (via Macrovision InstallSheild maintenance support) were:
 

How do I get the CustomerInformation dialog All Users/Just Me radio buttons to appear?

It seems that this can only be achieved by using the DirectEditor and meddling directly with the installer tables. Essentially I needed to ‘drop’ two rows from the ControlCondition table, namely the two rows where Dialog=CustomerInformation and Control=RadioGroup.

This seems very odd to me as after-all, the dialog if available in the editor, yet I had to resort to manually editing the installer tables to get them to appear – but this is the way to do it so say Macrovision support.

Installing .NET 2.0 Framework was included, but when installed on a .NET-less machine it offered to install the Framework as an optional installation – whereas I wanted it to be mandatory. How do I make the inclusion of .NET 2.0 Framework mandatory?

It was easy to include the .NET 2.0 Framework via the Release Wizard but the dialog does not offer any configuration for the optionality of the installation. It turns out that selecting the Release node on the project tree display more information in the right pane that is made available in the Release Wizard and within that pane are a series of tabs, one of which is called .NET/J# and on there is a Yes/No option (default Yes bizarely) for ‘Display .NET option dialog. Set this to No and it now installs .NET 2.0 Framework seemlessly as part of the main installation.

This however has now brought with it a new problem. Whether .NET 2.0 Framework is already on the machine or not, this now requires a reboot of the machine following installation – when this is not the case, so now I need to find out why it thinks this.

Of the issues yet to be resolved:

  • PreCompile in MSIs uses the old .NET 1.0 NGen interface, even if I change the setting to ensure it is using the .NET 2.0 Framework’s NGen.exe it creates a custom action using the older style (i.e. does not use "install"/"uninstall" and therefore does not use the new Dependencies PreCompilation that .NET 2.0 NGen is capable of. I found a way round this for now but it required manual editing of the installer tables again – if you wanna know what I did then blog me and I’ll explain.
  • PreCompile does not seems to work at all for MSMs
  • I get lots of ICE30 errors when I build one of my MSIs with "compile to single setup.exe" turned on, but do not get these errors if I leave file uncompressed on the file system. I am awaiting a proper resolution to this, but in the meantime I was advised to turn off the ICE30 validation checks…not a good resolution but I am having to do this at this time.

Well, that’s enough for now…lets see if anyone reads this!