Bug 691725 - Requested change to windows gssetgs.bat
Summary: Requested change to windows gssetgs.bat
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Config/Install (show other bugs)
Version: 9.00
Hardware: PC Windows 7
: P4 enhancement
Assignee: Robin Watts
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-27 04:18 UTC by Marcos H. Woehrmann
Modified: 2018-09-06 12:24 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
gssetgs.bat (435 bytes, text/plain)
2010-11-04 17:38 UTC, Robin Watts
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2010-10-27 04:18:13 UTC
A user requests (I don't understand what %~dpo.. means but presumably someone with Windows knowledge will):

I'd like to point to a tiny improvement in win-version (at least)
File gssetgs.bat in "lib" directory sets paths to GS binaries.
I's better to do this like
if %GS%/==/ set GS=%~dp0..\bin\gswin32.exe
if %GSC%/==/ set GSC=%~dp0..\bin\gswin32c.exe
than just
if %GS%/==/ set GS=gswin32
if %GSC%/==/ set GSC=gswin32c
in current distribution

I've installed a printer throw ghostpdf.inf, but it is not PDF one, but PS.
I use ps2pdf.bat (the way I've found gssetgs issue), but it will be
far more convenient to get PDF file directly.
I have no sufficient skills to make necessary changes to inf-file (or
ppd one?), can you improve printer installation part? Or give me,
please, more-or-less direct help to find solution myself.
Comment 1 Robin Watts 2010-11-04 17:38:47 UTC
Created attachment 6867 [details]
gssetgs.bat

Mr Google suggests that %~dp0 expands in a batch file to the drive and path of the batchfile. (So in C:\some\path\batch.bat %~dp0 will expand to C:\some\path\)

The proposed change would therefore allow people to run:

  C:\whatever\path\gs\lib\gssetgs.bat

and have GS and GSC set up to point to the versions of ghostscript in C:\whatever\path\gs\bin\ without that directory needing to be on the path.

This is a good thing for people that haven't got gs on their path, but a bad thing for those that have - it prevents users copying that batch file to somewhere else on the harddrive.

I attach an updated script here for comments; this version will set GS and GSC to point to the ones in %~dp0..\bin\ if they exist. If not, it reverts to the old mechanism and uses the ones on the path.

Any refinements/comments welcome.
Comment 2 Robin Watts 2010-11-04 17:43:56 UTC
As to the second part of the bug report:

> I've installed a printer throw ghostpdf.inf, but it is not PDF one, but PS.
> I use ps2pdf.bat (the way I've found gssetgs issue), but it will be
> far more convenient to get PDF file directly.
> I have no sufficient skills to make necessary changes to inf-file (or
> ppd one?), can you improve printer installation part? Or give me,
> please, more-or-less direct help to find solution myself.

I have no experience of this myself, but 2 people have told me that this (creating a virtual printer that creates PDF files) cannot be achieved directly using ghostscript and a ppd.

The way to achieve this is apparently to use RedMon port monitor. Google suggests that: http://pages.cs.wisc.edu/~ghost/redmon/ is a good place to look.
Comment 3 Ken Sharp 2010-11-05 08:09:39 UTC
(In reply to comment #2)

> I have no experience of this myself, but 2 people have told me that this
> (creating a virtual printer that creates PDF files) cannot be achieved directly
> using ghostscript and a ppd.
> 
> The way to achieve this is apparently to use RedMon port monitor. Google
> suggests that: http://pages.cs.wisc.edu/~ghost/redmon/ is a good place to look.

Or, more simply, use something like Primo PDF:

http://www.primopdf.com/index.aspx

If I remember correctly we like Primo because they are an actual customer, instead of selling a front end which requires Ghostscript to be downloaded separately in order to avoid commercial licensing.
Comment 4 Robin Watts 2018-09-06 12:24:24 UTC
I find it hard to believe that anyone really cares at this point, but to get this bug off my list...

Fixed in:

commit bc1d2d9742c960f1d4905f43810be072c5d92390
Author: Robin Watts <robin.watts@artifex.com>
Date:   Mon Jul 9 11:15:00 2018 +0100

    Bug 691725: Tweak gssetgs*.bat files.

    The existing scripts assume that the gs binaries are on the path.
    The tweaked scripts check to see if there is a binary in the same
    directory as the .bat file, and if there is, use that in preference
    to any version on the path.

    Otherwise functionality is identical.