Reply to Thread

Post a reply to the thread: How do I use environment variables for file paths

Your Message

Click here to log in

What's the name of our main installation product (in uppercase letters), directly followed by the current year?

 

You may choose an icon for your message from this list

Additional Options

  • Will turn www.example.com into [URL]http://www.example.com[/URL].

Topic Review (Newest First)

  • 07-29-2017, 02:28 AM
    linder

    Re: How do I use environment variables for file paths

    Thanks for your suggestion. We'll add a function to support this in the next maintenance build.

    Friedrich
  • 07-28-2017, 11:29 AM
    KCL

    Re: How do I use environment variables for file paths

    Although it works, I wouldn't be against being able to use environment variables during compile time.
  • 07-28-2017, 11:28 AM
    KCL

    Re: How do I use environment variables for file paths

    Perfect explanation, it works, thanks!
  • 07-28-2017, 01:55 AM
    linder

    Re: How do I use environment variables for file paths

    Kevin,

    You need the value of the environment variable at compile time, right? The only way to handle it is to write a little "helper application" with SetupBuilder to retrieve the value and then push it back to the SetupBuilder compiler. For example, let your helper.exe retrieve the value of the environment variable and write it to an INI file. At compile time (from your script), execute the helper.exe (using #run... with "Wait" enabled) and after it load your compiler variable with the value (#get ini...). If you need help with this, just let me know.

    Does this help?

    Friedrich
  • 07-27-2017, 01:01 PM
    KCL

    How do I use environment variables for file paths

    I have an environment variable PROJ_A setup on my machine, and the continuous integration machine, however the value of the environment variable is different on both machines. The environment variable is the source folder of my files that will be getting installed.

    So if, in command prompt, I run
    Code:
    echo %PROJ_A%\test.exe
    on my machine I'll see
    Code:
    C:\LocalProjects\ProjA\test.exe
    but if I run the same thing on the CI machine, I'll get
    Code:
    A:\Build\Checkout\ProjA\test.exe
    .

    I'm wanting to set the source folder of a file being installed, to a path that uses an environment variable. Since this is going to run on a CI server, I won't be able to manually go in and change the compiler variables every time I want to build, so there should be a way to do this.

    If there already is a way, I appologize in advance--I'm not seeing it.

    Thanks,
    Kevin

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •