3

I have a setup project for my C# program, and this setup project has a Version in its properties. I'd like for the MSI file that is generated to have this Version embedded in it, so I can mouse over it in explorer and see what version the file is.

I'm using VS2008. How can I do this?

Blorgbeard
  • 101,031
  • 48
  • 228
  • 272

5 Answers5

8

If you simply add the "Version: 1.5.0" text into the Description property of the Setup Project, the version number also shows on the MSI file like so:

http://screencast.com/t/A499i6jS

Ron Savage
  • 10,923
  • 4
  • 26
  • 35
  • Could not get the 'version' text as key, as shown in the video. When added to `description` it shows under the key `Subject` as a part of text along with 'version' text. Using: WIX v3.9 – Ujjwal Singh Oct 10 '15 at 23:36
3

As far as I know MSI file will never show version. Simple reason is that MSI files are not PE files, they are sort-of database. Msiexec.exe then interprets this database to do the actual installation. The version property you mention is used by MSI engine internally for upgrades, uninstalls etc and is never displayed.

Vivek
  • 16,360
  • 5
  • 30
  • 37
1

That's a good question but I don't know any setup tool that could do that. Moreover I never encountered an MSI file with file version resource embedded in it, so it's not a common practice. Usually if I want to find out version of an MSI file I have to open it in Orca and check ProductVersion property there (in Property table).

Pavel Chuchuva
  • 22,633
  • 10
  • 99
  • 115
1

Open up the associated .vdproj file in a text editor. Look for the "Product" section, then modify the "ProductVersion", and the "Manufacturer" fields.

 "Product"
    {
    "Name" = "8:Microsoft Visual Studio"
    "ProductName" = "8:tidAxCleanupScript"
    "ProductCode" = "8:{0949AAAD-2C29-415E-851C-825C74C9CA81}"
    "PackageCode" = "8:{8F012EF1-D5D0-43DC-BBFD-761A639DDB07}"
    "UpgradeCode" = "8:{38DE1949-0782-4EF3-BDC2-080EB5B73EF8}"
    "RestartWWWService" = "11:FALSE"
    "RemovePreviousVersions" = "11:TRUE"
    "DetectNewerInstalledVersion" = "11:TRUE"
    "InstallAllUsers" = "11:FALSE"
    "ProductVersion" = "8:**1.5.0**"
    "Manufacturer" = "8:**Default Company Name**"
    "ARPHELPTELEPHONE" = "8:"
0

I might be wrong, but doesn't the msi version follow the version in the AssemblyInfo file of your startup project?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
RWendi
  • 1,446
  • 5
  • 20
  • 38