部署 openSSL dll 的建议
我制作了一个使用 Indy 并需要 OpenSSL dll 的简单应用程序。
我不打算为它编写安装程序,所以我有 2 个选择:
1)通过将应用程序 exe + libeay32.dll + ssleay32.dll 复制到同一文件夹中来部署它
2)将 libeay32.dll 和 ssleay32.dll 放入exe 资源并将它们提取到程序启动时的应用程序路径(但这可能是一个问题,如果我在 windowsserver 2008 或 windows vista 上运行 exe,并且我使用 Program Files 文件夹进行“部署”),
您可以对这些发表评论吗技术或建议更好的方法?
I made a simple application that uses Indy and requires OpenSSL dlls.
I am not going to write an installer for it, so I have 2 options:
1) deploy it by copying the application exe + libeay32.dll + ssleay32.dll in the same folder
2) put libeay32.dll and ssleay32.dll in the exe resources and extract them to the applicationpath on program start (but this can may be a problem in case I am running the exe on a windowsserver 2008 or windows vista and I used the Program Files folder to "deploy")
Can you comment on those techinques or suggest a better approach?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以坚持使用选项 1) :D
或者,您可以使用数字 2 的变体,但将它们提取到应用程序数据路径:
并用于
指定从何处加载 dll
当然,说实话,这样更快写一个简单的安装程序!
编辑:
哦,是的,正如 UnixShadow 提到的,对 dll 进行哈希处理,这样您就可以确定您使用的是正确的文件!
You could stick with option 1) :D
Or, you could use a variation on number 2, but extract them to the application data path:
and use
to specify where to load dll's from
Of course, to be perfectly honest, it's quicker just to write a simple installer!
Edit:
Oh, and yes, as UnixShadow mentioned, hash the dll's so you can be sure that you're using the correct files!
方案3:使用Inno来安装!您可能有充分的理由不想使用安装程序,但如果您的原因是您认为它太昂贵(时间或金钱),您可以查看 Inno。我今年早些时候开始使用它,并对它的学习和使用如此简单感到惊讶。而且,它是免费的!
当然,学习 Inno 的附带好处是您将来可以将其用于其他项目......
Option 3: use Inno to install it! You may have a good reason for not wanting to use an installer, but in case your reason is you think it's too expensive (in time or money), you might check out Inno. I started using it earlier this year and was amazed at how easy it is to learn and use. And, it's free!
Of course the side benefit of learning Inno is that you'd have it available in the future for other projects...
根据应用程序的性质,您可以考虑使用 Lazarus 进行编译。
我知道,我知道,这是一个很长的过程,而且我不知道谁实际上用 openssl 完成了这个工作,所以这可能是太多的工作。我仍然想记录下这个理论解决方案。
这是因为 FPC/Lazarus 与 mingw 兼容,并且可以使用相同的(GNU 链接器),您可以尝试静态链接 mingw 库(.a's)。
过去有人尝试过它,我听说有人用 mysql 成功做到了这一点,但不幸的是他们没有提供细节。
所以我没有确凿的证据证明它有效,这使得它有点学术化。
Depending on the nature of the application, you could consider compiling it with Lazarus.
I know, I know, it is a far stretch, and I don't know sb who has actually done this with openssl, so it is probably too much work. Still I wanted to make a note of this theoretical solution.
This because FPC/Lazarus is mingw compatible, and can use the same (GNU linker), you could try to link mingw libs (.a's) statically.
Some people in the past have experimented with it, and I have heard people succeed in this with mysql, but unfortunately they didn't give details.
So I have no conclusive proof that it worked, which makes it a bit academical.
我会将它们安装在同一个文件夹中(选项 1),并在启动程序时对这两个 dll 进行实际 MD5 处理。尝试验证它们没有被修改。当涉及到安全性时,这并没有多大帮助,因为黑客可能会修改我要比较的 MD5 和。但它至少会阻止程序使用损坏的 dll。当然,这也会阻止在不更新主应用程序的情况下更新 dll 的可能性(无论好坏)。
I would install them in the same folder (option 1), with the addition to actually MD5 the two dlls when starting my program. To try to verify that they haven't been modified. This does not help a lot when it comes to security cause a hacker might as well modify my MD5 sum I would compare against. But it would at least stop the program from using corrupt dlls. Ofcourse this would also block out the possibility to update the dlls without updating the main application (on good an bad).