Search code examples
xmlenvironment-variablesmanifest

Use system variables in xml


I have manifest file write in xml.

I want to use environment variable in it(Program Files), but it didn't work.

Here's my code:

<provider name="myapp"   
           resourceFileName="${env.ProgramFiles}\myfile.dll" 
           messageFileName="${env.ProgramFiles}\myfile.dll">

How can I use environment variable xml syntax?

Trying to run the manifest I get :

**** Warning: The resource file for publisher myapp was not found or could not be opened.
resourceFileName: ${env.ProgramFiles}\myfile.dll

Solution

  • Here's what works for me:

    <provider name="myapp"   
               resourceFileName="%ProgramFiles%\myfile.dll" 
               messageFileName="%ProgramFiles%\myfile.dll">