Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8058115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:15:01+00:00 2026-06-05T09:15:01+00:00

I want to replace the ProductVersion value at <DefineConstants> node of the following xml.

  • 0

I want to replace the ProductVersion value at <DefineConstants> node of the following xml. Remaining part of the line has to be preserved.
Example:

<DefineConstants>XXXXX;ProductVersion=20.323.23;YYYYY</DefineConstants>

to

<DefineConstants>XXXXX;ProductVersion=21.58.44;YYYYY</DefineConstants>

I tried the replaceregexp but it changes the remaining contents.

<replaceregexp file="${basedir}\Installer.wixproj"
     match="ProductVersion=([0-9].*);(.*)"
     replace="ProductVersion=${SpaceVersion};\1"
     byline="true"
/>

Could you guide me what i am doing wrong in this.

XML:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
      <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
      <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
      <ProductVersion>3.5</ProductVersion>
      <ProjectGuid>{6bc0a85b-9c15-41e6-874b-5fe07e5338e6}</ProjectGuid>
      <SchemaVersion>2.0</SchemaVersion>
      <OutputName>Installer</OutputName>
      <OutputType>Package</OutputType>
      <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
      <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
      <OutputPath>bin\$(Configuration)\</OutputPath>
      <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
      <DefineConstants>Debug;</DefineConstants>
      <WixVariables>
      </WixVariables>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
      <OutputPath>bin\$(Configuration)\</OutputPath>
      <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
      <DefineConstants>SourceDir=$(SolutionDir)XSSE\;ProductVersion=3.3.1.75;ProductName=XSSE;ToolchinShortcut=XSSEToolchinShortcut;ExtensionDir=XSSE;ManifestFileName=extension.vsixmanifest;PkageDefFileName=XSSE.ToolchainProvider.pkgdef;REGKEY=Software\Microsoft\XSSE;</DefineConstants>
      <WixVariables>XYZ=123;</WixVariables>
   </PropertyGroup>
   <ItemGroup>
      <Compile Include="filefragment.wxs" />
      <Compile Include="Product.wxs" />
   </ItemGroup>
   <ItemGroup>
      <WixExtension Include="WixUIExtension">
         <HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
         <Name>WixUIExtension</Name>
      </WixExtension>
   </ItemGroup>
   <Import Project="$(WixTargetsPath)" /> 

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:15:04+00:00Added an answer on June 5, 2026 at 9:15 am

    I think trying to capture the remainder of the line after the product version is unnecessary.

    You don’t need to worry about that. If your regex leaves the rest of the text alone, you can just replace the ProductVersion only.

    I had success with this:

    <replaceregexp file="${basedir}\Installer.wixproj"
        match="ProductVersion=[0-9]+\.?[0-9]+\.?[0-9]+\.?[0-9]+\.?;"
        replace="ProductVersion=${SpaceVersion};"
        byline="true"
        />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to replace part of the following html text (excerpt of a huge
I want to replace a single line in a file with multiple lines, e.g.,
I want to replace the double quotes in the sed command in the following
I want to replace the second line file content, can somebody help please based
I want to replace space with tab in a text variable. For example something
I want to conditionally replace values in columns with value of specific column in
hello I want replace following phrase: tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif with: http://mysite.com/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif I have tried : $comments
i have the following code.My table is called 'tableu'.I want replace 'tableu' with a
I want to replace special characters in string. For example this is input text
I want to replace fuzz word which has been written in URL taken from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.