开发者

How do I make my gem place a .dll in a folder in the system PATH upon installation?

开发者 https://www.devze.com 2023-03-21 23:10 出处:网络
... and remove it upon un-i开发者_运维百科nstallation, of course. The issue is that other programs being called from my gem need to be able to find a certain file in the system PATH - setting the PAT

... and remove it upon un-i开发者_运维百科nstallation, of course.

The issue is that other programs being called from my gem need to be able to find a certain file in the system PATH - setting the PATH programatically doesn't work, as these programs are being called in a way that they get a fresh environment.

I tried including these .dll files as "executables" in the gemspec, but that only seems to get some symlink type files in the {ruby}/bin folder, which causes errors because the programs in question are expecting the actual .dll.

As it is, I just have a note in the README asking people to manually copy the .dll files to a folder in the PATH, but it seems like there should be a better way to do this.

Any help would be appreciated - thanks!


I guess the dll is a native lib required by a java class?

If so, you can just put it somewhere in the lib folder and call java.lang.System.load to load it before the java class is used. It doesn't have to be in system PATH this way.

0

精彩评论

暂无评论...
验证码 换一张
取 消