Projekt

Allgemein

Profil

RunLocal Flow » Historie » Revision 3

Revision 2 ([E] Rocco Kreutz, 06.08.2026 12:25) → Revision 3/9 ([E] Rocco Kreutz, 06.08.2026 12:29)

h1. RunLocal flow 

 This page documents the two ways RunLocal can be entered and what each side checks or starts. 

 *Remote* means the normal network installation of @ProdatERP.exe@. 
 *Local* means the copied installation under @C:\ProdatERP\@ with @Administration\RunLocal@ beside it. 

 {{drawio_attach(RunLocal_Flow.drawio)}} {{drawio(RunLocal_Flow.drawio)}} 

 h2. Short version 

 * The login dialog in the remote @ProdatERP.exe@ has the *RunLocal* button. 
 * That button starts @ProdatRunLocal.exe@ from the network installation with @SILENT_INSTALL_DEFAULT@. 
 * @ProdatRunLocal.exe@ checks whether it must self-update, then either runs the installer batch or the shortcut/update batch. 
 * The batch files create or refresh the local copy, the shortcuts, and the scheduled task. 
 * On later starts, @ProdatERP.exe@ can also verify that the local RunLocal copy is current and, if needed, switch into the local launcher. 

 h2. Entry points and behavior 

 |_. Side |_. Launch point |_. What is checked |_. What is initiated | 
 | Remote | Login dialog button in @ProdatERP.exe@ | Button is enabled only when the app is not already running from a local installation, unless dev/debug mode is active. | Launches @ProdatRunLocal.exe@ with @SILENT_INSTALL_DEFAULT@. | 
 | Remote | Startup path in @ProdatERP.exe@ | Checks whether RunLocal must be updated and whether the remote source is accessible. Compares marker data and the configured remote root. | If needed, copies the current @ProdatRunLocal.exe@ to the local RunLocal folder and starts the local launcher. | 
 | Remote or Local | @ProdatRunLocal.exe@ startup | Refuses to run from network/UNC without the silent-install parameter. Performs its own update check against the remote RunLocal copy. | Starts @RunLocal_Setup.bat@ for the initial install, or @RunLocal_ShortcutScript.bat@ for normal use. | 
 | Local | @RunLocal_Setup.bat@ | Reads or writes @RunLocal_SetCfgVariables.bat@, validates directories, and checks Robocopy availability. | Creates the local directory tree, syncs files, creates the task script, and creates shortcuts. | 
 | Local | @RunLocal_UpdateLocal.bat@ | Uses @Prodat.INSTALL.MARKER@ and the configured paths to decide the sync mode. | Mirrors remote to local, kills running @ProdatERP.exe@ instances, and optionally starts the local app again. | 

 h2. Remote login button flow 

 # User is in the remote installation and clicks *RunLocal* in the login dialog. 
 # The login dialog checks whether the current executable is local or remote. 
 # If the current executable is remote, the button is enabled and @ProdatRunLocal.exe@ is started with @SILENT_INSTALL_DEFAULT@. 
 # @ProdatRunLocal.exe@ then runs the setup batch and creates or refreshes the local installation. 

 h2. Startup update flow in ProdatERP.exe 

 # @ProdatERP.exe@ starts from either the network share or the local copy. 
 # The startup code checks whether it is running in the remote or local case. 
 # It reads the configured remote root from @RunLocal_SetCfgVariables.bat@. 
 # It checks accessibility with the safe-check helper. 
 # It compares @Prodat.INSTALL.MARKER@ content and timestamp between local and remote. 
 # If the local copy is outdated and the remote root matches the configuration, it copies the current @ProdatRunLocal.exe@ into the local RunLocal folder. 
 # It then launches the local @ProdatRunLocal.exe@ to continue the local flow. 

 h2. What the batch files do 

 * @RunLocal_Setup.bat@ 
 ** Writes @RunLocal_SetCfgVariables.bat@. 
 ** Creates the local @Administration\RunLocal@ structure. 
 ** Creates the shortcut helper script and the scheduled-task script. 
 ** Calls @RunLocal_UpdateLocal.bat SYNC@ to mirror the installation. 
 ** Creates the desktop shortcut and the local restart/update shortcut. 

 * @RunLocal_UpdateLocal.bat@ 
 ** Reads the config file. 
 ** Validates source and destination paths. 
 ** Runs Robocopy mirror operations. 
 ** Uses @Prodat.INSTALL.MARKER@ as a content/timestamp identity marker. 
 ** Restarts @ProdatERP.exe@ unless @DONTSTARTPRODAT@ was passed. 

 * @RunLocal_Setup_Task.bat@ 
 ** Creates or deletes the scheduled task @CIMPCS\ProdatERP - Run Lokal - Update@. 

 * @RunLocal_Setup_Shortcut.vbs@ 
 ** Creates or deletes the @.lnk@ files for the local restart and the desktop entry. 

 h2. Important files 

 * @PRODAT\Application\ProdatRunLocal\280\ProdatRunLocal.dpr@ 
 * @PRODAT\Application\ProdatRunLocal\USelfUpdate.pas@ 
 * @PRODAT\Prodat\Prodat-SQL\udbs.pas@ 
 * @PRODAT\Prodat\Prodat-SQL\UP2005Start.pas@ 
 * @ExternKomponenten\RUNTIME-Dirs\Administration\RunLocal\RunLocal_Setup.bat@ 
 * @ExternKomponenten\RUNTIME-Dirs\Administration\RunLocal\RunLocal_UpdateLocal.bat@ 
 * @ExternKomponenten\RUNTIME-Dirs\Administration\RunLocal\RunLocal_Setup_Task.bat@ 
 * @ExternKomponenten\RUNTIME-Dirs\Administration\RunLocal\RunLocal_Setup_Shortcut.vbs@