ScriptX logotype
  • Getting started
  • Documentation
  • Samples
  • Pricing
Free Trial Downloads
  • Home
  • Getting started
  • Documentation
  • Samples
  • Pricing
Developers ›  Knowledge Bank ›  How To Guides ›  ScriptX.Services ›  Install ›  v1 ›  for Windows PC

Installing ScriptX.Services for Windows PC

ScriptX.Services for Windows PC requires
  •  Microsoft Windows Windows 10 (1803) or later on an Intel x64 (compatible) PC.
ScriptX.Services for Windows PC components:
  1. A self host web application server that provides the REST API to be called by clients to perform printing. The application is self configuring with the printers available to the PC and is implemented with .NET Core 6 as a self-contained application.

    Please note versions before 2.12 require .NET Framework 4.6 or later.

  2. The ScriptX Print Server - a COM based server (MeadCo ScriptX Broker/Host) that provides the pagination and printing facilities that is called by the REST API.

  3. Orchestrator. Pre v2.17 this component is optional but required/highly recommended if there may be multiple users concurrently signed in to Windows. From v2.17.0 onwards Orchestator is built-in to Script.Services for Windowsd PC but its use remains optional.

    Read about Orchestrator.

Installation and use

A single installer is available that will install both web server and print service and a default configuration that is suitable for most use-cases.

The default configuration has these key aspects:

  • The server listens on http://127.0.0.1:41191.

  • https: is supported if a certificate for localhost is available.

    Using Google Chrome 70, Edge 42 or later?

    Google Chrome 70 and Edge 42 and later on Windows 10 do not block communication between a secure internet site and an "insecure" server hosting on the local loopback address 127.0.0.1 (Firefox has now also stopped blocking communication). Because of this a certificate enabling https: is not necessarily required.

    Other/older browsers may block communication and so a certificate for localhost will be required when printing of content originating from a secure site.

  • Orchestrator listens on http://127.0.0.1:41190.

The default configuration can be customised on a per-user basis.

  1. Download the latest version (2.23.1) of ScriptX.Services for Windows PC:

  2. Run the downloaded installer.

    In order for the installers to run, you must be logged on to your computer as an Administrator.

ScriptX.Services for Windows PC is now available to any browser at any time.

Using Microsoft Edge or Google Chrome 92 or later?

Microsoft Edge and Google Chrome 92 and later on Windows 10 may by default block communication between an insecure origin site and server hosting on the local loopback address 127.0.0.1.

Because of this origin sites using ScriptX.Services for Windows PC to provide printing must be secure unless the feature is disabled (see //flags and search for "Block insecure private network requests").

Other/older browsers do not block communication.

Customising the configuration if required

As installled:

  • The server listens on http://127.0.0.1:41191.
  • https: is supported if a certificate for localhost is available; the server listens on the next port.
  • Orchestrator listens on http://127.0.0.1:41190.
  • Does not perform any diagnostic logging.

To view the configration in use navigate to the  server dashboard (this link assumes the default port works).

Each of these aspects can be changed by defining configuration values in the appsettings.json file.

This file should be edited/created in the user's local application data folder: 

C:\Users\[UserName]\AppData\Local\MeadCo\ScriptXServices

An empty appsettings.json file is simply this:


{
}

To configure the server, add sections as described below to between these top level braces {}, for example:


{
  "ServerHost": {
    "Endpoints": {
      "Http": {
        "Port": "45678"
      }
    }
  }
}

Please see the “Alternatives to set configuration” section below for alternatives to editing appsettings.json.

Standard Port Configuration

To configure the port used, create an appsettings.json file similar to this:


  "ServerHost": {
    "Endpoints": {
      "Http": {
        "Port": "45678"
      }
    }
  }

The value given to "Port" can be any value that is free on your systems.

Port conflicts

ScriptX.Services for Windows PC does not run as a system service, it runs per user.

From v2.15 onwards if the configured port is in use (by a concurrently logged in user) then the next available free port will be used (the port used is written to the appsettings.json file).

This will cause problems for client javascript which assumes that the port is always the same.

Orchestrator works around this issue by ensuring that the port it uses doesnt cause a conflict with concurrently signed in users. This means client javascript can assume the port is the same and use the Orchestrator API to determine the port for ScriptX.Services for Windows PC.

Configuring use of Built-in Orchestrator

The default port for Orchestrator is 41190. If this would cause a conflict with other software, to configure the port used, add a section to appsettings.json file similar to this:


{
  "Orchestrator": {
    "Endpoints": {
      "Http": {
        "Port": 40100
      }
    },
  }
}

Where Port is a port number that is not in use on the system

Configuring use of Orchestrator as a Service

Configure the use of Orchestorator as a Service as follows


{
  "Orchestrator": {
    "Endpoints": {
      "Service": {
        "Port": 40100
      }
    },
  },
}

Where Port is the port number in use by Orchestrator as a Service on your system.

And also:


{
  "ServerHost": {
    "OrchestratorKey": "[username]"
  }
}

The value of "OrchestratorKey" can be any string value but must be unique for each user. "[USERNAME]" can be included in the value and will be replaced by the active users name.

Support for https:

To support https a server certificate for localhost must be installed and recognised as valid by the browsers that are to be used. Such a certificate may already be installed, in which case it will be used.

If there is a port clash for https, then configure the port to be used by create an appsettings.json file similar to this:


  "ServerHost": {
    "Endpoints": {
      "Http": {
        "Port": "45678"
      },
      "Https": {
        "Port": "45679",
        "Certificate": {
          "Source": "localhost",
        }
      }
    }
  }

Enable logging assistance

Logging is available and configured in the same way as for all .NET Core applications with a section similar to this:


  "Logging": {
    "LogLevel": {
      "Default": "Debug",
      "System": "Information",
      "Microsoft": "Information"
    },
    "File": {
      "Name": "service.log"
    }
  }

ScriptX.Services for Windows PC enables logging to the Debug output stream. If you wish to log to a file, add a "File" section as shown above. If no path specification is given the file will be created in the folder:
C:\Users\[UserName]\AppData\Local\MeadCo.

Please note that for v2.15.4 and earlier log files were written to (if no path given):
C:\Users\[UserName]\AppData\Local\MeadCo\ScriptXServices.

The log file name will be as given in configuration during normal operation. If the application is being run to perform a shutdown during uninstall or upgrade the name will be prefixed with "Shutdown-"

For use cases where log files are written to a common location/file share "[USERNAME]" can be included in the file name and will be replaced by the active users name.

ScriptX.Services job control behaviour

Settings are available to tune ScriptX.Services for Windows PC processing of jobs and the job queue.

These settings are defined at the top level of the “appsettings.json” file, for example:


  "ServerHost": {
    "Endpoints": {
      "Http": {
        "Port": "45678"
      }
  }

  "EnsurePrintDefaultsPerJob": true

The following values are supported:
Name Default value Description
ForgetTimeout 120 Time (s) before a job is removed from memory cache after completion. Clients that request job status should have stopped enquiring for status before this timeout.
StaleTimeout 60 Time (s) before a job is removed from memory cache after failure or is considered abandoned - successfully completed a print to file but the file was not collected.
HungTimeout 300 Time (s) in which a job must complete or it will be considered to have entered a hung state and will be stopped and abandoned.
CacheDevices false

Controls whether to cache the details of printer devices available on the system.

If false then the list of available printers and printer settings are repeatedly requested with a consequent performance impact. However printer information will always reflect the status on the system (for example the current default printer).

If true the list of available printers and their settings are loaded on first request and on subsequent requests details are returned from the cache with a consequent performance improvement.

EnsurePrintDefaultsPerJob false

If true then the printer settings are reset to their (system) default values before applying the settings defined for the current job.

If false then printer settings for a job are continued from the previous job and updated with those settings defined for the current job.

ScriptX Server behaviour tuning

A number of settings are available to tune the behaviour of ScriptX Server (the print processor).

It is extremely rare for these values to need to be changed from their defaults.

Values can be defined in a section “ScriptXServer”. For example:


  "ScriptXServer": {
    "IgnoreSecurityIssues": true,
    "PrintHtmlLoadTime": 25,
  }

The following values are supported:
Name Default value Description
IgnoreSecurityIssues false Set true to work around a problem in the mshtml print engine where loading content to print from a secure (https) server on a local domain that is known to have a valid certificate fails.
AllowCertRevocationFailure false Set true if a local secure https server is using a certificate whose revocation cannot be checked (for example it does not have access to the internet).
LoadSnippetToPrintDelay 500 Time delay (ms) before re-trying a check that a document using the html:// psuedo protocol (i.e. a string - this applies to print page or print frame with ScriptX.Service) is ready to print (see also PrintHtmlLoadTime).
LoadHtmlToPrintDelay 500 Time delay (ms) before re-trying that a document loaded from a url is ready to print (see also PrintHtmlLoadTime).
PrintHtmlLoadTime 20 The number of attempts at re-trying a document is ready to print.
PrintStartWaitTime 500 Time to allow (ms) for the print template to initialise.
PrintInitTimeout 4000 Time (ms) to allow for the PrintHtmlServer browser to start and initialise. If this fails the error “Error initializing the MeadCo PrintHTML server, operation timed out.” will be reported.
ExtendedPrintStartWaitTime 40000 Time to allow (ms) for the print routine to complete passing of required print settings to the printer. If this value is too small the error “Print Template processing is still in progress.” will be reported.
SpoolerStartWaitTime 60000 Time to allow (ms) for initial pagination of the document to complete. If the job takes longer it is considered stalled and stopped.

Alternatives for setting configuration

An alternative to editing the user’s appsettings.json file is to use the environment settings.

This is useful to configure a setting for a user or for all users.

All values can be thought of as appearing in a hierarchy of section names leading to a value name. For example:


  "ServerHost": {
    "Endpoints": {
      "Http": {
        "Port": "45678"
      }
  }

The value “Port” can be written as ServerHost__Endpoints__Http__Port = “45678”.

The above can be used as an environment variable, by prefixing with “MEADCOSCRIPTX_”, either per user or for all users.

For example:

  1. Press Windows + R to open the Windows Run prompt.
  2. Type in sysdm.cpl and click OK.
  3. Open the Advanced tab and click on the ‘Environment Variables’ button.
  4. The Environment Variables window is divided into two sections. The sections display user-specific and system-wide environment variables. To add a variable, click the New… button under the appropriate section.
  5. Enter the variable name (e.g. ‘MEADCOSCRIPTX_ServerHost__Endpoints__Http__Port’) and value (e.g ‘45678’) in the New User Variable prompt and click OK.
Configuring logging with environment variables

Configuration of logging was discusssed above with the following example in appsettings.json:


  "Logging": {
    "LogLevel": {
      "Default": "Debug",
      "System": "Information",
      "Microsoft": "Information"
    },
    "File": {
      "Append": true,
      "Name": "service.log"
    }
  }

To configure with envionment variables:

Name Value
MEADCOSCRIPTX_Logging__LogLevel__Default Debug
MEADCOSCRIPTX_Logging__LogLevel__System Information
MEADCOSCRIPTX_Logging__LogLevel__Microsoft Information
MEADCOSCRIPTX_Logging__File__Append true
MEADCOSCRIPTX_Logging__File__Name service.log

Testing printing

See:

How to configure samples for use with ScriptX.Services for Windows PC.

Deployment of the evaluation license for your own testing and evaluation.

  • Knowledge Bank
  • 'How To' Guides
    • ScriptX.Services
      • Introduction
      • Getting started
      • Evaluate with modern code
      • Maintaining investment in current code
        • Stage 1: Adding UI
        • Stage 2: Printing with ScriptX.Services
        • Stage 3: Summary and review
        • Stage 4: Error reporting
        • Stage 5: Prompted printing
        • Stage 6: Preparing for advanced uses
        • Stage 7: WaitForSpoolingComplete
        • Stage 8: Recommendations for some common issues
      • Printing with the API
      • MeadCoScriptXJS Library
      • Installing ScriptX.Services
        • For Windows PC
        • For On Premise Devices hosted on Windows Server
        • For On Premise Devices hosted on Windows 10/11
        • Configure options For On Premise Devices
        • Cloud
      • Orchestrator
      • Debugging
      • License deployment
        • For Windows PC
        • For On Premise Devices
      • Samples
        • Configure for Windows PC
        • Configure for On Premise
        • Configure for Cloud
    • Security Manager
      • Deploying a license or revision
    • ScriptX.Add-on
      • Introduction
      • Installing ScriptX on client PCs
      • Basic printing with ScriptX
      • Advanced printing features
      • Backwards compatibility
      • How to check if ScriptX is installed
      • License deployment
      • Quick start with Visual Studio
        • ASP.NET MVC
        • ASP.NET Web Forms
      • Nuget Packages
        • MeadCoScriptXJS Library
        • Installer helpers
        • ASP.NET WebForms Controls
        • Helpers for ASP.NET MVC
      • Client-side printing samples
  • Technical Reference
    • ScriptX.Services
      • Web service API
        • Service Description
          • (GET)
        • Licensing
          • licensing (GET)
          • licensing (POST)
          • licensing/ping (GET)
        • Printer
          • settings (GET)
          • current (GET)
          • current (PUT)
          • connection (PUT)
          • connection (DELETE)
        • PrintHtml
          • settings (GET)
          • deviceinfo (GET)
          • htmlPrintDefaults (GET)
          • print (POST)
          • status (GET)
          • download (GET)
          • canceljob (PUT)
        • PrintPdf
          • print (POST)
          • status (GET)
          • download (GET)
        • PrintDirect
          • print (POST)
      • Orchestrator API
        • v1
          • GET
        • v2
          • PUT
          • GET
      • ScriptX.Services compatibility roadmap
    • Security Manager
      • How it works
      • License Expiry
      • Testing for a valid license
      • About the license file (.mlf)
        • LICENSE
        • APPLICENSE
        • TITLE
        • DOMAINS
        • DOMAIN
        • PERMISSION
      • API
        • Apply
        • License
        • result
        • validLicense
    • ScriptX.Add-on
      • factory
        • baseUrl
        • ComponentVersionString
        • IsUniqueIDAvailable
        • OnDocumentComplete
        • relativeUrl
        • ResetUniqueID
        • ScriptXVersion
        • SecurityManagerVersion
        • Shutdown
        • UniqueID
      • printing
        • AddPrinterConnection
        • BatchPrintPDF
        • BatchPrintPDFEx
        • bottomMargin
        • collate
        • copies
        • currentPrinter
        • DefaultPrinter
        • disableUI
        • duplex
        • duplex2
        • EnumJobs
        • EnumPrinters
        • footer
        • GetJobsCount
        • GetMarginMeasure
        • header
        • headerFooterFont
        • IsSpooling
        • IsTemplateSupported
        • leftMargin
        • onafterprint
        • onbeforeprint
        • onbeforeunload
        • onpagesetup
        • onuserpagesetup
        • onuserprint
        • onuserprintpreview
        • orientation
        • OwnQueue
        • pageHeight
        • PageSetup
        • pageWidth
        • paperSize
        • paperSource
        • paperSource2
        • portrait
        • Preview
        • Print
        • printBackground
        • printer
        • PrintHTML
        • PrintHTMLEx
        • PrintPDF
        • PrintSetup
        • printToFileName
        • RemovePrinterConnection
        • rightMargin
        • SetMarginMeasure
        • SetPageRange
        • SetPreviewZoom
        • SetPrintScale
        • Sleep
        • templateURL
        • topMargin
        • TotalPrintPages
        • unprintableBottom
        • unprintableLeft
        • unprintableRight
        • unprintableTop
        • WaitForSpoolingComplete
      • printerControl
        • attributes
        • Bins
        • Forms
        • isLocal
        • isNetwork
        • isShared
        • Jobs
        • location
        • name
        • Pause
        • port
        • Purge
        • Resume
        • serverName
        • shareName
        • status
      • Job
        • Delete
        • Pause
        • Restart
        • Resume
      • enhancedFormatting
        • allFooterHeight
        • allHeaderHeight
        • allPagesFooter
        • allPagesHeader
        • extraFirstFooterHeight
        • extraFirstPageFooter
        • firstFooterHeight
        • firstHeaderHeight
        • firstPageFooter
        • firstPageHeader
        • pageRange
        • printingPass
      • rawPrinting
        • printer
        • printDocument
        • printString
    • Change and history logs
    • Articles
      • v1.15.x ScriptX Client Library
      • Dialogs with ScriptX.Services
      • Accessing protected content
      • Long term servicing (LTS)
 
ScriptX logotype
Home Getting started Documentation Samples Contact us

© 2025 Mead & Co Limited.

Follow us:
LinkedIn   GitHub
X

Warning:

This ScriptX.Add-on sample can only be viewed using Internet Explorer.