[gs-bugs] [Bug 691440] New: Windows bat files use relative paths and write to non-temp dir

bugzilla-daemon at ghostscript.com bugzilla-daemon at ghostscript.com
Sat Jul 3 12:33:38 UTC 2010


           Summary: Windows bat files use relative paths and write to
                    non-temp dir
           Product: Ghostscript
           Version: 8.64
          Platform: PC
        OS/Version: Windows 7
            Status: NEW
          Severity: minor
          Priority: P4
         Component: Config/Install
        AssignedTo: support at artifex.com
        ReportedBy: bjornsdevnull at gmail.com
         QAContact: gs-bugs at ghostscript.com
   Estimated Hours: 0.0

The windows bat files e.g. ps2pdf.bat call other .bat files using paths
relative to the current script. This doesn't resolve correctly if e.g.
ps2pdf.bat is used in the windows explorer context menu (Right Click->open

To fix this, all calls from a bat file to other bat files or executables should
prepend the current scripts path to the call e.g. in ps2pdf14.bat, instead of:
call ps2pdfxx %1 %2
it should be
call "%~dp0ps2pdfxx" %1 %2

Secondly, when using the context menu, the working dir is set to the windows
system directory e.g. c:\windows\system. This is usually read only, so
temporary files that are created by GS fails (e.g. _.at and _.at2). To fix
this, I suggest prepending the windows temp dir in front of these files e.g.
instead of 
echo -dCompatibilityLevel#1.4 >_.at
it would be
echo -dCompatibilityLevel#1.4 >"%TEMP%\_.at"

I would be happy to submit a patch, but couldn't find the right CVS repository.

I've fixed this and tested it on my own machine.

Thanks for a great program.

Configure bugmail: http://bugs.ghostscript.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the gs-bugs mailing list