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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:07:48+00:00 2026-06-03T06:07:48+00:00

I’m writing a installer for windows using nsis. This installer contains a web application

  • 0

I’m writing a installer for windows using nsis. This installer contains a web application which is run on top of xampp, so xampp is also installed as a service with this application. But xamp gives an issue when it installed in 64bit machine on Windows 7. This is due to the directory path issue in C:\Program Files (x86) as mentioned here.

XAMPP Error Solution? I have that installed on my Windows XP Dual Boot Machine

But currently the automatic installation path is set as follows in the installer.

C:\Program Files (x86)\myapplication

The installer script just have the following macro to add the directory chooser page.

!insertmacro MUI_PAGE_DIRECTORY

As a solution what I’m going to do are following actions.

  1. Change the default directory to c:\Program Files
  2. If the user choose the x86 folder give an error message to choose another directory.

For that I need to get the install directory path by

$INSTDIR

and

  1. check whether there is a sub string of x86 with that path
  2. if so give the error messages.
  3. Change the default path to c:\Program Files

Since I’m not much familiar with nsis I’m unable to write this program.

Can someone help me on this issue?

  • 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-03T06:07:50+00:00Added an answer on June 3, 2026 at 6:07 am

    On a win7/64, the 64 bits program files can be get from a 32 bit application via the %ProgramW6432% environment variable.

    You could try to get it with ReadEnvStr :

    • on a 32bit system it will return an empty string
    • on a 64 bit system it will return c:\program files (if not configured elsewhere)

    Here is a snippet that test it :

    ReadEnvStr $0 ProgramW6432
    StrCmp $0 "" 0 +3
    MessageBox MB_OK "it is a 32b system"
    goto +2
    MessageBox MB_OK "it is a 64b system"
    

    In your case, it could do :

    ReadEnvStr $0 ProgramW6432
    StrCmp $0 "" +2 0
    StrCpy $INSTDIR $0
    

    Edit: For the point to refuse Program Files (x86) you could use the .onVerifyInstDir callback method that was given by Anders for another question, it will check the choosen directory as it is selected by the user and before changing the page :

    Function .onVerifyInstDir
      ReadEnvStr $0 "ProgramFiles(x86)"
      StrCmp $0 $INSTDIR 0 PathGood
      MessageBox MB_OK "directory not valid for installation"
      Abort
    PathGood:
    FunctionEnd
    

    Here, I use another environment variable to get the (x86) variant of program files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,

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.