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 1045645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:01:01+00:00 2026-05-16T16:01:01+00:00

I have a wix installer that will install an XML file and then modify

  • 0

I have a wix installer that will install an XML file and then modify it. Installation works great. Today, I needed to add a couple of nodes to this XML file. So I modified the original file and then added some additional instructions to wix to assign these items values.

Well, I get an error every time saying that it cannot find the node. I look and see what file it has in the directory and it still has the older file that did not have the node. How can I tell it to replace the XML file first and then modify it? I don’t want to use “CreateElement” because I don’t know how to not create an element if it exists already (haven’t tried it, so maybe it’d work). Besides, I want my XML file to be the definition of the configuration.

Here’s a sample of my XML:

      <Component Id="MyProgExeConfigComponent" Guid="*">
    <File
      Id="MyProgExeConfig"
      Name="MyProg.exe.config"
      DiskId="1"
      Source="../Published/MyProg/MyProg.exe.config"
      PatchWholeFile="yes"
      KeyPath="yes"/>
    <util:XmlFile
      Id="MyProgExeConfigUser"
      Action="setValue"
      Permanent="yes"
      File="[INSTALLLOCATION]\MyProg.exe.config"
      ElementPath="/configuration/appSettings/add[\[]@key='UserName'[\]]"
      Name="value"
      Value="[USER]"/>
    <util:XmlFile
      Id="MyProgExeConfigPassword"
      Action="setValue"
      Permanent="yes"
      File="[INSTALLLOCATION]\MyProg.exe.config"
      ElementPath="/configuration/appSettings/add[\[]@key='Password'[\]]"
      Name="value"
      Value="[PASSWORD]" />

Any ideas?

  • 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-05-16T16:01:01+00:00Added an answer on May 16, 2026 at 4:01 pm

    Windows Installer is probably not overwriting the file because you have INSTALLMODE=omus and the XML’s create and modification dates are different.

    Is the XML file the key file of it’s own component? If so, try using the File@DefaultVersion attribute to trick Windows Installer into thinking the new file has a version # ( we call this ‘Version Lying” when googling ) and therefore trumps the non-versioned file. Your file will be overwritten and then your XML updates can be applied from there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple WIX installer which will install a Windows Service. I have
I need to create a Wix Installer, that will allow me to have a
I have a WiX installer that I would like to check for .Net 3.5,
I have a fairly complicated installer that I'm writing in Wix that has a
I have a WiX install project that includes IIS setings for virtual directory and
I have Wix 3.5, WixUI_Mondo dialogs and only one Feature to install. The Installer
I have a project where I create WiX (Windows Installer for XML) files, when
I have a config file, myapp.exe.config, that I want to install only if it
I have built an installer using WiX that consists of multiple .exe files that
I want to have our WiX installer that is currently building on a build

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.