Wednesday, November 25, 2009

Dealing with the "Cannot open include file: 'windows.h': No such file or directory" error and the "A problem has been encountered while loading the setup components. Canceling setup." error

I got the error - "Cannot open include file: 'windows.h': No such file or directory" after I had installed Visual Studio 2008 Team Suite and I tried to compile something that compiles on another persons computer. 
When I looked at "C:\Program Files\Microsoft SDKs\Windows" there was a directory v5.0.  I thought maybe that is because I have VS 2005 and not VS 2008.  So I googled the error and I read that someone named Chris Hubbard from Microsoft suggested maybe I should run Setup again.  I read this here http://channel9.msdn.com/forums/Coffeehouse/415758-Visual-Studio-2008-Professional-no-windowsh-/ .  So I put in the install cd in again and tried the setup.exe at which point I got the following error:"A problem has been encountered while loading the setup components.  Canceling setup."  I then restarted the computer and got the same error again. 

Below is the data from the log file
===========
In the file dd_install_Vs_vstscore_90.txt in my Documents and Settings\Usernme\Local Settings\Temp directory

[11/25/09,11:22:04] Setup.exe: MoveLoadProgress()
[11/25/09,11:22:04] Setup.exe: MoveLoadProgress()
[11/25/09,11:22:04] Setup.exe: AddGlobalCustomProperty
[11/25/09,11:22:04] setup.exe: ***ERRORLOG EVENT*** : ISetupModule::SetManager() failed in ISetupManager::LoadSetupObjectGuid() : vs_setup.dll
[11/25/09,11:22:05] Setup.exe: AddGlobalCustomProperty
[11/25/09,11:22:05] setup.exe: ***ERRORLOG EVENT*** : CSetupManager::LoadSetupObjectname() - Failed in call to LoadSetupObjectGuid() for strName:  in file: vs_setup.dll
[11/25/09,11:22:05] Setup.exe: AddGlobalCustomProperty
[11/25/09,11:22:05] setup.exe: ***ERRORLOG EVENT*** : LoadComponent(), LoadSetupObjectName failure: vs_setup.dll
[11/25/09,11:22:05] Setup.exe: AddGlobalCustomProperty
[11/25/09,11:22:05] setup.exe: ***ERRORLOG EVENT*** : LoadComponent failed in ISetupManager::LoadComponentsFromDBObject(): vs_setup.dll
[11/25/09,11:22:05] Setup.exe: AddGlobalCustomProperty
[11/25/09,11:22:05] setup.exe: ***ERRORLOG EVENT*** : CSetupManager::LoadDatabaseValues() - Failed in call to LoadComponentsFroMDBObjects()
[11/25/09,11:22:05] Setup.exe: AddGlobalCustomProperty
[11/25/09,11:22:05] setup.exe: ***ERRORLOG EVENT*** : CSetupManager::RunIntro() - Failed to Load Database Values
[11/25/09,11:22:05] vs70uimgr: Entering DisplayMessage() method.
[11/25/09,11:22:05] vs70uimgr: DisplayMessage_START:A problem has been encountered while loading the setup components. Canceling setup.
[11/25/09,11:22:05] Setup.exe: CCoreEngine-Proc() - Finished Main Message Loop
[11/25/09,11:26:45] vs70uimgr: DisplayMessage_END:A problem has been encountered while loading the setup components. Canceling setup.
[11/25/09,11:26:45] Setup.exe: AddGlobalCustomProperty
[11/25/09,11:26:45] setup.exe: ***ERRORLOG EVENT*** : CSetupManager::RunLoadSetup() - Failed to Run the Intro
[11/25/09,11:26:45] Setup.exe: UnloadSuiteComponents()
[11/25/09,11:26:45] UTILS::RunNGENAction: Started
[11/25/09,11:26:45] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe queue continue"
[11/25/09,11:26:45] UTILS::RunNGENAction: ngen.exe returned 0
[11/25/09,11:26:45] Setup.exe: GetGlobalCustomProperty - Property: {383F0141-C682-4665-A69B-756E719C968D} - PropertyName: Process Return Code - Value:
[11/25/09,11:26:45] Setup.exe: SETUP EXIT CODE - 0
==============

I then found this link, which says to repair from Add/Remove programs and not from the disk
http://blogs.msdn.com/heaths/archive/2008/08/20/do-not-repair-vs-2008-sp1-from-installation-media.aspx

I then went to add/remove programs and tried to run Change/Remove on my "Microsoft Visual Studioe Team System 2008 Team Suite - ENU"  but this resulted in the same error.  So at this point I was stuck.  So  I went back to google and found this link - http://stackoverflow.com/questions/114332/visual-studio-setup-problem-a-problem-has-been-encountered-while-loading-the-s (yes the link ends with an 's').  The user had the same problem and was just trying to uninstall the program.  He found a neat tool to completely remove the application, which I didn't need to use but I might need down the road.  I didn't want to completely remove the application I just wanted to "add the sdk's to the application."  Further down the page, people suggest the problem is with some of the Hotfixes that came with VS 2008.

- Removed Hotfix, but had the same error (however this time it did go further in the install process)
- Removed Update for Microsoft Visual Studio Team system 2008 Team Suite - ENU (KB972221)
    - This time I ran Change/Remove from Add/Remove programs and "it worked" in that it went to the Update page. When I had originally installed the software I had selected everything, so there was nothing new to select.  So the "Update" button was grayed out.  What I did was to uncheck something (anything) and then check it back on. 
    - If you read Chris Hubbard's notes (from the above link), it says that "Normal repair" will only repair the installed components.  So technically I did not run Setup again, I just did the "Normal Repair". 
- After setup ran for a while when it tried to install "Microsoft SQL publishing wizard", I got the following error - "Microsoft Visual Studio Team System 2008 Team Suite - ENU has encountered a problem during setup.  Setup did not complete correctly."
It appears that a number of components did install.  I clicked "Finish"
This is what was in my setup log file:

***EndOfSession***[11/25/09,10:48:18] setup.exe: [2] ISetupModule::SetManager() failed in ISetupManager::LoadSetupObjectGuid() : vs_setup.dll
[11/25/09,10:48:18] setup.exe: [2] CSetupManager::LoadSetupObjectname() - Failed in call to LoadSetupObjectGuid() for strName:  in file: vs_setup.dll
[11/25/09,10:48:18] setup.exe: [0] LoadComponent(), LoadSetupObjectName failure: vs_setup.dll
[11/25/09,10:48:18] setup.exe: [0] LoadComponent failed in ISetupManager::LoadComponentsFromDBObject(): vs_setup.dll
[11/25/09,10:48:18] setup.exe: [2] CSetupManager::LoadDatabaseValues() - Failed in call to LoadComponentsFroMDBObjects()
[11/25/09,10:48:18] setup.exe: [2] CSetupManager::RunIntro() - Failed to Load Database Values
[11/25/09,10:49:41] setup.exe: [2] CSetupManager::RunLoadSetup() - Failed to Run the Intro
[11/25/09,10:51:08] setup.exe: [2] ISetupModule::SetManager() failed in ISetupManager::LoadSetupObjectGuid() : vs_setup.dll
[11/25/09,10:51:08] setup.exe: [2] CSetupManager::LoadSetupObjectname() - Failed in call to LoadSetupObjectGuid() for strName:  in file: vs_setup.dll
[11/25/09,10:51:08] setup.exe: [0] LoadComponent(), LoadSetupObjectName failure: vs_setup.dll
[11/25/09,10:51:09] setup.exe: [0] LoadComponent failed in ISetupManager::LoadComponentsFromDBObject(): vs_setup.dll
[11/25/09,10:51:09] setup.exe: [2] CSetupManager::LoadDatabaseValues() - Failed in call to LoadComponentsFroMDBObjects()
[11/25/09,10:51:09] setup.exe: [2] CSetupManager::RunIntro() - Failed to Load Database Values
[11/25/09,10:51:18] setup.exe: [2] CSetupManager::RunLoadSetup() - Failed to Run the Intro
[11/25/09,11:06:15] setup.exe: [2] ISetupModule::SetManager() failed in ISetupManager::LoadSetupObjectGuid() : vs_setup.dll
[11/25/09,11:06:15] setup.exe: [2] CSetupManager::LoadSetupObjectname() - Failed in call to LoadSetupObjectGuid() for strName:  in file: vs_setup.dll
[11/25/09,11:06:15] setup.exe: [0] LoadComponent(), LoadSetupObjectName failure: vs_setup.dll
[11/25/09,11:06:15] setup.exe: [0] LoadComponent failed in ISetupManager::LoadComponentsFromDBObject(): vs_setup.dll
[11/25/09,11:06:15] setup.exe: [2] CSetupManager::LoadDatabaseValues() - Failed in call to LoadComponentsFroMDBObjects()
[11/25/09,11:06:15] setup.exe: [2] CSetupManager::RunIntro() - Failed to Load Database Values
[11/25/09,11:07:13] setup.exe: [2] CSetupManager::RunLoadSetup() - Failed to Run the Intro
[11/25/09,11:22:04] setup.exe: [2] ISetupModule::SetManager() failed in ISetupManager::LoadSetupObjectGuid() : vs_setup.dll
[11/25/09,11:22:05] setup.exe: [2] CSetupManager::LoadSetupObjectname() - Failed in call to LoadSetupObjectGuid() for strName:  in file: vs_setup.dll
[11/25/09,11:22:05] setup.exe: [0] LoadComponent(), LoadSetupObjectName failure: vs_setup.dll
[11/25/09,11:22:05] setup.exe: [0] LoadComponent failed in ISetupManager::LoadComponentsFromDBObject(): vs_setup.dll
[11/25/09,11:22:05] setup.exe: [2] CSetupManager::LoadDatabaseValues() - Failed in call to LoadComponentsFroMDBObjects()
[11/25/09,11:22:05] setup.exe: [2] CSetupManager::RunIntro() - Failed to Load Database Values
[11/25/09,11:26:45] setup.exe: [2] CSetupManager::RunLoadSetup() - Failed to Run the Intro
[11/25/09,11:37:49] setup.exe: [2] ISetupModule::SetManager() failed in ISetupManager::LoadSetupObjectGuid() : vs_setup.dll
[11/25/09,11:37:49] setup.exe: [2] CSetupManager::LoadSetupObjectname() - Failed in call to LoadSetupObjectGuid() for strName:  in file: vs_setup.dll
[11/25/09,11:37:49] setup.exe: [0] LoadComponent(), LoadSetupObjectName failure: vs_setup.dll
[11/25/09,11:37:49] setup.exe: [0] LoadComponent failed in ISetupManager::LoadComponentsFromDBObject(): vs_setup.dll
[11/25/09,11:37:49] setup.exe: [2] CSetupManager::LoadDatabaseValues() - Failed in call to LoadComponentsFroMDBObjects()
[11/25/09,11:37:49] setup.exe: [2] CSetupManager::RunIntro() - Failed to Load Database Values
[11/25/09,11:37:53] setup.exe: [2] CSetupManager::RunLoadSetup() - Failed to Run the Intro
[11/25/09,11:53:22] Microsoft SQL Publishing Wizard: [2] Error: Installation failed for component Microsoft SQL Publishing Wizard. MSI returned error code 1603
***EndOfSession***

- The interesting is that after this setup when I got to "C:\Program Files\Microsoft SDKs\Windows" there is now a directory called "v6.0a".  So something did happen, and I am now able to compile that project.  There are a couple of oustanding items that I need to now deal with:
1.  Add the hotfixes back in
2.  What about that item that didn't properly install?


Friday, November 13, 2009

Locate items in the SolutionExplorer

This blog and comments pretty much cover all the bases here.
http://dvanderboom.wordpress.com/2008/03/21/visual-studio-macro-track-item-in-solution-explorer-on-demand/

1.  You could just turn it on or off by going to Tools—>Options, expand Projects and Solutions, select General, and then uncheck the box next to Track Active Item in Solution Explorer.
2.  You could create a Macro and turn it on or off when you want it.  The site has the code for doing the macro
3.  You could add the option to the view menu you going to Tools->Customize, View, Track Activity in Solution Explorer, and then moving that to the View Menu
4.  The approach I selected.  You could bind the action to a keyboard shortcut by going to Tools->Options, Environment, Keyboard, finding View.TrackActivityInSolutionExplorer and clicking in the "Press shortcut Keys" box and then entering your shortcut.  I used Alt-T.  This way when you want it you can click Alt-T and then you can use Alt-T to turn it off.  What this method also does is pretty mimic the activity in step 1.




Thursday, November 12, 2009

How to get the AssemblyTitle


http://www.vb-helper.com/howto_net_get_program_version.html
Code in the above page works, except that if you have the code in a dll and you want to get the calling applications assemblytitle, you won't get it.  You'll get the assemblytitle of the dll.

I do know that if you use the System.Windows.Forms.Application.ProductName you will get the AssemblyProduct from the calling application.  But how do you get the AssemblyTitle from the calling application?


Tuesday, November 3, 2009

How to stop SMC service

 
http://www.symantec.com/connect/forums/smcexe-takes-99-cpu
 

upgrade to MP5 it will work

upgrade to MP5 it will work

Please see note below on how stop SMC service on a desktop if its going through the roof

• Open regedit
• HKEY_LOCAL_MACHINE\SOFTWARE\Symantec\SYMANTEC ENDPOINT PROTECTION\SMC\smc_exit_test 1 to 0

Then from the Symantec installed DIR etc c:\program files\symantec\symantec endpoint protection\

Then run.

• SMC –STOP

Then run an upgrade.

Then run.

• SMC –START

Then all done !!!

Enjoy.