Topic: Win7PE_SE 64 bit DLL Missing issue  (Read 2752 times)

Win7PE_SE 64 bit DLL Missing issue
« on: March 07, 2013, 11:43:51 AM »

anshad

  • Chef
  • ***
  • Date Registered: Apr 2012
  • Posts: 323
Hi ChrisR and JFX

I have an issue with 64 bit version of Win7PE SE in which i can't run a number of my tools due to missing DLLs. For example i have "HDtune Pro" in my build that requires "pdh.dll" to run. In my 32 bit build it works fine as i included "Require_FileQ,pdh.dll" in the process section of my script. That same script is used for building 64bit version and "pdh.dll" is actually present in the System32 directory of the 64 bit build. But if i open "HDtunePro" it will display a message which says it can't start due to pdh.dll is missing. It looks like 64 bit PE is looking for Dll inside Syswow64 instead of System32 :confused:

So far i tried both standard and full file copy but that didn't seems to help. Also i tried to copy pdh.dll to Syswow64 but i got a nice "exception 0000blahblah" message when opening hdtunePro.

Re: Win7PE_SE 64 bit DLL Missing issue
« Reply #1 on: March 07, 2013, 01:53:12 PM »

Aeolis

  • Chef
  • ***
  • Location: Rio de Janeiro, Brazil
  • Date Registered: Oct 2012
  • Posts: 134
Dear anshad,

In Windows 64-bit editions users have two folders System32 and SysWOW64 for Windows system files. Native 64-bit executables would usually search their dependencies under System32, but 32-bit executables running over Windows 64-bit systems would usually search their dependencies under SysWOW64. So, you have to require the right architecture of your dependencies. I have as a "personal policy" regarding dependencies to require both 64-bit and 32-bit under Windows 64-bit systems. But you can do as you wish. Below is an example of how I do that in my scripts:

Code: [Select]
[Variables]
%ProgramFolder%=
%ProgramEXE%=
%ProgramTitle%=
%DependenciesList%=pdh.dll,cmd.exe,sc.exe

[Process]
Echo,Processing %ProgramTitle%...
//These lines will require the necessary files.
StrFormat,SPLIT,%DependenciesList%,#$c,0,%Count%
Loop,%ScriptFile%,Process-Dependencies,1,%Count%
If,%SourceArch%,Equal,x64,Begin
  Set,%PluginArch%,x86
  StrFormat,SPLIT,%DependenciesList%,#$c,0,%Countx86x64%
  Loop,%ScriptFile%,Process-Dependenciesx86x64,1,%Countx86x64%
  Set,%PluginArch%,%SourceArch%
End
//This is the end of requiring files.

[Process-Dependencies]
StrFormat,SPLIT,%DependenciesList%,#$c,#c,%Dependency%
If,NOT,EXISTFILE,"%Target_Win%\System32\%Dependency%",Require_FileQ,%Dependency%

[Process-Dependenciesx86x64]
StrFormat,SPLIT,%DependenciesList%,#$c,#c,%Dependencyx86x64%
If,NOT,EXISTFILE,"%Target_Win%\SysWOW64\%Dependencyx86x64%",Require_FileQ,%Dependencyx86x64%

Best regards,

Aeolis
« Last Edit: March 07, 2013, 01:54:39 PM by Aeolis »

Re: Win7PE_SE 64 bit DLL Missing issue
« Reply #2 on: March 07, 2013, 02:15:04 PM »

anshad

  • Chef
  • ***
  • Date Registered: Apr 2012
  • Posts: 323
Hi Aeolis

Thanks for the info :smile: this is the first time i build a x64 PE. I will try the dependency example you provided.

 

Powered by EzPortal