Can 64-bit DIFXAPP run from "Program Files (x86)"? - windows

I have a 32-bit application which also has a device driver. I am using the DIFXAPP support in WiX to install the driver. Is it OK on 64-bit windows to install the application and 64-bit driver files to a subdirectory of Program Files (x86) then have DIFX install the driver to the driver store from there? I believe that it's not allowed to run 64-bit code from the 32-bit Program Files directory but in this case I'm not running it, just asking DIFXAPP to copy it. The actual function used is DriverPackageInstall().

There is a convention to install programs 32-bit programs into the x86 tree, but it is not forbidden. It is legal to copy the DIFXAPP executable and accompanying files into a sub-directory in Program Files (x86) and start it from there.

Related

Inno Setup install to SysWOW64 in 32Bit mode

I'm creating an installer which only needs to install 32bit files, they work on both 64 and 32 bit machines.
I'm running the Inno Setup on a 64bit machine and even though the install mode is 32bit the files still end up in the SysWOW64 folder. The Dest directive sets to {sys}
Source: "C:\Users\Lablabla\Documents\Visual Studio 2013\Projects\Test\MyDll.dll"; DestDir: "{sys}"; Flags: 32bit
The weirder thing is that the log shows that the destination is system32 and installation mode as 32-bit
2015-04-12 01:04:14.046 64-bit Windows: Yes
2015-04-12 01:04:14.046 Processor architecture: x64
2015-04-12 01:04:14.046 User privileges: Administrative
2015-04-12 01:04:14.046 64-bit install mode: No
....
2015-04-12 01:04:20.237 Dest filename: C:\Windows\system32\MyDll.dll
But when the setup is done the file is in the SysWOW64 folder, even though the executable file is in the correct place of Program Files (x86)
This happens even when setting the specific 32bit flag to the dll file.
The installation is very simple, only this dll and an executable. No registry or anything more complex.
Anyone experienced such thing?
Thanks
The SysWOW64 folder is the correct place for a 32-bit installation on a 64-bit system, in the same way that the Program Files (x86) folder is the correct place. SysWOW64 is the System32 folder on a 'Windows on Windows 64-bit' installation.
Admittedly, Microsoft should have done a much better job at naming these consistently to avoid confusion! i.e. System32 on a 64-bit installation is really "System64" and SysWOW64 is "System32", just as the plain Program Files is really "Program Files (x64)" if you want to think of it that way. All 32-bit applications run in the WOW64 (Windows 32-bit on Windows 64-bit) emulator on 64-bit Windows.

Trying to create a 64-bit installer from an existing 32-bit installer.(Makemsi)

I am trying to create a 64-bit installer from an existing 32-bit installer.(Makemsi)
When installing 64-bit on machine with 32-bit already installed, the 32-bit files in the
program folder are not removed and 64-bit files are not installed. When installing 32-bit
on a machine with 64-bit already installed it removes 64-bit files and installs 32-bit
files.
Can anyone help me in understanding what happens When installing 64-bit on machine with
32-bit already installed.

If an application is built on a 32-bit machine, when run on a 64-bit machine, how does it look for DLLs?

If an application is built on a 32-bit machine, when run on a 64-bit machine, how does it know the .dll is in C:\Program Files (x86) instead of C:\Program Files or it doesn't?
ERROR SUMMARY
[SCRIPT]: File not found: C:\Program Files\Common Files...\abc.dll.
However, in my 64-bit machine, abc.dll is in C:\Program Files (x86)\Common Files...\abc.dll
If it doesn't, where do I adjust the path because apparently it's not in the application's code.
First of all, you can cross-compile in either direction so being built on a 32-bit machine doesn't necessarily mean anything. It is really an issue of running 32-bit code on a 64-bit machine. In this case, there is a 32-bit emulation layer on 64-bit installations called Wow64. Part of this is file system redirection, which redirects file system requests from 32-bit programs. In this case, trying to access "C:\Program Files" from 32-bit code will transparently redirect to "C:\Program Files (x86)".
it doesn't?
No part of the default search path checks anywhere in Program Files or Program Files (x86) unless it is because the directory of the application is under one of those folders.
If you are getting that error from a 32bit application then something is set up unusually (like overriding the default install location under Program Files (x86)).

VS 2010 Premium : Navigating into Windows directories in a 64-bit project

VS 2010 Premium :
I have a project which targets x86 platforms and I need to make it target x64 platforms.
I went to the Configuration Manager and from there to the Active Solution Platform, chose "new",added an 'x64' option and copied the settings from a Win32 platform (It's the only option I had).
So now the project should be targeting x64 platforms, if I'm not mistaken.
I have a code line in my project which asks for the file with this path :
Common Files\Microsoft Shared\OFFICE14\ACEDAO.dll
Yet it seems that during compilation, this file is being requested from the "Common Files" directory within the Program Files(x86) directory (the one for 32-bit). Naturally the compilation fails, since no such file exists in this path.
How can I make it to navigate to the (Program Files\Common Files ..) directory ?
The project should be targeting 64-bit after all and I require the 64-bit version of this dll.
The binary produced by the compiler and linker is indeed a 64-bit image. The compiler however is not, that's the one that reads the file so it is subject to file system redirection. The default 64-bit compiler is the one in the vc\bin\x86_amd64 directory. It is a 32-bit compiler that produces 64-bit code. You could select vc\bin\amd64 in the project's VC++ Directories setting to select the 64-bit compiler.
Something wrong with your machine setup though, I have this file present in c:\program files (x86). Windows 7 x64, Office 2010, VS2010. I have no clue why you don't have it, you could ask at superuser.com. Just copying the file is a simple workaround. Also beware that the 64-bit version of the ACE provider is not distributable.

Program Files (x86) problem

I have an installer package, at the last step user can select launch application or not. the installed application is 32bit, during the installation we select the installation folder to "c:\Program Files", while it will always install application to "c:\Program Files(x86)" folder, then we meet problem, we can not launch the application, we have tested that if we choose the default installation folder(which means c:\program files") it works well. so I guess the problem is that windows launch 32bit application as 64bit, so it failed. how to solve it?
Your installer should know the path the application was installed to. You should use it, your EXE file key; for a WiX example see Well Done section of the tutorial.
If your installer package is MSI-based, then the installer is a 64 bit process, and it sees both Program Files (x86) and Program Files. I think it is the problem why you can't start your program. (A 32 bit executable will see only Program Files (x86) under the name of Program Files).

Resources