I know this doesn't do exactly what you want but we use the product version of the actual EXE to assign the product version to the MSI. THis way we only need to update the project version and the installer version is automatically updated. Be sure to replace the items in <> with your info.
FYI, $(SolutionDir) and $(Configuration) include a trailing '\' so don't add another one. Add the following to the WiX project file: <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Wix.targets. --> <Target Name="BeforeBuild"> <GetAssemblyIdentity AssemblyFiles="$(SolutionDir)<ProjectDir>\bin\x86\$(Configuration)<Product>.exe"> <Output TaskParameter="Assemblies" ItemName="AssemblyVersions" /> </GetAssemblyIdentity> <CreateProperty Value="%(AssemblyVersions.Version)"> <Output TaskParameter="Value" PropertyName="AssyVersion" /> </CreateProperty> <CreateProperty Value="$(AssyVersion.Split('.')[0]).$(AssyVersion.Split('.')[1]).$(AssyVersion.Split('.')[2])"> <Output TaskParameter="Value" PropertyName="ShortAssyVersion" /> </CreateProperty> <CreateProperty Value="$(DefineConstants);LongAssyVersion=$(AssyVersion)"> <Output TaskParameter="Value" PropertyName="DefineConstants" /> </CreateProperty> <CreateProperty Value="$(DefineConstants);ShortAssyVersion=$(ShortAssyVersion)"> <Output TaskParameter="Value" PropertyName="DefineConstants" /> </CreateProperty> </Target> Then in the Product.wxs you can use: <?xml version="1.0" encoding="UTF-8"?> <?define ProductName = "My Product Name"?> <?define CompanyName = "My Company Name"?> <?define CompanyLegalName = "My Company Legal Name"?> <!-- Update GUID when releasing new version --> <?define Guid = "<My Product GUID>"?> <?define UpgradeCode = "<My Upgrade GUID>"?> <?define AppDataFolder = "<My App Data Folder>"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> <Product Id="$(var.Guid)" Name="$(var.ProductName) $(var.ShortAssyVersion)" Language="1033" Version="$(var.LongAssyVersion)" Manufacturer="$(var.CompanyLegalName)" UpgradeCode="$(var.UpgradeCode)"> <Package InstallerVersion="300" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" Comments="$(var.ProductName) $(var.LongAssyVersion)" Keywords="Version $(var.LongAssyVersion)" /> Brian If you can't explain it simply, you don't understand it well enough. - Albert Einstein On Mon, Feb 10, 2014 at 8:48 AM, Chetan Rajakumar < chetan_rajaku...@infosys.com> wrote: > Hi All, > > Below is my requirement: > I have a Version.txt file kept under WixInstaller project and I have below > text in Version.txt: > BuildVersion=1.2.3.4 > Now I have to read the above BuildVersion from the Version.txt and Update > the value of Product Version in Product.wxs file. > Something like below: > <Product Id="*" Name="MyProduct" Language="1033" > Version="$Read Build version from Version.txt" > Manufacturer="MyManufacturer" > UpgradeCode="335569EF-2DF3-4CD7-8EDA-59996E345553"> > > Please help me out to achieve this requirement, Thanks in advance. > > > Regards, > Chetan. > > **************** CAUTION - Disclaimer ***************** > This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended > solely > for the use of the addressee(s). If you are not the intended recipient, > please > notify the sender by e-mail and delete the original message. Further, you > are not > to copy, disclose, or distribute this e-mail or its contents to any other > person and > any such actions are unlawful. This e-mail may contain viruses. Infosys > has taken > every reasonable precaution to minimize this risk, but is not liable for > any damage > you may sustain as a result of any virus in this e-mail. You should carry > out your > own virus checks before opening the e-mail or attachment. Infosys reserves > the > right to monitor and review the content of all messages sent to or from > this e-mail > address. Messages sent to or from this e-mail address may be stored on the > Infosys e-mail system. > ***INFOSYS******** End of Disclaimer ********INFOSYS*** > > > ------------------------------------------------------------------------------ > Managing the Performance of Cloud-Based Applications > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > Read the Whitepaper. > > http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users