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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:47:45+00:00 2026-05-15T10:47:45+00:00

I have 2 versions of the same exe file for my project. The installer

  • 0

I have 2 versions of the same exe file for my project. The installer is supposed to pick one of the 2 versions depending on some conditions.
In a normal case i would do File executable\myExe.exe. Because i now have 2 versions of the file, i would have to do something like File "${ExeSourcePath}\myExe.exe", and $ExeSourcePath is determined by checking various conditions. When compiling this code i get

File: "${ExeSourcePath}\myExe.exe" -> no files found.

Anyone knows why? I’m only allowed to use fixed paths with the File command or am i doing something wrong?

  • 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-15T10:47:45+00:00Added an answer on May 15, 2026 at 10:47 am

    ${ExeSourcePath} is a precompiler define and $ExeSourcePath is a variable used at runtime, the File command can only use precompiler defines.

    There are two ways you can handle this:

    A) Include both files and decide at runtime based on the users system or choices made during install:

    !include LogicLib.nsh
    Section
    ReadRegStr $0 HKLM "Software\foo\bar" baz
    ${If} $0 > 5
      File "c:\myproject\version2\app.exe"
    ${Else}
      File "c:\myproject\version1\app.exe"
    ${EndIf}
    SectionEnd
    

    B) Only include one file based on command line passed to makensis (/Dusev2 app.nsi) or something on your system:

    Section
    !define projectroot "c:\myproject"
    !searchparse /noerrors /file ....... usev2 ;Or you can use !system etc
    !ifdef usev2
      File "${projectroot}\version2\app.exe"
    !else
      File "${projectroot}\version1\app.exe"
    !endif
    SectionEnd
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to have both versions of maven running on the same computer?
This is probably an easy question... I have 4 source versions of the same
Task at hand — I have three versions of some code, developed by different
In my application I have 3 major parts: Exe : an executable file Lib_A
We have a COM component project and one Windows setup project which registers the
Say I have the following solution with multiple versions of the same code each
I have a unit test project set up in the same solution as my
I have been trying to add a .cu file into my own(dll) win32 project
I have been doing some testing on a project that I recently started building
I'm testing out ILMerge for a new project, and although the .exe file seems

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.