<mxfile host="app.diagrams.net" agent="Codex">
  <diagram id="runlocal-flow-two-trees" name="RunLocal Two Trees">
    <mxGraphModel dx="2568" dy="1449" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="2200" pageHeight="1600" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />
        <mxCell id="10" parent="1" style="swimlane;startSize=28;rounded=1;whiteSpace=wrap;html=1;fillColor=#12385b;strokeColor=#8fb8ff;fontStyle=1;fontColor=#ffffff;" value="ProdatERP.exe" vertex="1">
          <mxGeometry height="1340" width="960" x="40" y="40" as="geometry" />
        </mxCell>
        <mxCell id="24" parent="10" style="rhombus;whiteSpace=wrap;html=1;fillColor=#365b8a;strokeColor=#9ec3ff;fontColor=#ffffff;" value="_LocalIsOutOfSync = False?" vertex="1">
          <mxGeometry height="100" width="250" x="360" y="1120" as="geometry" />
        </mxCell>
        <mxCell id="25" parent="10" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#6f6f6f;strokeColor=#d9d9d9;fontColor=#ffffff;" value="No out-of-sync&#xa;stay in local ProdatERP.exe&#xa;continue normal runtime" vertex="1">
          <mxGeometry height="80" width="335" x="70" y="1240" as="geometry" />
        </mxCell>
        <mxCell id="113" edge="1" parent="10" source="24" style="endArrow=block;html=1;rounded=0;strokeColor=#d9d9d9;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" target="25">
          <mxGeometry relative="1" as="geometry">
            <mxPoint x="240" y="1280" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="26" parent="10" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#a05a00;strokeColor=#ffd27a;fontColor=#ffffff;" value="_LocalIsOutOfSync = True&#xa;copy remote ProdatRunLocal.exe if needed&#xa;start local launcher" vertex="1">
          <mxGeometry height="80" width="335" x="600" y="1240" as="geometry" />
        </mxCell>
        <mxCell id="114" edge="1" parent="10" source="24" style="endArrow=block;html=1;rounded=0;strokeColor=#ffd27a;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;exitX=1;exitY=0.5;entryX=0.5;entryY=0;exitDx=0;exitDy=0;" target="26">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="23" parent="10" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#365b8a;strokeColor=#9ec3ff;fontColor=#ffffff;" value="_LocalIsOutOfSync()&#xa;compare Prodat.INSTALL.MARKER content and UTC time" vertex="1">
          <mxGeometry height="80" width="335" x="600" y="990" as="geometry" />
        </mxCell>
        <mxCell id="112" edge="1" parent="10" source="23" style="endArrow=block;html=1;rounded=0;strokeColor=#9ec3ff;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;" target="24">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="22" parent="10" style="rhombus;whiteSpace=wrap;html=1;fillColor=#365b8a;strokeColor=#9ec3ff;fontColor=#ffffff;" value="SafeCheck returns success?&#xa;remote path reachable and marker readable" vertex="1">
          <mxGeometry height="120" width="335" x="600" y="840" as="geometry" />
        </mxCell>
        <mxCell id="111" edge="1" parent="10" source="22" style="endArrow=block;html=1;rounded=0;strokeColor=#9ec3ff;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;" target="23">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="21" parent="10" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#0b4f5f;strokeColor=#87d9ea;fontColor=#ffffff;" value="Read RunLocal_SetCfgVariables.bat&#xa;VarCfg_RemoteDir := ..." vertex="1">
          <mxGeometry height="80" width="335" x="600" y="680" as="geometry" />
        </mxCell>
        <mxCell id="110" edge="1" parent="10" source="21" style="endArrow=block;html=1;rounded=0;strokeColor=#9ec3ff;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;" target="22">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="18" parent="10" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#173d20;strokeColor=#8fd18f;fontColor=#ffffff;" value="Local state&#xa;FormShow continues in local ProdatERP.exe" vertex="1">
          <mxGeometry height="80" width="335" x="600" y="440" as="geometry" />
        </mxCell>
        <mxCell id="15" parent="10" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#2f6f3e;strokeColor=#9fe3a7;fontColor=#ffffff;" value="Remote state&#xa;BtRunLocal.Enabled = True&#xa;ShellExecute(ProdatRunLocal.exe, SILENT_INSTALL_DEFAULT)" vertex="1">
          <mxGeometry height="80" width="335" x="30" y="440" as="geometry" />
        </mxCell>
        <mxCell id="16" parent="10" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#3f7f4b;strokeColor=#b6efbf;fontColor=#ffffff;" value="RunLocal clicked&#xa;start ProdatRunLocal.exe with SILENT_INSTALL_DEFAULT" vertex="1">
          <mxGeometry height="80" width="335" x="30" y="560" as="geometry" />
        </mxCell>
        <mxCell id="105" edge="1" parent="10" source="15" style="endArrow=block;html=1;rounded=0;strokeColor=#9fe3a7;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;" target="16">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="19" parent="10" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#215c2b;strokeColor=#a7e6b2;fontColor=#ffffff;" value="_FirstRealRun = True?&#xa;then CheckAndUpdateProdatRunLocal()" vertex="1">
          <mxGeometry height="80" width="335" x="600" y="560" as="geometry" />
        </mxCell>
        <mxCell id="108" edge="1" parent="10" source="18" style="endArrow=block;html=1;rounded=0;strokeColor=#8fd18f;strokeWidth=3;jettySize=auto;" target="19">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="109" edge="1" parent="10" source="19" style="endArrow=block;html=1;rounded=0;strokeColor=#87d9ea;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;" target="21">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="17" parent="10" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#6a4c93;strokeColor=#c9a6ff;fontColor=#ffffff;" value="ProdatERP tree ends here&#xa;control switches to ProdatRunLocal.exe" vertex="1">
          <mxGeometry height="80" width="335" x="30" y="680" as="geometry" />
        </mxCell>
        <mxCell id="106" edge="1" parent="10" source="16" style="endArrow=block;html=1;rounded=0;strokeColor=#b6efbf;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;" target="17">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="13" parent="10" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#2f6f3e;strokeColor=#9fe3a7;fontColor=#ffffff;" value="Login dialog shown" vertex="1">
          <mxGeometry height="80" width="335" x="292.5" y="215" as="geometry" />
        </mxCell>
        <mxCell id="14" parent="10" style="rhombus;whiteSpace=wrap;html=1;fillColor=#365b8a;strokeColor=#9ec3ff;fontColor=#ffffff;" value="BtRunLocal.Enabled := (IsDevOrDbg or not IsLocal)?" vertex="1">
          <mxGeometry height="100" width="420" x="250" y="320" as="geometry" />
        </mxCell>
        <mxCell id="102" edge="1" parent="10" source="13" style="endArrow=block;html=1;rounded=0;strokeColor=#9fe3a7;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;" target="14">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="103" edge="1" parent="10" source="14" style="endArrow=block;html=1;rounded=0;strokeColor=#9ec3ff;strokeWidth=2;jettySize=auto;exitX=0;exitY=0.5;entryX=0.5;entryY=0;edgeStyle=orthogonalEdgeStyle;entryDx=0;entryDy=0;libavoidRouting=1;exitDx=0;exitDy=0;" target="15">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="197.5" y="370" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="104" edge="1" parent="10" source="14" style="endArrow=block;html=1;rounded=0;strokeColor=#9ec3ff;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;exitX=1;exitY=0.5;entryX=0.5;entryY=0;exitDx=0;exitDy=0;entryDx=0;entryDy=0;" target="18">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="12" parent="10" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#1f4e79;strokeColor=#8fb8ff;fontColor=#ffffff;" value="ProdatERP.exe starts" vertex="1">
          <mxGeometry height="60" width="335" x="292.5" y="128" as="geometry" />
        </mxCell>
        <mxCell id="101" edge="1" parent="10" source="12" style="endArrow=block;html=1;rounded=0;strokeColor=#8fb8ff;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;" target="13">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="20" parent="1" style="swimlane;startSize=28;rounded=1;whiteSpace=wrap;html=1;fillColor=#2b1f49;strokeColor=#c9a6ff;fontStyle=1;fontColor=#ffffff;" value="ProdatRunLocal.exe" vertex="1">
          <mxGeometry height="1340" width="1020" x="1120" y="40" as="geometry" />
        </mxCell>
        <mxCell id="30" parent="20" style="ellipse;whiteSpace=wrap;html=1;fillColor=#1f1f1f;strokeColor=#ffffff;fontColor=#ffffff;" value="Start" vertex="1">
          <mxGeometry height="50" width="120" x="490" y="50" as="geometry" />
        </mxCell>
        <mxCell id="42" parent="20" style="ellipse;whiteSpace=wrap;html=1;fillColor=#1f1f1f;strokeColor=#ffffff;fontColor=#ffffff;" value="Update + relaunch complete" vertex="1">
          <mxGeometry height="50" width="130" x="423" y="1160" as="geometry" />
        </mxCell>
        <mxCell id="39" parent="20" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#215c2b;strokeColor=#a7e6b2;fontColor=#ffffff;" value="RunLocal_Setup.bat&#xa;write cfg, create folders, task, shortcuts, sync local" vertex="1">
          <mxGeometry height="80" width="335" x="20" y="1090" as="geometry" />
        </mxCell>
        <mxCell id="126" edge="1" parent="20" source="39" style="endArrow=block;html=1;rounded=0;strokeColor=#8fd18f;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;" target="42">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="40" parent="20" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#215c2b;strokeColor=#a7e6b2;fontColor=#ffffff;" value="RunLocal_ShortcutScript.bat&#xa;update local copy and start ProdatERP.exe" vertex="1">
          <mxGeometry height="80" width="335" x="620" y="1090" as="geometry" />
        </mxCell>
        <mxCell id="127" edge="1" parent="20" source="40" style="endArrow=block;html=1;rounded=0;strokeColor=#8fd18f;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;" target="42">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="37" parent="20" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#a66a00;strokeColor=#ffd27a;fontColor=#ffffff;" value="Copy remote ProdatRunLocal.exe&#xa;to local _update.exe" vertex="1">
          <mxGeometry height="80" width="335" x="40" y="710" as="geometry" />
        </mxCell>
        <mxCell id="129" parent="20" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#a66a00;strokeColor=#ffd27a;fontColor=#ffffff;" value="Launch local _update.exe" vertex="1">
          <mxGeometry height="80" width="335" x="40" y="820" as="geometry" />
        </mxCell>
        <mxCell id="130" edge="1" parent="20" source="37" style="endArrow=block;html=1;rounded=0;strokeColor=#ffd27a;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="129">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="131" edge="1" parent="20" source="129" style="endArrow=block;html=1;rounded=0;strokeColor=#ffd27a;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;exitX=0.5;exitY=1;entryX=0;entryY=1;entryDx=0;entryDy=0;" target="30">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="207.5" y="916" />
              <mxPoint x="20" y="916" />
              <mxPoint x="20" y="100" />
              <mxPoint x="507.63" y="100" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="38" parent="20" style="rhombus;whiteSpace=wrap;html=1;fillColor=#7f6d2b;strokeColor=#ffe59a;fontColor=#ffffff;" value="SILENT_INSTALL_DEFAULT present?" vertex="1">
          <mxGeometry height="90" width="350" x="570" y="705" as="geometry" />
        </mxCell>
        <mxCell id="124" edge="1" parent="20" source="38" style="endArrow=block;html=1;rounded=0;strokeColor=#a7e6b2;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;exitX=0;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" target="39">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="510" y="772.5" />
              <mxPoint x="510" y="1000" />
              <mxPoint x="187.5" y="1000" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="125" edge="1" parent="20" source="38" style="endArrow=block;html=1;rounded=0;strokeColor=#a7e6b2;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;exitX=1;exitY=1;exitDx=0;exitDy=0;" target="40">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="31" parent="20" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#6a4c93;strokeColor=#c9a6ff;fontColor=#ffffff;" value="ProdatRunLocal.exe starts" vertex="1">
          <mxGeometry height="80" width="335" x="378.75" y="120" as="geometry" />
        </mxCell>
        <mxCell id="115" edge="1" parent="20" source="30" style="endArrow=block;html=1;rounded=0;strokeColor=#ffffff;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;" target="31">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="32" parent="20" style="rhombus;whiteSpace=wrap;html=1;fillColor=#7b4ea3;strokeColor=#d5b4ff;fontColor=#ffffff;" value="IsNetShare(ParamStr(0)) and not SILENT_INSTALL_DEFAULT?" vertex="1">
          <mxGeometry height="80" width="327.5" x="382.5" y="230" as="geometry" />
        </mxCell>
        <mxCell id="116" edge="1" parent="20" source="31" style="endArrow=block;html=1;rounded=0;strokeColor=#c9a6ff;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;" target="32">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="33" parent="20" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#7a1f1f;strokeColor=#ff9f9f;fontColor=#ffffff;" value="Abort / error&#xa;must not start from network/UNC" vertex="1">
          <mxGeometry height="80" width="205" x="780" y="230" as="geometry" />
        </mxCell>
        <mxCell id="117" edge="1" parent="20" source="32" style="endArrow=block;html=1;rounded=0;strokeColor=#ff9f9f;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="33">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="34" parent="20" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#8a5a00;strokeColor=#ffd27a;fontColor=#ffffff;" value="CheckAndPerformUpdate()" vertex="1">
          <mxGeometry height="80" width="335" x="378.75" y="340" as="geometry" />
        </mxCell>
        <mxCell id="118" edge="1" parent="20" source="32" style="endArrow=block;html=1;rounded=0;strokeColor=#d5b4ff;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="34">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="35" parent="20" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#8a5a00;strokeColor=#ffd27a;fontColor=#ffffff;" value="Read RunLocal_SetCfgVariables.bat&#xa;_RemoteDir := ...&#xa;build remote ProdatRunLocal.exe path" vertex="1">
          <mxGeometry height="80" width="335" x="378.75" y="450" as="geometry" />
        </mxCell>
        <mxCell id="119" edge="1" parent="20" source="34" style="endArrow=block;html=1;rounded=0;strokeColor=#ffd27a;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;" target="35">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="36" parent="20" style="rhombus;whiteSpace=wrap;html=1;fillColor=#a05a00;strokeColor=#ffd27a;fontColor=#ffffff;" value="Remote exe exists?&#xa;same size + same last write time?" vertex="1">
          <mxGeometry height="80" width="335" x="378.75" y="569" as="geometry" />
        </mxCell>
        <mxCell id="120" edge="1" parent="20" source="35" style="endArrow=block;html=1;rounded=0;strokeColor=#ffd27a;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;" target="36">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="121" edge="1" parent="20" source="36" style="endArrow=block;html=1;rounded=0;strokeColor=#ffd27a;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;exitX=0;exitY=0.5;entryX=0.5;entryY=0;exitDx=0;exitDy=0;" target="37">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="122" edge="1" parent="20" source="36" style="endArrow=block;html=1;rounded=0;strokeColor=#ffd27a;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;exitX=1;exitY=0.5;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" target="38">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="11" parent="1" style="ellipse;whiteSpace=wrap;html=1;fillColor=#1f1f1f;strokeColor=#ffffff;fontColor=#ffffff;" value="Start" vertex="1">
          <mxGeometry height="50" width="120" x="445" y="90" as="geometry" />
        </mxCell>
        <mxCell id="100" edge="1" parent="1" source="11" style="endArrow=block;html=1;rounded=0;strokeColor=#ffffff;strokeWidth=3;edgeStyle=orthogonalEdgeStyle;jettySize=auto;" target="12">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="cw6TSUVoAoMbiN0ARyBg-131" edge="1" parent="1" source="26" style="endArrow=block;html=1;rounded=0;strokeColor=#c9a6ff;strokeWidth=4;dashed=1;edgeStyle=orthogonalEdgeStyle;jettySize=auto;exitX=1;exitY=0.5;entryX=0;entryY=0;entryDx=0;entryDy=0;libavoidRouting=1;" target="30">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1058" y="1320" />
              <mxPoint x="1058" y="90" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="107" edge="1" parent="1" source="17" style="endArrow=block;html=1;rounded=0;strokeColor=#c9a6ff;strokeWidth=2;edgeStyle=orthogonalEdgeStyle;jettySize=auto;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" target="30">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="237.5" y="816" />
              <mxPoint x="1040" y="816" />
              <mxPoint x="1040" y="115" />
            </Array>
            <mxPoint x="210" y="824.93" as="sourcePoint" />
            <mxPoint x="1606.2451329675578" y="139.9966666666666" as="targetPoint" />
          </mxGeometry>
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
