I have a couple of questions as below. CHM is (Compiled HTML File)
My CHM file has a link to launch a 32-bit application. The CHM file is coded in Javascript.This works fine in a 32-bit OS environment.
But this does not work in a 64 bit OS environment.The reason being: When I open the chm file,64-bit version of hh.exe(an operating system executable) executes and launches the chm.
And the chm gets loaded in a 64-bit environment.
And now I cannot launch the 32 bit application from the CHM file, because a 64-bit process cannot load a 32-bit process.
Is there any way I can make it work for 64-bit OS as well ?
I thought of few solutions as below but I dont know how to implement them .
1)In Javascript code,if I could check whether the OS is a 32-bit or 64 bit.Then I could pop-up a well-defined error to user,if it is 64-bit OS.
2)Or if I could force the OS to run the 32-bit version of hh.exe, so that the chm is loaded in a 32-bit environment and hence causing no problem.
Or 3) distribute a 64-bit version of the application launched by the CHM?
Not sure what you mean by 'load a 32-bit process', but a 32-bit process can most certainly create a 64-bit process. For example, if I have MyApp32.exe, a 32-bit application, it can absolutely launch MyApp64.exe, a 64-bit application.
When you read about incompatibilities between 32- and 64-bit code, it refers to a 32-bit application loading a 64-bit DLL, or vice versa.
I suspect your problem is actually the path you are using to launch the application is running afoul of the WOW64 file system redirection. In this scheme, 32-bit applications that access C:\Windows\System32, are actually redirected to C:\Windows\SysWow64\System32. You can read about that more here
If that doesn't work, more information about how you are launching this 32-bit process and where it is located on the file system might add some clarity.
You need to execute the 32 bits version of hh.exe. To do this launch the hh.exe with this path %WINDIR%\System32\hh.exe but before launching the application you must disable the Wow64 file system redirection.
Here you have an example:
NOTE: Remember to revert the redirection after you call the application