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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:11:11+00:00 2026-06-01T12:11:11+00:00

I am trying to create an exe file using NSIS script, in my script

  • 0

I am trying to create an exe file using NSIS script, in my script i am copying a batch file and a folder inside the already installed Jasper Server directory(It could be any directory)

This is my NSIS script–

   * Section 
     SetOutPath "C:\PROGRA~2\JASPER~1.0\buildomatic"

      File /r "C:\Users\Desktop\K-installer\backup3101"
       File "C:\Users\Desktop\K-installer\batch\demo.bat"
         ExecWait '"C:\PROGRA~2\JASPER~1.0\buildomatic\demo.bat"'
    SectionEnd  *

that is working fine when jasper server is installed in Program Files(x86).
How can i generalize it for both Program Files and Program Files(x86).

  • 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-06-01T12:11:13+00:00Added an answer on June 1, 2026 at 12:11 pm

    This might not be super elegant but you can check if the directory “C:\PROGRA~2\JASPER~1.0\buildomatic” exists for “Program Files(x86)” and check if “C:\PROGRA~1\JASPER~1.0\buildomatic” for “Program Files”. Then you can can do individual branching and handle everything according to your needs there.

    Here you find how:

    http://nsis.sourceforge.net/IfFileExists_Changes_Section_Flags

    I hope this has helped you.

    Edit: You might want to try something like this (warning not tested):

    Section /o "Program Files(x86)"   prg2
        SetOutPath "C:\PROGRA~2\JASPER~1.0\buildomatic"
        File /r "C:\Users\Desktop\K-installer\backup3101"
        File "C:\Users\Desktop\K-installer\batch\demo.bat"
        ExecWait '"C:\PROGRA~2\JASPER~1.0\buildomatic\demo.bat"'
    SectionEnd
    
    Section /o "Program Files)"   prg1
        SetOutPath "C:\PROGRA~1\JASPER~1.0\buildomatic"
        File /r "C:\Users\Desktop\K-installer\backup3101"
        File "C:\Users\Desktop\K-installer\batch\demo.bat"
        ExecWait '"C:\PROGRA~1\JASPER~1.0\buildomatic\demo.bat"'
    SectionEnd
    
    Function .onInit
    IfFileExists C:\PROGRA~1\JASPER~1.0\buildomatic Prog1Exists PastProg1Exists
    Prog1Exists:
      ; Use the macro from sections.nsh
      !insertmacro SelectSection ${prg1}
    PastProg1Exists:
    
    IfFileExists C:\PROGRA~2\JASPER~1.0\buildomatic Prog2Exists PastProg2Exists
    Prog2Exists:
      ; Use the macro declared above
      !insertmacro SelectSection ${prg2}
    PastProg2Exists:
    
    FunctionEnd
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok so I am trying create a login script, here I am using PHP5
I am trying to create a simple COM server using Python 2.7 on 64
I am trying to create an exe file from my program written in Python
I’m trying to create a simple Win32 DLL. As interface between DLL and EXE
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different
Trying to create a batch to convert .WTV files to mpg files. The code
Here's what I'm trying to do: using cmd.exe, go to a mounted windows network
I'm trying to create an auto-updating app using Winforms. I can't use click-once or
I'm trying to copy a single file using copy-item to a remote computer using

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.