Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Visual C++ Runtime is getting installed EVERY time
 

Visual C++ Runtime is getting installed EVERY time

I'm running VisualStudio 2005 SP2 and I have the "Visual C++ Runtime libraries x86" option checked in the prerequisites. Everytime I run my installer I'm told that the C++ libraries need to be installed. I searched this fourm and found an old post that says to change the VCRedistInstalled to 7299052b-02a4-4627-81f2-1818da5d550d (see http://social.msdn.microsoft.com/forums/en-US/winformssetup/thread/2eef8938-4fcc-41e8-b05f-832e997a647a/). I've done this yet I'm still getting this issue of running my installer and being told the VC++ runtime libraries need to be installed.

Arrrrg.

Any suggestions? I've found a number of posts all pointing out this same problem and the only solution I've seen is the one that's mentioned here, but it still happens no matter what I do.

Thanks,

Jeff

Jeff99999  Wednesday, August 12, 2009 6:02 PM

One of the rules about Windows Installer ProductCode guids is that they must be uppercase. See this doc:

http://msdn.microsoft.com/en-us/library/aa370860(VS.85).aspx

"Note that letters in product code GUIDs must be uppercase. "

However the VS 2005 redist products apparently aren't aware of this because they have redists with ProductCodes such as
{7299052b-02a4-4627-81f2-1818da5d550d}

It's possible that this is something to do with why the detection in the bootstrap doesn't work. The other thing is that the ProductCode is going to be unique to every version of the redist, VS 2005, 2008, and each SP.

Copy this into a .vbs script and run it. It will list every installed product on the system, so if you've inmstalled that redist it will tell you what the ProductCode guid is. It creates a file called prods.txt containing this info.

Option Explicit
Public installer, fullmsg, comp, prod, a, fso, pname, ploc, pid, psorce, pcache

Set fso = CreateObject("Scripting.FileSystemObject")
Set a = fso.CreateTextFile("prods.txt", True)

' Connect to Windows Installer object
Set installer = CreateObject("WindowsInstaller.Installer")
a.writeline ("Products")
on error resume next
For Each prod In installer.products
   pid = installer.productinfo (prod, "ProductID")
   pname = installer.productinfo (prod, "InstalledProductName")
   psorce=installer.productinfo(prod, "InstallSource")
   ploc = installer.productinfo (prod, "InstallLocation")  
 pcache = installer.productinfo(prod, "LocalPackage") 
   a.writeline (prod & " " & pname & " installed at " & ploc & " from " & psorce & " cached at " & pcache)
Next

Example output:
{3C11D2DA-6802-3F66-BE6B-B2C046AFE866} Visual C++ 2008 x64 Runtime - (v9.0.30729.4148) installed at from c:\f9c17cf9305fb52b43d5\ cached at c:\Windows\Installer\71175807.msi
{4D338DDA-35FC-4A11-9207-87FBC09661B8} Microsoft VC Redist 2008 (6001.18000.367) installed at from C:\Users\philw\AppData\Local\Temp\SDKSetup\vcredist\ cached at C:\Windows\Installer\830219.msi
{3BC18EDA-5B69-44E5-9E1D-F674C60FD585} Microsoft Windows SDK for Windows Server 2008 (6001.18000.367) installed at from C:\Users\philw\AppData\Local\Temp\SDKSetup\WinSDK\ cached at C:\Windows\Installer\830235.msi
{7299052b-02a4-4627-81f2-1818da5d550d} Microsoft Visual C++ 2005 Redistributable installed at from C:\Users\philw\AppData\Local\Temp\IXP000.TMP\ cached at C:\Windows\Installer\51f9a555.msi


Phil Wilson
  • Marked As Answer byJeff99999 Thursday, August 13, 2009 4:23 AM
  •  
PhilWilson  Wednesday, August 12, 2009 11:44 PM

One of the rules about Windows Installer ProductCode guids is that they must be uppercase. See this doc:

http://msdn.microsoft.com/en-us/library/aa370860(VS.85).aspx

"Note that letters in product code GUIDs must be uppercase. "

However the VS 2005 redist products apparently aren't aware of this because they have redists with ProductCodes such as
{7299052b-02a4-4627-81f2-1818da5d550d}

It's possible that this is something to do with why the detection in the bootstrap doesn't work. The other thing is that the ProductCode is going to be unique to every version of the redist, VS 2005, 2008, and each SP.

Copy this into a .vbs script and run it. It will list every installed product on the system, so if you've inmstalled that redist it will tell you what the ProductCode guid is. It creates a file called prods.txt containing this info.

Option Explicit
Public installer, fullmsg, comp, prod, a, fso, pname, ploc, pid, psorce, pcache

Set fso = CreateObject("Scripting.FileSystemObject")
Set a = fso.CreateTextFile("prods.txt", True)

' Connect to Windows Installer object
Set installer = CreateObject("WindowsInstaller.Installer")
a.writeline ("Products")
on error resume next
For Each prod In installer.products
   pid = installer.productinfo (prod, "ProductID")
   pname = installer.productinfo (prod, "InstalledProductName")
   psorce=installer.productinfo(prod, "InstallSource")
   ploc = installer.productinfo (prod, "InstallLocation")  
 pcache = installer.productinfo(prod, "LocalPackage") 
   a.writeline (prod & " " & pname & " installed at " & ploc & " from " & psorce & " cached at " & pcache)
Next

Example output:
{3C11D2DA-6802-3F66-BE6B-B2C046AFE866} Visual C++ 2008 x64 Runtime - (v9.0.30729.4148) installed at from c:\f9c17cf9305fb52b43d5\ cached at c:\Windows\Installer\71175807.msi
{4D338DDA-35FC-4A11-9207-87FBC09661B8} Microsoft VC Redist 2008 (6001.18000.367) installed at from C:\Users\philw\AppData\Local\Temp\SDKSetup\vcredist\ cached at C:\Windows\Installer\830219.msi
{3BC18EDA-5B69-44E5-9E1D-F674C60FD585} Microsoft Windows SDK for Windows Server 2008 (6001.18000.367) installed at from C:\Users\philw\AppData\Local\Temp\SDKSetup\WinSDK\ cached at C:\Windows\Installer\830235.msi
{7299052b-02a4-4627-81f2-1818da5d550d} Microsoft Visual C++ 2005 Redistributable installed at from C:\Users\philw\AppData\Local\Temp\IXP000.TMP\ cached at C:\Windows\Installer\51f9a555.msi


Phil Wilson
  • Marked As Answer byJeff99999 Thursday, August 13, 2009 4:23 AM
  •  
PhilWilson  Wednesday, August 12, 2009 11:44 PM
Thanks (again) Phil! For me, the GUID was 837b34e3-7c30-493c-8f6a-2b0f04e2912c.

Thanks,

Jeff
Jeff99999  Thursday, August 13, 2009 4:24 AM

You can use google to search for other answers

Custom Search

More Threads

• Uninstall (shutdown) a ClickOnce Installation
• Install On Demand trigger
• How to accsess contacts of outlook through VB.NET ?
• Can't get custom prereq. for SqlNativeClient to work
• How can I install windows service using VS.net setup?
• Installing click once published application programmatically
• InvalidDeploymentException on some clients
• running exe file with help of setup exe
• How to change icon of msi installer package in vs2008 and change user interface screen after creating package for c# projects
• ClickOnce application deployment