Aktionen
Einrichtung "Prodat lokal starten"¶
- Inhaltsverzeichnis
- Einrichtung "Prodat lokal starten"
- Manuelles Setup / Installation
Config.Servers:¶
eintragen: (ganz oben als erstes)
[RunLocal]
AllowInstall=True

RunLocal¶
- RunLocal erlaubt aus dem (Prodat) Login-Dialog heraus eine "RunLocal Installation"
- AllowInstall:
- Sofern nicht innerhalb einer RDP-Session (Remote-Session)
- Sofern kein C:\ProdatERP existiert
- Sofern AllowInstall= True
- => Aktiviere Button
- ForceAllowInstall:
- Sofern ForceAllowInstall=True, aktiviere Button, egal welche anderen Umständer/Flags gesetzt sind
Sonderfall: zB auf RDP testen:
[RunLocal]
AllowInstall=True
--ForceAllowInstall=True
Herkunft ##16585 Video hier in Anhängen: > https://redmine.prodat-sql.de/attachments/23547
Hintergründe¶
Prodat über VPN oder bei langsamen WLan zu starten, dauert zu lange. Hintergrund ist, dass ~1GB an Bibliotheken geladen werden.
Standard-Installation
- Das Einrichtungs-Setup bietet 2 automatische Einrichtungen mit Standardwerten an
- Variante 1 Standard : benutzt die folgenden Werte für die Konfiguration und das lokale Verzeichnis und führt die einzelnen Menu-Optionen des Setup als 'Programm' aus
\\Server\ProdatShare\RunLocal_Setup.bat starten und 1 drücken
- lokales Verzeichnis: C:\ProdatERP\
- Programm: ProdatSQL.exe
- Parameter: <keine Parameter>
- Quelle: Verzeichniss der RunLocal_Setup.bat (ohne \Administration\RunLocal\) welche ausgeführt wird
- Variante 2 BDE : benutzt die folgenden Werte für die Konfiguration und das lokale Verzeichnis und führt die einzelnen Menu-Optionen des Setup als 'Programm' aus
\\Server\ProdatShare\RunLocal_Setup.bat starten und 2 drücken
- lokales Verzeichnis: C:\ProdatERP\
- Programm: ProdatSQL.exe
- Parameter: -REMEMBER_SERVER 1 -L -U "BDE" -M 11 -UniqueName PRODAT-BDE-UNIQUEHANDLE
- Quelle: Verzeichniss der RunLocal_Setup.bat (ohne \Administration\RunLocal\) welche ausgeführt wird
- Ausserdem können beide Standard-Installationen ohne Benutzer-Interaktion mittels Parameter ausgeführt werden:
\\Server\ProdatShare\RunLocal_Setup.bat SILENT_INSTALL_DEFAULT
\\Server\ProdatShare\RunLocal_Setup.bat SILENT_INSTALL_DEFAULTBDE
- Die Installation führt dabei eine Synchronisierung des lokalen Ordners mit dem Remote(Server)-Ordner aus !!!
- Lokale Dateien und Ordner welche nicht auf der Remote-Seite existieren, werden glöscht
- Nachfolgende Update ziehen nur noch neuere Dateien vom Server
- Variante 1 Standard : benutzt die folgenden Werte für die Konfiguration und das lokale Verzeichnis und führt die einzelnen Menu-Optionen des Setup als 'Programm' aus
\\Server\ProdatShare\RunLocal_Setup.batstarten und 1 drücken- lokales Verzeichnis: C:\ProdatERP\
- Programm: ProdatSQL.exe
- Parameter: <keine Parameter>
- Quelle: Verzeichniss der RunLocal_Setup.bat (ohne \Administration\RunLocal\) welche ausgeführt wird
- Variante 2 BDE : benutzt die folgenden Werte für die Konfiguration und das lokale Verzeichnis und führt die einzelnen Menu-Optionen des Setup als 'Programm' aus
\\Server\ProdatShare\RunLocal_Setup.batstarten und 2 drücken- lokales Verzeichnis: C:\ProdatERP\
- Programm: ProdatSQL.exe
- Parameter: -REMEMBER_SERVER 1 -L -U "BDE" -M 11 -UniqueName PRODAT-BDE-UNIQUEHANDLE
- Quelle: Verzeichniss der RunLocal_Setup.bat (ohne \Administration\RunLocal\) welche ausgeführt wird
\\Server\ProdatShare\RunLocal_Setup.bat SILENT_INSTALL_DEFAULT\\Server\ProdatShare\RunLocal_Setup.bat SILENT_INSTALL_DEFAULTBDE
- Lokale Dateien und Ordner welche nicht auf der Remote-Seite existieren, werden glöscht
- Nachfolgende Update ziehen nur noch neuere Dateien vom Server
Erläuterung
- Prodat wird aus einem zentralen Verzeichnis im Netzwerk in ein lokales Verzeichnis kopiert
- In diesem lokalen Verzeichnis wird eine Konfigurations-Datei angelegt (..\Administration\RunLocal\SetCfgVariables.bat) welche folgende Werte enthält
- Programm (Default ist ProdatSQL.exe)
- Parameter (Default ist -REMEMBER_SERVER:1)
- Quelle (Default ist der Pfad in dem RunLocal_Setup.bat liegt (ohne \Administration\RunLocal\), welches gestartet wird - diese und die anderen zugehörigen reinen Setup-Batch-Scripte sind von der Synchronisierung aussgeschlossen)
- Desweiteren werden eine Batch für das manuelle Aktualisieren mittels eines Shortcuts auf dem Desktop angelegt (..\Administration\RunLocal\RunLocal_Setup_Shortcut.bat)
- Sowie eine Batch welche mittels der Windows-Aufgabenverwaltung täglich um 23 Uhr gestartet wird - dieses ruft das Batch-Script für den Shortcut auf - Working-Path Problem beim Einrichten von Windows-Tasks mittels SCHTASKS.exe (..\Administration\RunLocal\RunLocal_WinTaskScript.bat)
- ProdatRunLocal.exe, welche das eigentliche Batch-Script startet
- Um zu vermeiden, dass Benutzer in der Lage sind das Batch-Script anzuhalten indem in das Console-Fenster geklickt wird


- Beide Batch-Scripte terminieren alle Programm-Instanzen, aktualisieren das lokale Prodat und starten das Programm neu
- Programm (Default ist ProdatSQL.exe)
- Parameter (Default ist -REMEMBER_SERVER:1)
- Quelle (Default ist der Pfad in dem RunLocal_Setup.bat liegt (ohne \Administration\RunLocal\), welches gestartet wird - diese und die anderen zugehörigen reinen Setup-Batch-Scripte sind von der Synchronisierung aussgeschlossen)
- Um zu vermeiden, dass Benutzer in der Lage sind das Batch-Script anzuhalten indem in das Console-Fenster geklickt wird


Updating Mechanics¶
`CheckAndUpdateProdatRunLocal` in ProdatERP.exe - behavior summary¶
- Detects whether Prodat is running from the local `C:\` installation or from the remote/location copy by checking `ParamStr(0)`.
- Reads the configured remote directory from `Administration\RunLocal_SetCfgVariables.bat` by parsing `SET VarCfg_RemoteDir=...`.
- Checks whether the remote marker file is accessible by calling `ProdatRunLocal_SafeCheck.exe`.
- If the remote marker cannot be reached, the method stops without updating anything.
- If it can be reached, the marker content is read as Base64 and also decoded for logging/debugging.
- Compares local and remote marker state.
- If the local marker file is missing, the local installation is treated as out of sync.
- If the local marker can be read, it compares:
- marker file content
- last-write timestamp
- If local and remote are already in sync, nothing is updated.
- If the local copy is out of sync:
- It first verifies that the configured remote path matches the location from which Prodat was actually started.
- If the paths do not match, it shows a confirmation message and cancels the update.
- If the paths match, it copies the remote `ProdatRunLocal.exe` to the local `ProdatRunLocal.exe` with retry logic.
- After the copy attempt, it starts the local sync binary via `ShellExecute`, using the binary’s own directory as working directory.
- The method is heavily logged at info/error/debug level for:
- execution mode detection
- resolved paths
- remote accessibility
- marker comparison results
- copy success/failure
- final exit
`ProdatRunLocal.exe` summary¶
- On startup it performs its own self-update check via `USelfUpdate.CheckAndPerformUpdate`.
- It compares local and remote `ProdatRunLocal.exe` by:
- file size
- last-write timestamp
- If local and remote are identical, nothing happens.
- If they differ:
- a `_update.exe` variant is written locally
- the updater starts the updated executable with the original command line
- the current process terminates after launching the new one
- There is also a special `_update.exe` startup mode:
- `_update.exe` replaces the original `.exe`
- then relaunches the original executable
- The startup splash screen triggers this update flow before starting the normal RunLocal command/script.
Manuelles Setup / Installation¶
Silent Install¶
- RunLocal_Setup.bat kann mit 2 Parametern gestartet werden, um eine non-user-interaktive Installation eine der beiden Standard-Installationen auszuführen
RunLocal_Setup.bat SILENT_INSTALL_DEFAULT- Führt die Batch aus, als ob der Benutzer
1im Menu gedrückt hätte und dannachx
- Führt die Batch aus, als ob der Benutzer
RunLocal_Setup.bat SILENT_INSTALL_DEFAULTBDE- Führt die Batch aus, als ob der Benutzer
2im Menu gedrückt hätte und dannachx
- Führt die Batch aus, als ob der Benutzer
Automatisierung (Standard 1)¶
- Mittels
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOncekann\\Server\ProdatShare\Administration\RunLocal\RunLocal_Setup.bat SILENT_INSTALL_DEFAULTaufgerufen werden, um auf der Maschine Prodat-RunLocal zu installieren - Der Shortcut zum starten wird auf dem Desktop des Benutzers angelegt, welcher das Setup tatsächlich ausführt
- Diesen Shortcut
Prodat Lokal - Aktualisieren und neustartenentweder auf den öffentlichen Desktop verschieben - Oder eigenen ShortCut im öffentlichen Desktop erstellen mit Ziel: 'C:\ProdatERP\Administration\RunLocal\ProdatRunLocal.exe'
- Diesen Shortcut
[RunLocal]
AllowInstall=False
Von [E] Rocco Kreutz vor 18 Tagen aktualisiert · 41 Revisionen


