一个简单的问题

最近一直忙于缅甸大选的投票系统,做Windows客户端给缅甸的人民用。由于种种原因我们用SQLCipher做客户端的数据库,Golang做中间的数据层。
我们的SQLCipher的Golang驱动是通过SQLCipher和SQLite驱动修改来的,中间用了很多cgo的混合编码,其中就有著名的加密库OpenSSL。
编译好的exe文件直接执行的话会报missing libeay32.dll的错误。error
之前我们的做法是把编译后的libeay.ddl放到系统目录C:/windows/system32文件下,这个文件下的所有dll文件都是可以被任何应用共享的,问题自然就解决了。但是有一个问题是需要管理员确认才能将文件复制到该目录,所以我们就需要一个window installer去复制文件,其中还需要用户确认。现在我们的需求是解决这个问题,在这个项目之前我从来没有任何windows的经验,所有的经验都是以前用windows和google 来的。所以我搜索golang load dll go use static library等等,最后我才在这里找到了https://forum.qt.io/topic/17705/use-local-dll-instead-of-system32-s-dll

Windows searches for libraries in the following sequence:

The directory where the executable module for the current process is located.
 * The current directory.
 * The Windows system directory. 
 * The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
 * The directories listed in the PATH environment variable.

原来windows加载dll的优先级是
1.找可执行文件所在目录
2.找执行目录
3.GetSystemDirectory返回的目录
4.环境变量里面定义的路径

-)