• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Reading dll version in java or any other method.

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a dll called isapi_redirect.dll, I trying to see if there is any way in Java to read the Dll version for some validation?
Is there a work around or a hack to read the dll version?.
I Google it and did not find a direct way of doing it. There are third party tool that let you read the version..
Any suggestion? tryng to write a junit test.
Thanks




 
Marshal
Posts: 6341
1114
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to use JNI for that purpose.
There are some other APIs like JNative which can also be used.
 
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can run from Java a simple VBScript:

save an output of this script to a file and parse it.
Here is an example, it works on WIndows XP:
 
sam salo
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ireneusz the code worked for my dll just fine, you have saved me hours of work.
 
Sheriff
Posts: 21760
102
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ireneusz Kordal wrote:

I suggest you read When Runtime.exec() won't. Your code is prone to deadlock; the article explains why.

Also, instead of redirecting to a file and then read from that file, you can read from the process directly:
The call to p.waitFor() could probably be replaced by p.exitValue() because the process should have ended; after all, its input and error streams are both closed (no more data from the reader). Still, I prefer to use waitFor() just in case those streams get closed but the process still continues.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!