Samselvaprabu
Samselvaprabu

Reputation: 18227

Is there a way to find which product version number is being applied during WIX setup?

I am having a wix project and product version is being changed through property passed from wixproj file.

My wxs file will be like this

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="7a224f9a-0627-4848-8b9e-f037cb409fc6" UpgradeCode="42c97588-6c36-40ef-aeb0-290aaffd6456" Version="$(var.ProductVersion)" Language="1033" Name="Myproj" Manufacturer="My Organization">

I am passing version as $(var.Productversion). In my wixproj i am passing this variable as given below.

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProductVersion>3.0</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <Version Condition=" '$(Version)' == '' ">1.0.0.5</Version>
    <OutputType>Package</OutputType>
    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>



  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <OutputPath>bin\$(Configuration)\</OutputPath>
    <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
    <DefineConstants>ProductVersion=$(Version)</DefineConstants>
  </PropertyGroup>

I am passing this $version number property through Msbuild . But somehow the value is not updated.

In Msbuild log file i am not able to trace this. Is there any way to find whether the version number is taken from right place and having the value given by me?

Whether in wix we can display the value which is being passed? I tried with wixproj Afterbuild target , the number displayed their(2.20.1.2) is not updated in Msi (it is 2.20.1.1).

Upvotes: 0

Views: 723

Answers (1)

RinoTom
RinoTom

Reputation: 2326

If you have an AssemblyVersion.wxi file used in your project, you can update the same Product Version from your MSBuild file in this file. Then by referring to $(var.ProductVersion) will refer the same from this file.

If this is not much clear for you, I can elaborate it if required.

Upvotes: 0

Related Questions