APTRA Advance NDC Support Script
APTRA Advance NDC Support Script
The UlWait command executes the UlyWaitCommand function, which waits for a specified time to ensure the appropriate system state is achieved before starting further applications. The command returns several values: 0 if the process started successfully, 1 if the process did not start within the timeout period, 2 if there was an error preventing the start, and 3 in the case of an error requiring a system reboot .
For Diebold systems, identified by the VendorName of 3, the script utilizes WMI services to query the state of "Diebold XFS". If it’s not running, it enters a loop to repeatedly check the status, pausing intermittently with a sleep command until the service is up. If the service is not running, it pauses for 20 seconds before rechecking, continuing until the service is found to be running .
The script configures registry keys by reading current settings using WScript.Shell and modifying or writing new keys as necessary. For instance, it checks for the NCRHWErrors value under the "NCR\Advance NDC" key in the registry. If specific conditions are met, such as identifying a vendor, it manipulates registry paths under HKEY_USERS to correspond to various XFS logic services" paths .
The script includes functionality to detect application freeze conditions by running an executable named NDCHangMonitor.exe as part of the StartApps.vbs sequence. If a freeze is detected, the script expects NDCHangMonitor.exe to identify the condition and presumably trigger an appropriate recovery action, although explicit recovery steps are not detailed in the provided source .
The script manages the startup of Advance NDC applications by utilizing the Fatal Exception Handler (FEH) to initiate the main application, ApplicationCore.exe. It sets the current directory to the Advance NDC path and calls the FEH to start this core application. This structured approach ensures that the core components are initialized consistently, with particular actions like calling ApplicationCore.exe being indirectly handled through FEH .
The script is structured to conditionally run NCR.APTRA.NDC.Monitor.exe upon successful runtime installation. The check is done against a custom environment variable "%MAPS_GLOBAL%"; if its expansion results in the same placeholder text, this implies that proper configurations have not been achieved. Uncommenting the respective script portion enables the monitor, making this step conditional upon successful prerequisite checks .
The script configures NCR's contactless reader by writing a registry value that disables the feature. This is done by setting the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\NCR\Advance NDC\ContactlessReader\NCRContactlessReader" to 0, which indicates that the contactless reader functionality is turned off .
The startapps.vbs script determines the correct program files path by checking if the environment variable "%ProgramFiles(x86)%" expands to "%ProgramFiles(x86)%" itself. If it does, the system is recognized as 32-bit, and it uses the "%ProgramFiles%" path. If not, indicating a 64-bit system, the script uses the path from "%ProgramFiles(x86)%" with an adjusted registry key path to "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node" instead of the standard software path .
The script differentiates vendor-specific commands using the VendorName read from the registry. For NCR vendors (Wincor), it attempts specific command executions. For other vendors, it checks if specific start commands are set in the registry under "spstartcommand" and then executes them, following which it pauses based on a value read from "spstartpause" before proceeding further .
The script employs multiple error-handling techniques to ensure stability, primarily using "On Error Resume Next". This directive prevents script execution from stopping following a runtime error. It allows the script to continue execution rather than aborting, with specific checks and logs for critical steps, such as when determining the UlWait command output, ensuring graceful failure handling and system recovery through scripted shutdowns if necessary .