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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:19:58+00:00 2026-05-24T04:19:58+00:00

I have an EXE that I built that I am trying to have installed

  • 0

I have an EXE that I built that I am trying to have installed in the Program Files (x86) folder on Win7 machines. There is really interesting behavior going on. The program has a gui-we used wx-Python and XRC to handle the interface. we include an XRC folder in the distribution. The program uses getcwd() to locate itself and find the xrc folder. However, and this is really interesting-it all works fine when I place the program in Program Files. When I place the program in the Program Files x86 folder I get a message that indicates to me that it can’t find the xrc folder.
Let me be clear this application runs fine on an XP machine in Program Files and on a Vista Machine as well as a Win7 machine in Program Files

Now what else is interesting is if I double click the exe in the Program Files (x86) folder it runs fine but when I try to run it off of the short cut added to the start/program menus it does not run correctly. That is where I get the error message that suggests the program is not finding the xrc folder. I also moved the program to a folder on the desktop, and at the root and in every other location it starts and runs fine. Thus I am confident that my code to point to the xrc folder is fine.

So back to the question. When programs are running from the x86 folder is something happening that causes the path references to get screwy? More importantly is it fixable?

One final note- To be as certain as possible that the problem relates to the path to the xrc folder I deleted the xrc folder from two instances of the application and I get the same error message that I received when the program was installed in the x86 folder.

Just for clarification the only time the program will not run is when I use the shortcut on the start menu and the exe and all of the parts are saved in the Program Files (x86) folder

Plasticsabers answerreally helped me understand the problem and I was able to fix it. This is not a Vista verus XP issue it is a 32 bit OS versus 64 bit issue.

I need to run on 64 bit XP and 32 bit Win7.

  • 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-24T04:20:00+00:00Added an answer on May 24, 2026 at 4:20 am

    According to this note, the Program Files (x86) folder is specifically intended for 32-bit program files, as opposed to the Program Files folder, which is intended for 64-bit programs.

    But in order for a 32-bit program to pretend that it’s on a 32-bit machine, the name of the working directory has to be returned as ‘Program Files,’ because that’s what it would be on a 32-bit machine. This is what you’re seeing when you ask Windows for the working directory with getcwd(). Since your program is trying to use that directory name in a path, and that’s not actually the path to the file on the real, 64-bit machine, it breaks.

    Looking at the WOW64 docs, I suspect the reason it only breaks when launched from the start menu is, that’s an instance of a 64-bit process creating a 32-bit process, which causes the system to change the ProgramFiles environment variable. In the case where you double-click to launch it, it’s a 32-bit process from the beginning.

    It seems you’re not the only one to encounter this; this Windows API seems designed specifically to work around the problem you’re describing. If nothing else it suggests the behavior you’re seeing is by design.

    But this is academic. To insulate yourself from this sort of thing, I would get the absolute path to your exe, using something like os.path.realpath(__file__), and go from there.

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

Sidebar

Related Questions

I have an exe that is built and placed into a Setup project for
I have a Delphi exe that is built with packages. The exe processes successfully
There are some batch files in the Ruby installation that reference this Ruby exe
I have a .NET project that's always been built/run by/on 32 bit machines. I
I have a windows service exe that is compiled as x86, amd64, and Itanium.
I have a nightly build DOS batch script that invokes devenv.exe to build a
I have an exe that already creates a csv file. If I save the
I have an EXE that I want to distribute, but I don't want to
I have a simple .exe that needs to be running continuously. Unfortunately, sometimes it
I have a C# exe that needs to be run using WMI and access

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.