Shashank Date <sdate / everestkc.net> wrote: > Hi Martin, > > "Martin DeMello" <martindemello / yahoo.com> wrote in message > > > Is there a nice way under windows to determine if the user has > > ghostscript installed? > > Searching for the registry is one way to do it ... see attached > screen-shot of how it looks on my machine. Of course, you would > want to determine this programmatically, right? Hint: You will have > to require 'win32/registry.rb' Thanks, I'll dig into that. Is it guaranteed that ghostscript will make a registry entry when it's installed, do you know? I'm optimistic about this because cutepdf [http://www.acrosoftware.com/Products/CutePDF/writer.asp] says it'll autodetect a ghostscript installation; I just didn't know how it was done. > > Do I have to rely on his having it in his path? > > Well, path will tell you that gswin32.exe is available as a command > without requiring explicit full path-name. It does not prove the > existence (or lack thereof) of the software. I don't get this bit. What I meant was, need a solution depend on gs being in the path, and test directly if I can run ps2pdf or if it returns an error. > > martin > > HTH, > -- shanko > PS> I am curious to know how your postscript generation is coming > along .. are you also generating PDFs? Coming along very nicely, and yes, it's doing pdfs too (once I figured out I had to call "ps2pdf.bat" rather than "p2spdf"). Right now it relies on the fact that both ps2pdf.bat and gswin32.exe are in my path, which from the point of view of a non-techie user is suboptimal; I'm looking into autodetecting the ghostscript install and adding it to ENV['PATH'] before calling system(). You can see the code and sample output at http://zem.novylen.net/ruby martin