defacto installation guide DefStartUI Automatic Starting of Universal Interface Prepared by Alec Willis 26 November 2014 Version 1.1 DefUIStarter 1.2.docx, Copyright 2014 Defacto Solutions, Page 1 of 14
DOCUMENT HISTORY Author Alec Willis Document DefUIStarter 1.2.docx Version Dated Comments Requests Addressed 1.1 14/03/10 Initial specification Initial instructions 1.2 1.3 26/11/14 Updates from installation work Added notes on Sage 1000 registry settings and installation DefUIStarter 1.2.docx, Copyright 2014 Defacto Solutions, Page 2 of 14
CONTENTS DOCUMENT HISTORY... 2 1 BACKGROUND... 4 2 STARTING DEFACTO UNIVERSAL INTERFACE/DEFCAPTURE SCANNER FROM SAGE MENU 4 3 STARTING DEFACTO UNIVERSAL INTERFACE/DEFCAPTURE SCANNER AUTOMATICALLY... 4 4 INSTALLING DEFSTARTUI... 4 5 RUNNING DEFSTARTUI... 5 6 LAUNCHING TO A SCHEDULE... 6 7 LAUNCHING AT REBOOT... 7 8 OTHER NOTES... 7 8.1 INSTALLATION NOTES... 7 8.2 UI FAILURES... 8 8.3 SPECIAL NOTES FOR SAGE 1000 INSTALLATIONS... 8 8.4 EXAMPLE OF USING SCHEDULE TO RUN THE DEFSTARTUI... 9 DefUIStarter 1.2.docx, Copyright 2014 Defacto Solutions, Page 3 of 14
1 Background The Defacto Universal Interface relies upon a listener routine to detect commands directing the import of data. The routine must be started before the system becomes operational. The latest version of the scanner supports up to ten queues. One scanner is required for each queue which means multiple scanners must be started in the same way for multiple queue installations. When running DefCapture and Universal Interface, one queue must be started for DefCapture and one or more queues can be started for Universal Interface. 2 Starting Defacto Universal Interface/DefCapture Scanner from Sage Menu The Defacto Universal Interface and DefCapture installations provide menu options to start the scanner(s) manually. These can be used for ad hoc starting of the scanners. The Defacto Universal Interface and DefCapture installations also provide menu options to stop the scanner(s) manually. These options should be used for shutting down the scanner(s). 3 Starting Defacto Universal Interface/DefCapture Scanner Automatically In a production environment it is convenient to automate the start-up of the Defacto Universal Interface and DefCapture scanners. This can be done by installing an option pack from Defacto called DefStartUI. 4 Installing DefStartUI Copy the contents of the installation folder from the media to a suitable drive on the Sage Server and run setup.exe. The installation then takes place. DefUIStarter 1.2.docx, Copyright 2014 Defacto Solutions, Page 4 of 14
5 Running DefStartUI The tool is a command line (console) application which can be run from a Windows cmd prompt. The command syntax is as follows: DefStartUI DC UI PS <company> [LOGIN [<user>] [<password>] [machine] [port]] QUEUE [<queue> <timer>] The first argument must be DC or UI or PS 1. Choose UI to start a Universal Interface scanner; choose DC to start the DefCapture scanner; choose PS to start the DefCapture Printer scanner. Specify the company in which the scanner is to be started. This must the database name of the company on the Sage installation. DefStartUI can operate in two ways. It can start a scanner from scratch by creating a Sage client and entering login credentials or it can piggy back on an existing, logged, in Sage client. For a clean start-up including logging into the Sage Client, the LOGIN key word plus the four parameters must be supplied. These are User the Sage User under which the scanner should run. Password the password for this Sage User. If the password is blank (not recommended, specify a hypen ( - ). Machine the IP address or if using DNS, the machine name on which resides the Sage Server (We recommend that DefStartUI should be installed on the Sage Server so quoting an IPv4 home address of 127.0.0.1 works well and avoid DNS issues). Port The Sage port connection which by default is 38113 To piggy back on an existing Sage Client, do not supply the LOGIN key word or parameters. If starting a Universal Interface (first parameter is UI) it is possible to optionally specify the Queue number of cycle time by specifying the QUEUE key work and two parameters. The two parameters are Queue the queue code Interval the time between scans in seconds 1 There is also a deprecated option of FS which has the same behaviour has UI. DefUIStarter 1.2.docx, Copyright 2014 Defacto Solutions, Page 5 of 14
There are another set of options provided to simply stop a scanner. The first argument must be STOPDC or STOPUI or STOPPS. The other arguments are the same as described above. Choose STOPUI to stop a Universal Interface scanner; STOPDC to stop the DefCapture scanner; STOPPS to stop the DefCapture Printer scanner. 6 Launching to a Schedule With the command line option installed and available it becomes relatively straight forward to organize the routines to be launched according to a given schedule, for example every morning at 6am or when the machine is rebooted. The first step is to form one or more launch commands into a suitable batch file and save this batch file in the installation folder, for convenience. He is a sample batch file: @echo DefCapture Scanner Reset DefStartUI DC demo LOGIN manager pass123 127.0.0.1 38113 @echo Starting Universal Interface for RMS DefStartUI UI demo LOGIN manager pass123 127.0.0.1 38113 QUEUE 1 200 @echo Starting Universal Interface for SLX DefStartUI UI demo LOGIN manager pass123 127.0.0.1 38113 QUEUE 2 30 Save this file as c:\defstartui\startdefactoscanners.bat (for example) Next use the Windows Scheduler Service at to schedule the running of the new batch file, StartDefactoScanners.bat. It is again recommended that the schedule be created using a second batch file, so that after a machine reboot, the schedule can be automatically re-instated. Here is a sample scheduling batch file: @echo Creating Defacto Scanner Schedule : To start/re-start scanner every day at 6am at C c:\defstartui\startdefactoscanners.bat 0600 @echo Configuration is: at l Save this file as c:\defstartui\scheduledefactoscanners.bat (for example) Run this file and check that it reports back the scheduled entry: DefUIStarter 1.2.docx, Copyright 2014 Defacto Solutions, Page 6 of 14
Windows with then run the start-up script and start the three scanner options every morning at 6am. 7 Launching at Reboot When the Windows Server which supports Sage is rebooted, the Sage server is re-started and the Windows Scheduler Service (at) is initialized. It is therefore necessary to re-instate the schedule to re-start the scanners and also kick off the scanners. This is easily achieved as follows: Add to the Windows Start-up folder on the Server the two command files. The first to setup the Windows Scheduler Entries and the second to start the scanners as the machine comes up. Note there may be timing issues with machine start-up and trying to launch Sage before, for example, the SQL Server services are all up and running may fail. If this happens, copy the start-up batch script and create a special version for reboot, including a delay of, say, 5 minutes in the start-up script. @echo Starting DefCapture Scanner after System Reboot sleep 300 DefStartUI DC demo LOGIN manager pass123 127.0.0.1 38113 @echo Starting Universal Interface for RMS DefStartUI UI demo LOGIN manager pass123 127.0.0.1 38113 QUEUE 1 200 @echo Starting Universal Interface for SLX DefStartUI UI demo LOGIN manager pass123 127.0.0.1 38113 QUEUE 2 30 8 Other Notes 8.1 Installation Notes The Sage Client software must be installed on the server on to which DefStartUI is installed. The Sage System must include the following options and have the DefCapture and/or Universal Interface modules installed: DefUIStarter 1.2.docx, Copyright 2014 Defacto Solutions, Page 7 of 14
Option name Option Description Option command dc_processor DefCapture Scanner dcrun fs_control UI Scanner fscontrol fs_control_q1 UI Scanner Q1 fscontrol Q1 fs_control_q2 UI Scanner Q2 fscontrol Q2 fs_control_q3 UI Scanner Q3 fscontrol Q3 fs_control_q4 UI Scanner Q4 fscontrol Q4 fs_control_q5 UI Scanner Q5 fscontrol Q5 fs_control_q6 UI Scanner Q6 fscontrol Q6 fs_control_q7 UI Scanner Q7 fscontrol Q7 fs_control_q8 UI Scanner Q8 fscontrol Q8 fs_control_q9 UI Scanner Q9 fscontrol Q9 dc_print_spooler Print Scanner dcpcon 8.2 UI Failures If the Universal Interface fails through a data issue or program defect (unlikely once the system is bedded in) then the starter application may re-start the Interface but it may fail again. In any case, in this circumstance, as for any catastrophic failure such as this, investigation by support will be required. 8.3 Special Notes for Sage 1000 Installations For the Sage 1000 web client function and any windows account running the automation the following details need to be add for web client only. Run the installation called automation.exe from the sage CD. Do not run the installation (automation.exe) on the Sage server as this will break the Sage server installation! The registry keys can alternatively be created by hand: DefUIStarter 1.2.docx, Copyright 2014 Defacto Solutions, Page 8 of 14
This does not apply for Line 500 solutions. 8.4 Example of Using Schedule to Run the DefStartUI The Task Scheduler can be configured as follows using Control Panel - > Administrative Tools -> Scheduled Tasks: Task Panel: DefUIStarter 1.2.docx, Copyright 2014 Defacto Solutions, Page 9 of 14
Schedule Panel: Select Advanced Schedule Options: DefUIStarter 1.2.docx, Copyright 2014 Defacto Solutions, Page 10 of 14
Settings Panel: The script is also loaded in the Startup folder for All Users menu, so that whoever logs into the machine after a system reboot will run the script: The script stops the UI Service and re-starts it to check it is okay and leaves it running. Therefore, should the service be shut down over night or stopped by users, it will be restarted within four hours. When running the script will appear as follows: DefUIStarter 1.2.docx, Copyright 2014 Defacto Solutions, Page 11 of 14
IT Staff Operational Requirements After any reboot of the Sage Server, the MAIL\administrator user (or whatever the user is set to in the Task Scheduler must be logged into the Sage server. (The user who is logged in should be the user which is set in the scheduled task.) The console can be locked and left with the user running. The three Universal Interface services will be seen minimized at the bottom of the screen: DefUIStarter 1.2.docx, Copyright 2014 Defacto Solutions, Page 12 of 14
Any of these can be expanded and watched in which case you will see the time changing every two seconds: DefUIStarter 1.2.docx, Copyright 2014 Defacto Solutions, Page 13 of 14
If any of these stops with an error, the details must be reported to Defacto for investigation. Defacto will grab the debug log for the run and we will assist in debugging. If any of these stops they will be automatically restarted at the next two hourly interval, but this will generally be too long and the problem will become evident before that. Note that these routines should not ordinarily stop and run continuously without attention; therefore any failures needs to be reported to Defacto. DefUIStarter 1.2.docx, Copyright 2014 Defacto Solutions, Page 14 of 14