Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a processor architecture specific folder (ex x86) in order to get the fbembed.dll [DNET478] #467

Closed
firebird-automations opened this issue Jan 2, 2013 · 8 comments

Comments

@firebird-automations
Copy link

Submitted by: Greg (gregweb)

Relate to DNET402

Attachments:
Search Process Architecture Folder for Client Library.patch

Assemblies build with 'Any CPU' as the processor architecture may be run on both 32bit (x86) and 64bit (AMD64) environments however this may cause issues as the current Firebird http://ADO.NET provider only searches the root. To address this if the program could first search in a processor architecture folder for the fbembed.dll. You can use the PROCESSOR_ARCHITECTURE environmental variable to determine what architecture is used (http://msdn.microsoft.com/en-us/library/aa384274.aspx).

@firebird-automations
Copy link
Author

Commented by: Greg (gregweb)

Attached is a potential patch that will address this issue. If the client dll is not specified and fbembed.dll exists in the %PROCESSOR_ARCHITECTURE% sub folder it will be used. Otherwise will revert to previous behavior.

@firebird-automations
Copy link
Author

Modified by: Greg (gregweb)

Attachment: Search Process Architecture Folder for Client Library.patch [ 12274 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Link: This issue relate to DNET402 [ DNET402 ]

@firebird-automations
Copy link
Author

Commented by: Yiannis Bourkelis (yiannis)

I had also done a similar suggestion here: http://firebird.1100200.n4.nabble.com/Suggestion-Firebird-Net-Provider-should-be-able-to-load-x86-or-x64-DLLs-automatically-td2272784.html

Since NET Framework allows an assembly to recognize when running on x86 or x64 version of windows, the FirebirdSql.Data.FirebirdClient.dll could load the appropriate version of fbembed.dll, firebird.msg, icuuc30.dll etc for each platform.

This could be done if inside the application's folder is an XML file where we could enter the paths of the x86 and x64 versions of firebird DLLs. For example:

FirebirdSql.Data.FirebirdClient.Options.xml

<Platform>
<x86 Path="\x86" />
<x64 Path="\x64" />
</Platform>

The path could be absolute or relative.

So, if FirebirdSql.Data.FirebirdClient.dll is located in the folder:
C:\MyApp\
the appropriate version of fbembed.dll, firebird.msg, icuuc30.dll etc for each platform will be located in the folders:
C:\MyApp\x86
C:\MyApp\x64

That way we could build our applications as "Any CPU" which is simpler than providing two different versions of our applications for each platform.

@firebird-automations
Copy link
Author

Commented by: @cincuranet

I don't think the `PROCESSOR_ARCHITECTURE` is a good idea. For `64bit` it returns `AMD64`, which is correct, but most people would expect `x64`. And to make it worse, this variable might not be set on Linux/UNIX systems.

But. This leaves me wondering. What's wrong with using `ClientLibrary` parameter? One can use any path (s)he wants, and frankly I don't think it's that difficult, is it?

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-automations
Copy link
Author

Commented by: @cincuranet

Because this didn't get enough traction, I'm closing it. Feel free to comment so it can be reopened and reconsidered,

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: In Progress [ 3 ] => Closed [ 6 ]

resolution: Incomplete [ 4 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants