Advertisement
penright

Untitled

Oct 3rd, 2023
1,942
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 8.24 KB | None | 0 0
  1.    Sub FixIrisIni()
  2.  
  3.         'Old
  4.         'SERVICE5=OPOS Line Display,c:\iris\bin\OPOSLineDisplaye.exe disp1
  5.  
  6.         'new
  7.         'SERVICE5=OPOS Line Display,c:\iris\bin\OCS.exe disp1
  8.  
  9.  
  10.         DispThis("     FixIrisIni Started" & NewLine)
  11.         Dim IrisIni As New PrivateIniFile
  12.         Dim tmpServiceCount As Integer
  13.         Dim FirstDrive As Boolean
  14.         Dim DispServiceObject As String
  15.         FirstDrive = True
  16.         For xLoop_Register As Integer = 0 To PosMaint.RegisterInformations.Count - 1
  17.             Dim RegInfo As RegInfo = PosMaint.RegisterInformations(xLoop_Register)
  18.             DispServiceObject = "disp" & RegInfo.RegisterNumber.ToString
  19.             DispThis("        On Register " & RegInfo.RegisterNumber.ToString & NewLine)
  20.             IrisIni.SetFileName("c:\iris\reginfo\Reg" & RegInfo.RegisterNumber.ToString & "\ini\iris.ini")
  21.             DispThis("           Delete all services" & NewLine)
  22.             For xLoop_Service As Integer = 1 To 20
  23.                 IrisIni.DeleteKey("POSShell", "SERVICE" & xLoop_Service.ToString)
  24.             Next
  25.             tmpServiceCount = 0
  26.  
  27.             If RegInfo.ScannerType = eScannerType.PSC Then
  28.                 tmpServiceCount += 1
  29.                 DispThis("           Adding Service " & tmpServiceCount & " Scanner " & RegInfo.ScannerServiceObjectName & NewLine)
  30.                 IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "OPOS Scanner " & RegInfo.ScannerServiceObjectName & ",c:\iris\bin\OPOSScanner.exe " & RegInfo.ScannerServiceObjectName)
  31.                 tmpServiceCount += 1
  32.                 DispThis("           Adding Service " & tmpServiceCount & " OPOS Scale " & RegInfo.ScaleServiceObjectName & NewLine)
  33.                 IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "OPOS Scale " & RegInfo.ScaleServiceObjectName & " [P],c:\iris\bin\OPOSScale.exe " & RegInfo.ScaleServiceObjectName)
  34.             End If
  35.             If PosMaint.PrtExpoNumberRegNum = RegInfo.RegisterNumber Then
  36.                 tmpServiceCount += 1
  37.                 DispThis("           Adding Service " & tmpServiceCount & " prtrdev.exe grill1 " & NewLine)
  38.                 IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "Chit Printer,c:\iris\bin\prtrdev.exe grill1")
  39.             End If
  40.             tmpServiceCount += 1
  41.             DispThis("           Adding Service " & tmpServiceCount & " Pserve.exe " & NewLine)
  42.             IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "Print Server,c:\iris\bin\Pserve.exe")
  43.             If RegInfo.RegisterNumber = CIntNull(RegInfo.PrimaryPrinter) Then
  44.                 tmpServiceCount += 1
  45.                 DispThis("           Adding Service " & tmpServiceCount & " prtrdev.exe rcpt" & RegInfo.PrimaryPrinter & NewLine)
  46.                 IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "Print Device,c:\iris\bin\prtrdev.exe rcpt" & RegInfo.PrimaryPrinter)
  47.             End If
  48.             tmpServiceCount += 1
  49.             DispThis("           Adding Service " & tmpServiceCount & " timesrv.exe " & NewLine)
  50.             IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "Time Server,c:\iris\bin\timesrv.exe")
  51.             If Not RegInfo.IsDrive Then
  52.                 tmpServiceCount += 1
  53.                 DispThis("           Adding Service " & tmpServiceCount & " OCS.exe " & DispServiceObject & NewLine)
  54.                 IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "OPOS Line Display,c:\iris\bin\OCS.exe " & DispServiceObject)
  55.             End If
  56.             '=============  OPOS MSR STUFF ================
  57.             If RegInfo.HardwareType = eHardwareType.Panasonic Then
  58.                 tmpServiceCount += 1
  59.                 DispThis("           Adding Service " & tmpServiceCount & " OPOSMsr.exe -msr1 msr" & RegInfo.RegisterNumber & NewLine)
  60.                 IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "OPOS MSR,c:\iris\bin\OPOSMsr.exe -msr1 PanMSR" & RegInfo.RegisterNumber)
  61.             ElseIf RegInfo.HardwareType = eHardwareType.Par7700 Then
  62.                 tmpServiceCount += 1
  63.                 DispThis("           Adding Service " & tmpServiceCount & " OPOSMsr.exe -msr1 msr" & RegInfo.RegisterNumber & NewLine)
  64.                 IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "OPOS MSR,c:\iris\bin\OPOSMsr.exe -msr1 msr" & RegInfo.RegisterNumber)
  65.             ElseIf RegInfo.HardwareType = eHardwareType.TCx800 Then
  66.                 tmpServiceCount += 1
  67.                 DispThis("           Adding Service " & tmpServiceCount & " OPOSMsr.exe -msr1 msr" & RegInfo.RegisterNumber & NewLine)
  68.                 IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "OPOS MSR,c:\iris\bin\OPOSMsr.exe -msr1 TCxMSR" & RegInfo.RegisterNumber)
  69.             End If
  70.             '=======================================================
  71.  
  72.             ''=============  Run Watch for CPU Spike ================
  73.             'If IO.File.Exists("c:\recovery\bin\Find100PercentCPU.flg") Then
  74.             '    tmpServiceCount += 1
  75.             '    IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "Find100PercentCPU,C:\iris\bin\Find100PercentCPU.exe")
  76.             'End If
  77.             '=============  Kitchen Redundant only reg 2================
  78.  
  79.             If PosMaint.RedundantKitchen And RegInfo.RegisterNumber = 2 Then
  80.                 tmpServiceCount += 1
  81.                 DispThis("           Adding Service " & tmpServiceCount & " Redundant Kitchen" & NewLine)
  82.                 IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "Redundant Kitchen,C:\iris\bin\Kitchen.exe")
  83.             End If
  84.             '============================================
  85.  
  86.             '************************************************************
  87.             'Paul E. 7/12/2018
  88.             'The outside display (OCB) for Dual lane 1 will use the current POSMaintGUI "Out Side Dispaly Reg" register number
  89.             'Dual Lane 2 will be the configured Dual Lane 2 register
  90.             If (RegInfo.DefaultConcept = eDefaultConcept.SplitScreen OrElse RegInfo.DefaultConcept = eDefaultConcept.DualLane1) Then
  91.                 If PosMaint.OutSideDisplay1 = eOutSideDisplayType.SicomDigitalDisplay Or PosMaint.OutSideDisplay1 = eOutSideDisplayType.SicomOCU Then
  92.                     tmpServiceCount += 1
  93.                     DispThis("           Adding Service " & tmpServiceCount & " OCS.exe OCBDisp1" & NewLine)
  94.                     IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "Sicom OCU 1,c:\iris\bin\OCS.exe OCBDisp1")
  95.                 ElseIf PosMaint.OutSideDisplay1 = eOutSideDisplayType.AccuviewNG Then
  96.                     tmpServiceCount += 1
  97.                     DispThis("           Adding Service " & tmpServiceCount & " tddisp.exe OCBDisp1" & NewLine)
  98.                     IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "Out Side Display,c:\iris\bin\tddisp.exe OCBDisp1")
  99.                 End If
  100.             End If
  101.             If RegInfo.DefaultConcept = eDefaultConcept.DualLane2 Then
  102.                 If PosMaint.OutSideDisplay2 = eOutSideDisplayType.SicomDigitalDisplay Or PosMaint.OutSideDisplay2 = eOutSideDisplayType.SicomOCU Then
  103.                     tmpServiceCount += 1
  104.                     DispThis("           Adding Service " & tmpServiceCount & " OCS.exe OCBDisp2" & NewLine)
  105.                     IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "Sicom OCU 2,c:\iris\bin\OCS.exe OCBDisp2")
  106.                 ElseIf PosMaint.OutSideDisplay2 = eOutSideDisplayType.AccuviewNG Then
  107.                     tmpServiceCount += 1
  108.                     DispThis("           Adding Service " & tmpServiceCount & " tddisp.exe OCBDisp2" & NewLine)
  109.                     IrisIni.WriteString("POSShell", "SERVICE" & tmpServiceCount.ToString, "Out Side Display,c:\iris\bin\tddisp.exe OCBDisp2")
  110.                 End If
  111.             End If
  112.             '************************************************************
  113.             DispThis("           Service Count of " & tmpServiceCount & NewLine)
  114.             IrisIni.WriteInteger("POSShell", "SERVICE_COUNT", tmpServiceCount)
  115.             Sleep(10)
  116.             DispThis("        Finish Register " & xLoop_Register & NewLine)
  117.         Next
  118.         IrisIni = Nothing
  119.         DispThis("     FixIrisIni Finish" & NewLine)
  120.  
  121.     End Sub
  122.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement