;=# ; ; DirectX Custom Code (1/07/2018) ; Written by daemon.devin (daemon.devin@gmail.com) ; ; Checks for a local copy of a DirectX DLL and if not found, registers the DLLs in the portable CommonFiles folder. ; ; Dependancies ; DirectX Portable Plugins ; x86 - https://www.upload.ee/files/7730916/DirectX_Runtime_Portable_Plugin_June_2010_x86.paf.exe.html ; x64 - https://www.upload.ee/files/7730915/DirectX_Runtime_Portable_Plugin_June_2010_x64.paf.exe.html ; !ifndef REGSVR !define REGSVR `$SYSDIR\regsvr32.exe` !endif ${SegmentFile} Var PortableAppsCommonFiles ${SegmentPrePrimary} StrCpy $PortableAppsCommonFiles "$PortableAppsDirectory\CommonFiles" ${If} $Bits = 64 FindFirst $0 $1 "$PortableAppsCommonFiles\DirectX64\bin\*.dll" ${DoUntil} $1 == "" System::Call "kernel32::Wow64EnableWow64FsRedirection(i0)" ${IfNot} ${FileExists} "$SYSDIR\$1" ExecDos::Exec /TOSTACK /DISABLEFSR `"${REGSVR}" /s "$PortableAppsCommonFiles\DirectX64\bin\$1"` "" "" ${EndIf} System::Call "kernel32::Wow64EnableWow64FsRedirection(i1)" FindNext $0 $1 ${Loop} FindClose $0 ${EndIf} FindFirst $0 $1 "$PortableAppsCommonFiles\DirectX\bin\*.dll" ${DoUntil} $1 == "" ${IfNot} ${FileExists} "$SYSDIR\$1" ExecDos::Exec /TOSTACK `"${REGSVR}" /s "$PortableAppsCommonFiles\DirectX\bin\$1"` "" "" ${EndIf} FindNext $0 $1 ${Loop} FindClose $0 !macroend ${SegmentPostPrimary} ${If} $Bits = 64 FindFirst $0 $1 "$PortableAppsCommonFiles\DirectX64\bin\*.dll" ${DoUntil} $1 == "" System::Call "kernel32::Wow64EnableWow64FsRedirection(i0)" ${IfNot} ${FileExists} "$SYSDIR\$1" ExecDos::Exec /TOSTACK /DISABLEFSR `"${REGSVR}" /s /u "$PortableAppsCommonFiles\DirectX64\bin\$1"` "" "" ${EndIf} System::Call "kernel32::Wow64EnableWow64FsRedirection(i1)" FindNext $0 $1 ${Loop} FindClose $0 ${EndIf} FindFirst $0 $1 "$PortableAppsCommonFiles\DirectX\bin\*.dll" ${DoUntil} $1 == "" ${IfNot} ${FileExists} "$SYSDIR\$1" ExecDos::Exec /TOSTACK `"${REGSVR}" /s /u "$PortableAppsCommonFiles\DirectX\bin\$1"` "" "" ${EndIf} FindNext $0 $1 ${Loop} FindClose $0 !macroend