Friday, April 03, 2009 10:56 PM
I'm using vs2005 developing setup project.
My 'Version' property set to 2.0.0
In the Description property I wrote "... version [ProductVersion] ..."
I expect: "... version 2.0.0 ...",
but I get: "... version [ProductVersion] ..."
Friday, April 10, 2009 5:40 AMModerator
The Description property of the setup project stands for the MSI standard property ARPCOMMENTS. If we set the value of the Description property of a setup project, an item will be added to the Properties table in the resulted MSI package to set the value of the ARPCOMMENTS property.
The remarks part of the MSDN document about Property table mentions:
"You cannot use the Property table to set a property to the value of another property. The installer does nothing to the text string entered in the Value column before setting the property in the Property column."
"This is necessary to prevent creating circular references in the Property table. Instead, you can set one property to another by using a Custom Action Type 51."
So the solution of your problem is to add a type 51 custom action to the MSI package. Unfortunately, Visual Studio doesn't support adding a type 51 custom action in the setup project. I suggest that you do this using Orca.
The following are the steps to add a type 51 custom action to an MSI package:
1. Build your setup project in Visual Studio.
2. Open the resulted MSI package with Orca.
3. Locate the CustomAction table in the left list and add a new row in this table as follows:
Action Type Source Target
Set_ARPCOMMENTS 51 ARPCOMMENTS ... version [ProductVersion] ...
4. Locate the InstallExecuteSequence table and add a new row to call the above custom action. You can sequence the call to the custom action after the DIRCA_TARGETDIR action. For example:
Action Condition Sequence
Set_ARPCOMMENTS NOT Installed 760
5. Save the changes.
6. Install the modified MSI package on the target machine.
Hope this helps.
If you have any question, please feel free to let me know.
Friday, April 10, 2009 1:58 PMHi Linda Liu,
My intention was to have the description of the MSI file conatined the version number.
We have a build process that resulting in a MSI file. The name of the file is Setup.msi and I thought to add the Version number to the description so I could find out the version by checking the properties of the file.
Currently I Changed the Version using a VBScript in the PostBuildEvent:
database.OpenView("UPDATE Property SET Property.Value='"+ Version +"' WHERE Property.Property='ProductVersion'"
I realized that even if I could do it (what you had suggested me) during my build process, it won't solve my problem, cause I need to change the description before the .vdproj file loaded.
I thought about calling a VBScript to change the vdproj file before calling the devenv /build ... but its too dirty
If you can give me a tip how to do it...
(I read there is no way to change file description from script, unless I install DSOfile.dll)
Any way, thanks a lot for your reply.
Friday, April 10, 2009 11:05 PMModeratorI can't find a sample right now, but the description is not directly in the MSI file, so updating the Property table woon't help. You need a sample that shows how to call MsiSummaryInfoSetProperty because it's in the summary info for the MSI file.
Ik, in the Windows SDK there's a sample VBScript called WiSumInf.vbs, that should help.
- Marked As Answer by Eitan Shapir Saturday, April 11, 2009 11:39 AM
Saturday, April 11, 2009 11:39 AMHi Phil,
I found the script WiSumInf.vbs, extract what I need, and I used it like this:
Dim installer, sumInfo
Set installer = Wscript.CreateObject("WindowsInstaller.Installer")
Set sumInfo = installer.SummaryInformation([My Database path], 20)
sumInfo.Property(6) = "My Description"
Thanks for your answer.
- Proposed As Answer by Anmol Kumar Monday, September 12, 2011 11:45 AM
Monday, September 12, 2011 11:45 AM
If my project is in VC++, which script is good to use?
Welcome if you share some of the good links/material on this one for a new person like me.