About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like
For this mechanism to work correctly the file twain_32.dll must be present in the Windows directory.
On Windows 2008 this dll should be copied from winsxs (side by side) to the windows directory as described in CTX123981.
On Windows 2003 the dll is already in the correct directory, however applications that are not Terminal Server Aware cannot find this dll because the Windows directory is redirected to the user profile. Citrix recommends copying twain_32.dll to each user’s profile directory but this will take up unnecessary space.
So what alternatives do we have?
Method 1: Adjust DllCharacteristics field in the executable
The afore mentioned link on MSDN lists a procedure to set the TSAWARE flag when compiling (linking) an executable. But when can also set this property on binary (.exe) files.
Start CFF Explorer and load the target executable, select Optional Header in the Treeview and change DllCharacteristics:
Now save and test the executable.
Method 2: Set Terminal Server Application Compatibility Flag:
This method has the advantage that it doesn’t need a modification to the executable. It does have to be set per server but you could easily do this with a deployment tool or script.
Open regedit and create a key with the executable name (without extension) under “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications“.
In this key we need to set a Flags value for “Do not substitute user Windows directory” and “Windows 32-bit application”. The values are documented in Microsoft kb186499 as 0x00000400 and 0x00000008 which we need to “OR”.
So we create a DWORD named Flags and give the HEX value 408.
Or use the following reg file (don’t forget to change the executable name!):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\APROIMAGING]
With both methods the twain_32.dll will correctly load from the Windows directory!
.NET .NET FrameWork Active Directory Altiris Apple Automation Manager Citrix Dell Delphi Excel Exchange Exchange2003 Exchange2010 Hack HP iOS Java LinkedIn Linux Lync MSI Office Office 2010 Passat Password PowerPoint PowerShell RES RNS510 SasLibEx SCOM Security Terminal Server ThinApp TSAdminEx VBS VCDS Visual Basic Visual Studio VMWare Volkswagen VW Windows PE Wordpress XenApp