Windows 7 Forums Search
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows 7. The Windows 7 forum also covers news and updates and has an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7 - Finding a program in Program Files (x86)

 
08-31-2011   #1


Windows 7 Pro 64 bit
 
 

Finding a program in Program Files (x86)

Running Windows 7 Pro, 64bit.

We have a package of scripts and programs that comprise a custom application for OpenOffice 3.2 (do not want to upgrade OO at this point). We must support our package on Win XP, Vista and 7.

A bunch of our scripts start up OpenOffice by running the command:
C:\Program Files\OpenOffice.org 3\program\soffice.exe (with arguments).

Works fine on XP. Fails on Windows 7 because the OO program installs itself into Program Files (x86). Even if I change properties of the installer file, in the Compatibility tab, to Win XP SP3, AND tell the installer to put it in C:\Program Files, Windows 7 still installs it into Program Files (x86).

We would LIKE to have the same script work on both flavors of Windows. I know we can modify our scripts to branch on which Windows, and choose two different paths to soffice.exe, but that's messy.

I can't solve it by creating a shortcut in Program Files, to the program in Program Files (x86); that's not allowed.

Is there some solution in Windows 7 to find the program no matter which place it lives? Like, a semi-intelligent environment variable for ProgramFiles that looks in one place, then the other? Ie.:
"C:\%ProgramFiles%\OpenOffice.org 3\program\soffice.exe

Maybe I'm missing some easy solution, but so far I don't see it.

My System SpecsSystem Spec
08-31-2011   #2


Windows 7 Ultimate SP1 64-Bit
 
 


The reason the programs plonk themselves in the Program Files (x86) must be because they are 32-bit applications.

By default, Windows 7 64-Bit installs 32-bit applications in the Program Files (x86) folder, whilst 64-bit applications reside in the Program Files folder.
My System SpecsSystem Spec
08-31-2011   #3


Windows 7 x64 Ultimate
 
 


Unfortuantely the environment variable for that folder is called "%ProgramFiles(x86)%" to get to the 32 bit programs folder. And apparently only even exists on the 64 bit version of Windows 7.

You may have to test for the existance of "%ProgramFiles(x86)%" and use if if it's defined, else use ""%ProgramFiles%"
My System SpecsSystem Spec
.


08-31-2011   #4


Windows 7 Pro 64 bit
 
 


fseal:
That's a pretty good suggestion. More direct than testing for flavor of Windows.

Thanks! (But I don't mark it solved yet)
My System SpecsSystem Spec
Reply

 Finding a program in Program Files (x86) problems?



Thread Tools



Similar Threads for: Finding a program in Program Files (x86)
Thread Forum
Solved Installing a program from program files Installation & Setup
Program Files or Program Files (x86)-Where to place downloaded program Software
Finding hidden program General Discussion
need help finding exe. on debug program Crashes and Debugging
Finding a program's IP address to block Software


All times are GMT -5. The time now is 11:44 PM.



Windows 7 Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows 7" and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30