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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:07:37+00:00 2026-05-13T09:07:37+00:00

I am a student developer and I have built several installers for the company

  • 0

I am a student developer and I have built several installers for the company I am working with now. So I am fairly familiar with WIX.
We recently decided to have a Build server that auto builds our solution. It builds both debug, and release, as well as Obfuscated (and non obfuscated) projects.
And you really don’t have to understand any of this. All you have to understand is that I have the same Wix project building different MSIs dynamically.
So the way we build them is we call MSBuild.exe with several parameters. Parameters the wix project depends on.

So let’s say we go into command prompt and write

C:\>\windows\Microsoft.NET\Framework\v3.5\MSBuild.exe MyApp.Install\MyApp.Install.wixproj /p:Configuration=Release /p:SpecialPath=Obfuscated /t:Build

The idea is that wix sees the "SpecialPath" parameter being assigned "Obfuscated"; and in the installer paths its source to
..\myApp\bin\$(var.SpecialPath)\myApp.exe which translates to ..\myApp\bin\Obfuscated\myApp.exe when built.

TheQuestion

How do you create those custom build parameters and have them passed to my .wxs file. As of now with this setup, $(var.SpecialPath) is not defined and the build CrashSplosions.

For obvious legal reasons I had to cut 90% of the project.wxs file out and rename some stuff, but for all intents and purposes this is what I have.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="myApp" Language="1033" Version="$(var.Version)" Manufacturer="myApp" UpgradeCode="$(var.UpgradeCode)">
<Package Id="*" InstallerVersion="200" Compressed="yes" />
<Media Id="1" Cabinet="media.cab" EmbedCab="yes" />

<Directory Id="TARGETDIR" Name="SourceDir" >
  <Directory Id="ProgramFilesFolder">
    <Directory Id="INSTALLLOCATION" Name="myApp"> 

      <Component Id="myAppEXE" Guid="FD5EBC02-MY29-GUID-ACCA-61324C5F1B68">
        <RegistryKey Root="HKLM" Key="Software\MyApp">
          <RegistryValue Value="0" Type="string" KeyPath="yes"/>
        </RegistryKey>
        <File Id="MYAPPEXE" Name='myApp.exe' Source="..\myApp\bin\$(var.SpecialPath)\myApp.exe" />
      </Component>

      <Component Id="EngineDLL" Guid="*">
        <File Id="ENGINEDLL" Name='Engine.dll' Source="..\myApp\bin\$(var.Configuration)\Engine.dll" />
      </Component>
      <Component Id="CommonDLL" Guid="*">
        <File Id="COMMONDLL" Name='Common.dll' Source="..\myApp\bin\$(var.Configuration)\Common.dll" />
      </Component>
      
    </Directory>
  </Directory>
</Directory>

<Feature Id="ProductFeature" Title="myApp" Description='All' Display='expand' Level="1" ConfigurableDirectory='INSTALLLOCATION'>
  <ComponentRef Id="myAppEXE" />
  <ComponentRef Id="EngineDLL" />
  <ComponentRef Id="CommonDLL" />
</Feature>
</Product>
</Wix>
  • 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-13T09:07:37+00:00Added an answer on May 13, 2026 at 9:07 am

    As already answered, you need to pass the variables into WiX. We use Nant instead of MSBuild, but the concept remains the same.

    Here’s a Nant example passing in half a dozen variables to candle (it’s not the cleanest example, but is lifted verbatim from a project I worked on)

    <candle   out="${dir.obj}\"
              rebuild="true"
              extensions="WixUIExtension;WixNetFxExtension">
        <defines>
            <define name="ProcessorArchitecture" value="${release.platform}" />
            <define name="SourceDir" value="${dir.source}" />
            <define name="version" value="${version}" />
            <define name="releasetype" value="${release.type}" />
            <define name="Language" value="${language}" />
            <define name="product" value="${string.product}" />
            <define name="productedition" value="${release.productedition}" />
        </defines>
    
        <sources>
            <include name="*.wxs" />
            <include name="..\Common\*.wxs" />
        </sources>
    </candle>
    
    <!-- Define fallback culture for non-US -->
    <property name="cultures" value="${language}" />
    <property name="cultures" value="${language};en-US" unless="${language == 'en-US'}" />
    
    <light
      out="${dir.build}\setup_${release.platform}_${release.compressionlevel}.msi"
      extensions="WixUIExtension;WixNetFxExtension;WixUtilExtension"
      cultures="${cultures}"
      rebuild="true"
      suppressices="ICE03;ICE82"
      suppresspdb="true" >
    
    
        <arg line="-loc &quot;setup-${language}.wxl&quot;" />
        <arg line="-sw1101" />
    
        <arg line="-b ${dir.resources}" />
        <arg line="-b ${dir.resources.common}" />
        <arg line="-b ${dir.resources.common}\Microsoft" />
        <arg line="-b ${dir.source}" />
        <arg line="-dcl:${release.compressionlevel}" />
        <arg line="-dWixUILicenseRtf=EULA_${language}.rtf" />
        <sources>
            <include name="${dir.obj}\*.wixobj" />
        </sources>
    </light>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a part time developer (full time student) and the company I am
Hi there I am desktop application developer but now i have to work on
Update I'm new a drupal developer, I have retrieved my node 'Student' and 'Internships'.
I'm a student programmer for a company, and the lead developer is making a
I'm a web developer and a college student majoring in telecommunications. This means I'm
i am a student and i am new in php i am working on
I have four tables student ------- id, int firstName, varchar lastName, varchar course ------
Working to help a student with his project trying to get his Div to
I am a university student working on a research project that involves migrating a
I've spent my professional life as a C# developer. As a student I occasionally

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.