Home › Forums › TWAIN Classic › location of mydriver.ds
- This topic has 9 replies, 3 voices, and was last updated 16 years, 9 months ago by gabe.
- AuthorPosts
Hello,
For the moment, the dll of my twain driver (renamed as mydriver.ds) is localized in C:/Windows/twain_32
I’d like to put it in another place. For example, in “D:/temp” folder. But if I do that, the Twain source manager don’t find it.
How can I move my .ds file, making sure that the source manager will find it?
Thank you in advance.
R.P.the closest thing i’ve heard of (and granted this isn’t going to very close) is a post titled “Multiple Scanners” where stoops (who was never heard from again after this post) said he could get multiple devices of the same type plugged in at the same time and was manipulating the registry to get it done. If there is a solution to what you’re trying to do, I think it is in that direction – otherwise I would say, no you need to have your driver under %windir%twain_32 like everybody else.
why would want to do this? (just curious)
Ok, thank you.
@gabe wrote:
why would want to do this? (just curious)
Because of stupid client specifications. 😥
(specifications are stupid, not the client… )well, sometimes i wonder…I wonder if your spec would allow you to put a really simple dll in %windir%twain_32 that uses loadlibrary to the other location where all of the logic resides (and are you asking about localization or location? – sounds like you’re asking about location.)
.
Yes, i’m talking about location. Sorry for my approximative english 😳
Actually, the specs allows me to put any files only in the folder in witch the all application will be installed, typically “C:/Program Files/TheApp”.
As I understand this requirement is a critical if your application works on VISTA because to copy anything to Windows folder on VISTA your application has to have administrative rights
yeah, but _everything_ that installs (setup.exe, *.msi, etc) requires admin rights in Vista if uac is enabled (or I misunderstood) (..again)
How does that change anything? The install goes thru with admin rights and the driver gets copied.I think you are wrong, installer (as any other program) can request administrative rights or doesnt request them for example if it just copy files to local folder. Also some application based on .NET are distributed using ClickOnce technology without msi and setup files and without administrative rights and working in partial trust environment. Imaging following case when administrator installed scanner with hardware and twain drivers after that user came and run application which just copy files and its own twain driver (for image processing for example) in local folder…
yeah, I could be wrong – It wouldn’t be the first or last time, but I’ve seen a aweful lot of threads complaining that you *always* get the uac popup in Vista for installs and I’ve seen a fair number of threads about troubles with uac doing the same thing for click once. But none of this is really the point (and I don’t mind being wrong or corrected) as the thread was about if or how to change the location of the ds files for twain, seems that we’ve rambled away from the question. Wonder if he ever got a workaround for the original question.
I had some half baked ideas about copying twain_32 into the app directory and loading that version, but I didn’t have time to check if that would work or if they were too many dependencys for it to be anything other than a poor|awkward solution.
reading thru the spec (again)(again) and this caught my eye on pg 110 of the twain2d.pdf:
Naming and Location
The DLL’s file name must end with a .DS extension. The Source Manager recursively searches
for your Source in the TWAIN sub-directory of the Windows directory (typically
C:WINDOWS on Windows 95/98, or C:WINNT on Windows NT). To reduce the chance for
naming collisions, each Source should create a sub-directory beneath TWAIN, giving it a name
relevant to their product. The Source DLLs are placed there. Supporting files may be placed
there as well, but since this is a system directory which may only be modifiable by the System
Administrator, Sources must not write any information into this directory after the installation.So this makes me wonder how clever the source manager is. Does it recursively search in the twain sub-directory (hardcoded to look under %windir% first) or is it maybe slightly less clever just searching recursively ‘twain_32 ‘ from the current directory…
Seems like this would be easy to test by copying %windir%twain_32.dll to the app directory, adding a subdirectory to the app directory named twain_32 and putting you ds in there and using loadlibrary pointing to the application specific twain_32.dll.
any takers?
.
- AuthorPosts