Friday, January 13, 2012

Installing Microsoft SharePoint Foundation 2010 on Windows 7

Since I am also working on Microsoft SharePoint Server and I am enjoying writing custom code for SharePoint, I always wanted to have some version of Microsoft SharePoint Server running in my physical computer. I have both Microsoft SharePoint Server 2010 and Microsoft SharePoint Foundation 2010 installed on two different virtual machines which has Microsoft Windows Server 2008 r2 running. So when I want to write some code on SharePoint, I had to switch on a virtual machine. Since my Dell has only 4GB of RAM, it takes a lot of time to switch on a virtual machine and I am lacking patience.

So I thought of installing Microsoft SharePoint Foundation 2010 on my Windows 7 Ultimate which has Microsoft SQL Server 2008 R2 already installed. First I thought it will be a easy thing, but trust me it's not sweet as it seems. So I am going to write down some few things which I am sure you will find helpful.

First thing is we need to do some changes to SharePointFoundation.exe before running it. Because when you download and run the SharePointFoundation.exe, you will see this setup error message.

Setup Error
To avoid this error, we need to modify the SharePointFoundation.exe. Let's say I have copied my initial SharePointFoundation.exe file to"C:\MySharePointFiles". We can do this by extracting the exe and changing the installation configuration file which will be in "c:\MySharePointFiles\files\Setup\config.xml".

To extract the exe, in your command prompt type,
c:\SharePointFiles\SharePointFoundation.exe /extract:c:\MySharePointFiles
Add this line inside the <configuration> tag in config.xml.
<Setting Id="AllowWindowsClientInstall" Value="True"/>
Now you will not face any setup error. Next thing to notice is when you run PrerequisiteInstaller.exe, it will say this message which is "This tool does not support the current operating system.". So we will have to install the prerequisites manually if you don't already have them.

After installing prerequisites and installing SharePoint Foundation, I started configuration wizard. I have selected "Server Farm" and selected "Complete" as my Server Type. Then after filling out next screens and when I started configuration, I got an error saying I am trying to start configuration with an local user account. It's a pretty clean error message, because I am trying to make an installation on my Windows 7 which has no Active Directory.

But there is a workaround for this problem. That is with the help of SharePoint 2010 Management Shell which was installed during SharePoint Foundation installation. Open SharePoint 2010 Management Shell and run the New-SPConfigurationDatabase command with the appropriate parameters.
New-SPConfigurationDatabase -DatabaseName "SharePoint2010_Config" -DatabaseServer "Ravana" -AdministrationContentDatabaseName "SharePoint2010_Admin_Content" -Passphrase (ConvertTo-SecureString "P@ssw0rd" -AsPlaintext -Force) -FarmCredentials (Get-Credential)
This command will prompt you a Window PowerShell Credential Request to enter your username and password. Make sure to enter the username as "computername\username". Then  I got this error,
New-SPConfigurationDatabase : Could not load file or assembly 'Microsoft.Identi
tyModel, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The system cannot find the file specified.
At line:1 char:28
+ New-SPConfigurationDatabase <<<<  -DatabaseName "SharePoint2010_Config" -Data
baseServer "Ravana" -AdministrationContentDatabaseName "SharePoint2010_Admin_Co
ntent" -Passphrase (ConvertTo-SecureString "P@ssw0rd" -AsPlaintext -Force) -Far
mCredentials (Get-Credential)
    + CategoryInfo          : InvalidData: (Microsoft.Share...urationDatabase:
   SPCmdletNewSPConfigurationDatabase) [New-SPConfigurationDatabase], FileNot
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSPCon
It says it can't load the assembly "Microsoft.IdentityModel". I examined my assembly directory which is "C:\Windows\assembly". Microsoft.IdentityModel assembly was already there. Then what I did was pretty simple. I removed the Windows Identity Foundation I already had and installed the appropriate file I got downloaded from following link and restarted the machine.
     Download Windows Identity Foundation

Now again I ran the above SharePoint 2010 Management Shell command, and now the command got completed successfully. Then I started the configuration wizard again and this time it went smoothly and completed.

After successful configuration, I thought of creating a new web application from my SharePoint 2010 Central Administration. When I went to Manage Web Applications page and for my surprise "New" in the ribbon was disabled. I ran my browser as administrator and it was still disabled. To fix this what I did was "changing user account control settings to never". You can do that by going through,
control panel->user accounts->change user account control settings->never 
And now everything was perfectly working. Hope you found this post helpful. Appreciate your feedback.

Happy Coding.



  1. How I hate setting up virtual machines for this same purpose!

    1. of course mate, I just hate virtual machines.