Skip to main content
GameDev.net gamedev.net
🔒 Locked

GUID, or "product code", for Visual C++ 2008 redistributables

Started by reptor Sep 21, 2009 at 4:51 PM 3 replies 21.9k views
Original Post
reptor
reptor
Hello, I'm trying to find out the GUIDs for the http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=2051a0c1-c9b5-4b0a-a8f5-770a549fd78c Microsoft Visual C++ 2008 Service Pack 1 Redistributable Package ATL Security Update vcredist_IA64.exe vcredist_x64.exe vcredist_x86.exe I know them for the older version (found from here: http://blogs.msdn.com/astebner/archive/2009/01/29/9384143.aspx ), but I can't find the ones for those new ones anywhere. Example: Visual C++ 2008 SP1 Redistributable Package (x86) - {9A25302D-30C0-39D9-BD6F-21E6EC160475} But what are the codes for the new ones? I think Microsoft could make those codes easier to find. Why not add them in the http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=2051a0c1-c9b5-4b0a-a8f5-770a549fd78c page, and why not add them to every page, if the downloadable file has a "product code" or GUID, then why not add it to the same page where you download the product. [Edited by - reptor on April 13, 2010 7:23:29 PM]
reptor
reptor
I will appreciate information which will help me to find the codes.

If someone can tell me how to get that information, that would be great. So I can go and get it myself.
Sneftel
Sneftel
GUIDs for all your installed software are to be found in the registry, in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. I see a "Microsoft Visual C++ 2008 ATL Update kb973924 - x86 9.0.30729.4148" listed as GUID {002D9D5E-29BA-3E6D-9BC4-3D7D6DBC735C}.
adeyblue
adeyblue
Alternatively, if you don't want to actually install it:

Extract the contents of vcredist.exe (WinRAR, etc. will do it)

Run msidb.exe from the Windows SDK\bin folder
Open the vs_red.msi file that was extracted
Select an output directory
Click the Export radio button and highlight Property in the field list
OK
Quit

Open the property.idt file in the output directory in a text editor, ProductCode will be somewhere in the list.


Msidb has a command line interface so it's possible to script it, if this is something you'll be doing a lot of. Here's the command line reference.
reptor
reptor
Sneftel, I think that is not the code for the redistributable. It is likely for an update you have gotten from Microsoft/Windows Update. I have it as well - in the "Add/Remove Programs" list, there is that, and then another entry for the redistributable.

I don't know what I was thinking yesterday, but I in fact did search the registry before posting here. I also tried to find the code from the vc_redist by unpacking it and the .msi inside it. No luck there. And for some reason my search in the registry failed - I think that was me being a little stupid there - searched a code for an older vcredist, found an entry, and saw it has no name (except the code itself), and determined that I can't use the name as a search key, and gave up. Should have tried searching more.

But anyways, I found the codes, and a way to get them directly from the .msi files.

It seems some other people have had this problem as well, and written some scripts to get it directly from the msi. Here is one:



http://social.technet.microsoft.com/Forums/en-US/configmgrsdk/thread/b5d994b7-9ff6-4e0d-baa5-3159212604f5

' GetMSIProductCode.vbsOption Explicit' VariablesConst msiOpenDatabaseModeReadOnly     = 0' Get command-line arguementsDim argCount:argCount = Wscript.Arguments.Count' Connect to the Windows Installer object.On Error Resume NextDim installer : Set installer = NothingSet installer = Wscript.CreateObject("WindowsInstaller.Installer") : CheckError' Open the database (read-only).Dim databasePath:databasePath = Wscript.Arguments(0)Dim openMode : openMode = msiOpenDatabaseModeReadOnlyDim database : Set database = installer.OpenDatabase(databasePath, openMode) : CheckError' Extract language info and compose report messageWscript.Echo "Database (MSI) = "         & databasePathWscript.Echo "ProductName    = "         & ProductName(database) Wscript.Echo "ProductCode    = "         & ProductCode(database) ' Clean upSet database = nothingWscript.Quit 0' Get the Property.ProductName value.Function ProductName(database) On Error Resume Next Dim view : Set view = database.OpenView("SELECT `Value` FROM `Property` WHERE `Property` = 'ProductName'") view.Execute : CheckError Dim record : Set record = view.Fetch : CheckError If record Is Nothing Then ProductName = "Not specified!" Else ProductName = record.StringData(1)End Function' Get the Property.ProductCode value.Function ProductCode(database) On Error Resume Next Dim view : Set view = database.OpenView("SELECT `Value` FROM `Property` WHERE `Property` = 'ProductCode'") view.Execute : CheckError Dim record : Set record = view.Fetch : CheckError If record Is Nothing Then ProductCode = "Not specified!" Else ProductCode = record.StringData(1)End FunctionSub CheckError Dim message, errRec If Err = 0 Then Exit Sub message = Err.Source & " " & Hex(Err) & ": " & Err.Description If Not installer Is Nothing Then  Set errRec = installer.LastErrorRecord  If Not errRec Is Nothing Then message = message & vbNewLine & errRec.FormatText End If Fail messageEnd SubSub Fail(message) Wscript.Echo message Wscript.Quit 2End Sub



1) Save that code into file 'GetMSIProductCode.vbs'

2) Extract file vc_red.msi from the vcredist_x86.exe

3) Run the script: C:\>cscript GetMSIProductCode.vbs vc_red.msi

It outputs the product name and the product code.


From newest to oldest:


Microsoft Visual C++ 2008 SP1 Redistributable Package ATL Security Update:

ProductName = Microsoft Visual C++ 2008 Redistributable - ia64 9.0.30729.4148
ProductCode = {977AD349-C2A8-39DD-9273-285C08987C7B}

ProductName = Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.4148
ProductCode = {4B6C7001-C7D6-3710-913E-5BC23FCE91E6}

ProductName = Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.4148
ProductCode = {1F1C2DFC-2D24-3E06-BCB8-725134ADF989}



Microsoft Visual C++ 2008 SP1 Redistributable Package:

ProductName = Microsoft Visual C++ 2008 Redistributable - ia64 9.0.30729.17
ProductCode = {5827ECE1-AEB0-328E-B813-6FC68622C1F9}

ProductName = Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.17
ProductCode = {8220EEFE-38CD-377E-8595-13398D740ACE}

ProductName = Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.17
ProductCode = {9A25302D-30C0-39D9-BD6F-21E6EC160475}



Microsoft Visual C++ 2008 Feature Pack Redistributable Package:

ProductName = Microsoft Visual C++ 2008 Redistributable - ia64 9.0.30411
ProductCode = {39B31016-6662-3D0F-A778-DEC0CD2F514C}

ProductName = Microsoft Visual C++ 2008 Redistributable - x64 9.0.30411
ProductCode = {D93AC9C8-B6CF-391E-BD2F-48AF4727476C}

ProductName = Microsoft Visual C++ 2008 Redistributable - x86 9.0.30411
ProductCode = {5DA8F6CD-C70E-39D8-8430-3D9808D6BD17}



Microsoft Visual C++ 2008 Redistributable Package:

ProductName = Microsoft Visual C++ 2008 Redistributable - ia64 9.0.21022
ProductCode = {2B547B43-DB50-3139-9EBE-37D419E0F5FA}

ProductName = Microsoft Visual C++ 2008 Redistributable - x64 9.0.21022
ProductCode = {350AA351-21FA-3270-8B7A-835434E766AD}

ProductName = Microsoft Visual C++ 2008 Redistributable - x86 9.0.21022
ProductCode = {FF66E9F6-83E7-3A3E-AF14-8DE9A809A6A4}






It seems unnecessarily difficult to get the codes - perhaps Microsoft should consider improving the situation.



Adeyblue, I'll have a look at that method as well. Edit: Seems to work as well.


Thanks to both of you.

[Edited by - reptor on September 22, 2009 12:33:53 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.