105 Prodat Lokales Start Script (RunLocal) » Historie » Version 41
[E] Rocco Kreutz, 02.07.2026 16:05
| 1 | 3 | [E] Rocco Kreutz | h1. Einrichtung "Prodat lokal starten" |
|---|---|---|---|
| 2 | 1 | [X] Daniel S | |
| 3 | 5 | [X] Daniel S | {{toc}} |
| 4 | |||
| 5 | 39 | [X] Daniel S | h2. Config.Servers: |
| 6 | 30 | [X] Daniel S | |
| 7 | 39 | [X] Daniel S | eintragen: (ganz oben als erstes) |
| 8 | 35 | [X] Daniel S | |
| 9 | 36 | [X] Daniel S | <pre><code class="ini"> |
| 10 | 1 | [X] Daniel S | [RunLocal] |
| 11 | 35 | [X] Daniel S | AllowInstall=True |
| 12 | 36 | [X] Daniel S | </code></pre> |
| 13 | 30 | [X] Daniel S | |
| 14 | 32 | [X] Daniel S | !clipboard-202506050914-3ejh7.png! |
| 15 | 30 | [X] Daniel S | |
| 16 | 33 | [X] Daniel S | h2. RunLocal |
| 17 | |||
| 18 | * RunLocal erlaubt aus dem (Prodat) Login-Dialog heraus eine "RunLocal Installation" |
||
| 19 | ** {{collapse(Aufklappen) |
||
| 20 | !clipboard-202503251606-cwjr4.png! |
||
| 21 | |
||
| 22 | !clipboard-202503251630-0azh4.png! |
||
| 23 | |
||
| 24 | !clipboard-202503251630-k6yt1.png! |
||
| 25 | |
||
| 26 | }} |
||
| 27 | ** "Hilfe":https://redmine.prodat-sql.de/projects/prodat-v12-public/wiki/105_Prodat_Lokales_Start_Script_(RunLocal) |
||
| 28 | * AllowInstall: |
||
| 29 | ** Sofern nicht innerhalb einer RDP-Session (Remote-Session) |
||
| 30 | ** Sofern kein C:\ProdatERP existiert |
||
| 31 | ** Sofern AllowInstall= True |
||
| 32 | ** => Aktiviere Button |
||
| 33 | * ForceAllowInstall: |
||
| 34 | ** Sofern ForceAllowInstall=True, aktiviere Button, egal welche anderen Umständer/Flags gesetzt sind |
||
| 35 | |||
| 36 | 36 | [X] Daniel S | Sonderfall: zB auf RDP testen: |
| 37 | 33 | [X] Daniel S | <pre><code class="ini"> |
| 38 | [RunLocal] |
||
| 39 | 37 | [X] Daniel S | AllowInstall=True |
| 40 | 40 | [X] Daniel S | --ForceAllowInstall=True |
| 41 | 33 | [X] Daniel S | </code></pre> |
| 42 | |||
| 43 | 11 | [X] Daniel S | Herkunft ##16585 *Video* hier in Anhängen: > https://redmine.prodat-sql.de/attachments/23547 |
| 44 | 5 | [X] Daniel S | |
| 45 | h2. Hintergründe |
||
| 46 | |||
| 47 | 9 | [E] Rocco Kreutz | Prodat über VPN oder bei langsamen WLan zu starten, dauert zu lange. Hintergrund ist, dass ~1GB an Bibliotheken geladen werden. |
| 48 | 1 | [X] Daniel S | |
| 49 | 21 | [E] Rocco Kreutz | h3. Standard-Installation |
| 50 | 1 | [X] Daniel S | * Das Einrichtungs-Setup bietet 2 automatische Einrichtungen mit Standardwerten an |
| 51 | ** *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 |
||
| 52 | 27 | [E] Rocco Kreutz | *** @\\Server\ProdatShare\RunLocal_Setup.bat@ starten und 1 drücken |
| 53 | 1 | [X] Daniel S | *** lokales Verzeichnis: *C:\ProdatERP\* |
| 54 | *** Programm: *ProdatSQL.exe* |
||
| 55 | *** Parameter: <keine Parameter> |
||
| 56 | *** Quelle: Verzeichniss der RunLocal_Setup.bat (ohne \Administration\RunLocal\) welche ausgeführt wird |
||
| 57 | 21 | [E] Rocco Kreutz | ** 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 |
| 58 | 27 | [E] Rocco Kreutz | *** @\\Server\ProdatShare\RunLocal_Setup.bat@ starten und 2 drücken |
| 59 | 1 | [X] Daniel S | *** lokales Verzeichnis: *C:\ProdatERP\* |
| 60 | *** Programm: *ProdatSQL.exe* |
||
| 61 | *** Parameter: *-REMEMBER_SERVER 1 -L -U "BDE" -M 11 -UniqueName PRODAT-BDE-UNIQUEHANDLE* |
||
| 62 | *** Quelle: Verzeichniss der RunLocal_Setup.bat (ohne \Administration\RunLocal\) welche ausgeführt wird |
||
| 63 | 21 | [E] Rocco Kreutz | * Ausserdem können beide Standard-Installationen ohne Benutzer-Interaktion mittels Parameter ausgeführt werden: |
| 64 | ** @\\Server\ProdatShare\RunLocal_Setup.bat SILENT_INSTALL_DEFAULT@ |
||
| 65 | ** @\\Server\ProdatShare\RunLocal_Setup.bat SILENT_INSTALL_DEFAULTBDE@ |
||
| 66 | * Die Installation führt dabei eine *Synchronisierung* des lokalen Ordners mit dem Remote(Server)-Ordner aus !!! |
||
| 67 | ** Lokale Dateien und Ordner welche nicht auf der Remote-Seite existieren, werden glöscht |
||
| 68 | ** Nachfolgende Update ziehen nur noch neuere Dateien vom Server |
||
| 69 | |||
| 70 | h3. Erläuterung |
||
| 71 | * Prodat wird aus einem zentralen Verzeichnis im Netzwerk in ein lokales Verzeichnis kopiert |
||
| 72 | * In diesem lokalen Verzeichnis wird eine Konfigurations-Datei angelegt (..\Administration\RunLocal\SetCfgVariables.bat) welche folgende Werte enthält |
||
| 73 | ** Programm (Default ist ProdatSQL.exe) |
||
| 74 | ** Parameter (Default ist -REMEMBER_SERVER:1) |
||
| 75 | ** 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) |
||
| 76 | * Desweiteren werden eine Batch für das manuelle Aktualisieren mittels eines Shortcuts auf dem Desktop angelegt (..\Administration\RunLocal\RunLocal_Setup_Shortcut.bat) |
||
| 77 | * 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) |
||
| 78 | * ProdatRunLocal.exe, welche das eigentliche Batch-Script startet |
||
| 79 | 24 | [E] Rocco Kreutz | ** Um zu vermeiden, dass Benutzer in der Lage sind das Batch-Script anzuhalten indem in das Console-Fenster geklickt wird |
| 80 | 26 | [E] Rocco Kreutz | ** !clipboard-202503251641-u5n9c.png! |
| 81 | ** !clipboard-202503251641-erjh5.png! |
||
| 82 | 21 | [E] Rocco Kreutz | * Beide Batch-Scripte terminieren alle Programm-Instanzen, aktualisieren das lokale Prodat und starten das Programm neu |
| 83 | 9 | [E] Rocco Kreutz | |
| 84 | 41 | [E] Rocco Kreutz | |
| 85 | |||
| 86 | h3. Updating Mechanics |
||
| 87 | |||
| 88 | h4. `CheckAndUpdateProdatRunLocal` in ProdatERP.exe - behavior summary |
||
| 89 | |||
| 90 | * Detects whether Prodat is running from the local `C:\` installation or from the remote/location copy by checking `ParamStr(0)`. |
||
| 91 | * Reads the configured remote directory from `Administration\RunLocal_SetCfgVariables.bat` by parsing `SET VarCfg_RemoteDir=...`. |
||
| 92 | * Checks whether the remote marker file is accessible by calling `ProdatRunLocal_SafeCheck.exe`. |
||
| 93 | ** If the remote marker cannot be reached, the method stops without updating anything. |
||
| 94 | ** If it can be reached, the marker content is read as Base64 and also decoded for logging/debugging. |
||
| 95 | * Compares local and remote marker state. |
||
| 96 | ** If the local marker file is missing, the local installation is treated as out of sync. |
||
| 97 | ** If the local marker can be read, it compares: |
||
| 98 | *** marker file content |
||
| 99 | *** last-write timestamp |
||
| 100 | * If local and remote are already in sync, nothing is updated. |
||
| 101 | * If the local copy is out of sync: |
||
| 102 | ** It first verifies that the configured remote path matches the location from which Prodat was actually started. |
||
| 103 | ** If the paths do not match, it shows a confirmation message and cancels the update. |
||
| 104 | ** If the paths match, it copies the remote `ProdatRunLocal.exe` to the local `ProdatRunLocal.exe` with retry logic. |
||
| 105 | ** After the copy attempt, it starts the local sync binary via `ShellExecute`, using the binary’s own directory as working directory. |
||
| 106 | * The method is heavily logged at info/error/debug level for: |
||
| 107 | ** execution mode detection |
||
| 108 | ** resolved paths |
||
| 109 | ** remote accessibility |
||
| 110 | ** marker comparison results |
||
| 111 | ** copy success/failure |
||
| 112 | ** final exit |
||
| 113 | |||
| 114 | h4. `ProdatRunLocal.exe` summary |
||
| 115 | |||
| 116 | * On startup it performs its own self-update check via `USelfUpdate.CheckAndPerformUpdate`. |
||
| 117 | * It compares local and remote `ProdatRunLocal.exe` by: |
||
| 118 | ** file size |
||
| 119 | ** last-write timestamp |
||
| 120 | * If local and remote are identical, nothing happens. |
||
| 121 | * If they differ: |
||
| 122 | ** a `_update.exe` variant is written locally |
||
| 123 | ** the updater starts the updated executable with the original command line |
||
| 124 | ** the current process terminates after launching the new one |
||
| 125 | * There is also a special `_update.exe` startup mode: |
||
| 126 | ** `_update.exe` replaces the original `.exe` |
||
| 127 | ** then relaunches the original executable |
||
| 128 | * The startup splash screen triggers this update flow before starting the normal RunLocal command/script. |
||
| 129 | |||
| 130 | 9 | [E] Rocco Kreutz | |
| 131 | |
||
| 132 | |||
| 133 | 23 | [E] Rocco Kreutz | h1. Manuelles Setup / Installation |
| 134 | 1 | [X] Daniel S | |
| 135 | 23 | [E] Rocco Kreutz | {{collapse(Manuelles Setup) |
| 136 | *Script - welches PRODAT in ein lokales Verzeichnis kopiert und aktuell hält* |
||
| 137 | 5 | [X] Daniel S | |
| 138 | 14 | [X] Daniel S | * *Auf dem Rechner, auf dem Prodat in Zukunft lokal ausgeführt werden soll, dass Script \\<Server>\<Prodat-Installation\Administration\RunLocal\RunLocal_Setup.bat ausführen.* |
| 139 | 3 | [E] Rocco Kreutz | ** z.B.: |
| 140 | *** Pfad zur Prodat-Installation auf dem Server (Remote) ist \\192.168.1.100\Prodat-ERP\ |
||
| 141 | *** Auf dem Rechner dann Eingabeaufforderung starten |
||
| 142 | *** \\192.168.1.100\Prodat-ERP\Administration\RunLocal\RunLocal_Setup.bat starten |
||
| 143 | * Damit wird alles konfiguriert und eingerichtet. |
||
| 144 | |
||
| 145 | |
||
| 146 | 1 | [X] Daniel S | |
| 147 | 3 | [E] Rocco Kreutz | * RunLocal_Setup bietet ein Menu an |
| 148 | * Die einzelenen Menu-Punkte werden mit einem einzelnen Buchstaben angesteuert, welcher in [] vorweggestellt ist |
||
| 149 | * Nach Ausführung eines einzelnen Menu-Punktes, wird jeweils wieder das Menu angezeigt |
||
| 150 | ** [S] Setze lokales Verzeichniss für weitere Ops |
||
| 151 | ** [Q] Setze (cfg) Quell-Verzeichniss (Remote-Directory) |
||
| 152 | ** [P] Setze (cfg) Programm |
||
| 153 | ** [A] Setze (cfg) Programm-Paramter |
||
| 154 | ** [Z] Zeige Konfiguration und lokales Verzeichniss |
||
| 155 | ** [M] Schreibe Konfiguration-Datei |
||
| 156 | ** [N] Lade Konfiguration-Datei |
||
| 157 | ** [K] Kopiere Prodat nach lokal (Down-Sync) |
||
| 158 | ** [E] Erstelle Windows-Task (automatisches Update von Lokal) |
||
| 159 | ** [L] Lösche Windows-Task |
||
| 160 | ** [C] Erstelle Shortcut (Prodat Instanzen beenden, Updaten, Starten) |
||
| 161 | ** [D] Lösche Shortcut |
||
| 162 | ** [X] Exit |
||
| 163 | |
||
| 164 | |
||
| 165 | 1 | [X] Daniel S | |
| 166 | 3 | [E] Rocco Kreutz | * Die einzelnen Schritte |
| 167 | # [S] Geben Sie das lokale Verzeichniss an |
||
| 168 | 4 | [E] Rocco Kreutz | #* Muss nach jedem Start von RunLocal_Setup erneut anegegeben werden |
| 169 | 3 | [E] Rocco Kreutz | #* Prodat wird vom Server (Remote) in dieses Verzeichniss kopiert |
| 170 | #* In diesem Verzeichniss unter \Administration\RunLocal\ wird die Konfigurations-Datei gespeichert als auch weitere Scripts |
||
| 171 | # [Q] Geben Sie das Quell-Verzeichniss an |
||
| 172 | #* Wie in dem obigen Beispiel, wäre dies z.B: \\192.168.1.100\Prodat-ERP\ |
||
| 173 | #* Sollten vor Ort statt UNC-Pfaden Laufwerke verwendet werden (z.B. mittels Login-Script verbunden), ist dies natürlich auch möglich (z.B: S:\Prodat-ERP\) |
||
| 174 | # Menu-Punkt [P] muss normalerweise nicht ausgeführt werden, da das Setup, dass zu startende Programm bereits standardmäßig auf ProdatSQL.exe setzt |
||
| 175 | #* Grundsätzlich ist es möglich ein anderes Programm anzugeben, welches gestartet/beendet (Task/Manuell) (nach Aktualisierung des lokalen Verzeichnisses) werden soll |
||
| 176 | # [A] Geben sie die Parameter an, mit denen Prodat gestartet werden soll |
||
| 177 | #* Der Standardwert ist -REMEMBER_SERVER:1 wird also für die meisten Fälle nicht ausreichend sein |
||
| 178 | #* Um herauszufinden welche Parameter nötig sind, schauen Sie am besten in die Eigenschaften der Startverknüpfung der bestehenden Prodat-Installation (welche via Server startet) |
||
| 179 | # [Z] Lassen Sie sich die momentanen Werte der Konfiguration anzeigen, um diese zu kontrollieren |
||
| 180 | # [M] Wenn Sie die korrekten Konfigurations-Werte angegeben haben, schreiben Sie diese in die lokale Konfigurations-Datei |
||
| 181 | # Der Menu-Punkt [N] lädt eine Konfigurations-Datei, muss also während der ersten Einrichtung nicht aufgerufen werden |
||
| 182 | #* Kann nur ausgeführt werden, sofern eine lokale Konfigurations-Datei existiert und das lokale Verzeichniss nach dem Start von RunLocal_Setup.bat angegeben wurde |
||
| 183 | #* Falls man die Konfigurations-Datei manuell bearbeitet hat z.B. |
||
| 184 | #* Wenn man das RunLocal_Setup bereits ausgeführt hatte, eine Konfigurations-Datei erstellt wurde und dann RunLocal_Setup erneut startet |
||
| 185 | # [K] Führt eine Synchronisierung des lokalen Verzeichnisses mit dem Quell-Verzeichniss aus |
||
| 186 | #* Dies ist eine echte Synchronisierung, d.h. dannach ist der Inhalt des lokalen Ordners EXAKT GLEICH mit dem Inhalt des Quell-Ordners mit Ausnahme der in der \Administration\RunLocal\exclude_default.rcj angegebenen Excludes |
||
| 187 | #* Unterordner \Administration\RunLocalder enthält zusätzlich die Konfigurations-Datei und nur die Scripte die benötigt werden |
||
| 188 | #* Die Ordner \Backup, \Temp und \Help werden nicht heruntergeladen (exclude_default.rcj) |
||
| 189 | #* *.7z und *.zip Dateien werden nicht heruntergeladen (exclude_default.rcj) |
||
| 190 | #* Sollten im lokalen Verzeichniss Dateien/Verzeichnisse existieren, welche nicht im Quell-Verzeichniss existieren (und welche nicht in exclude_default.rcj als excluded aufgeführt sind), werden diese gelöscht !!! |
||
| 191 | # [E] Erstellt eine Windows-Task (Windows Aufgabe, taskschd.msc) |
||
| 192 | #* Da der Arbeitspfad ("Starten in" Parameter in der Task) nicht mittels Kommandozeile gesetzt werden kann, MUSS dies manuell gesetzt werden |
||
| 193 | #** Entweder Aufgabenverwaltung über Windows-Starmenu starten |
||
| 194 | #** oder taskschd.msc starten |
||
| 195 | #*** "Ausführen" über das Windows-Startmenu wählen und taskschd.msc eingeben |
||
| 196 | #*** oder über Eingabeaufforderung taskschd.msc starten |
||
| 197 | #** "Starten in" auf das Verzeichniss setzen, in dem sich das Script welches als Task ausgeführt wird, befindet (Verzeichniss-Teil - ohne den Dateiname - des angegebenen Scriptes einfach kopieren) |
||
| 198 | #* Diese Task wird täglich um 23 Uhr ausgeführt |
||
| 199 | #* Die Task führt folgende Schritte aus |
||
| 200 | #** Fährt ALLE Programm-Instanzen (mittels [P] angegebenes Programm) herunter |
||
| 201 | #** Aktualisiert das lokale Verzeichniss (Update - keine Synchronisierung, in exclude_default.rcj angegebene Excludes werden berücksichtigt) |
||
| 202 | #** Startet Programm neu (Programm welches mit [P] Konfiguriert wurde, mit den Paramtern welche mittels [A] konfiguriert wurden) |
||
| 203 | # Falls es nicht mehr gewünscht wird, dass automatisch das Update-Script ausgeführt wird, kann mit [L] die Windows-Task wieder gelöscht werden |
||
| 204 | # [C] Erstellt auf dem Desktop einen Shortcut, welcher das Update-Script startet (ALLE Programm-Instanzen beenden, lokales Verzeichniss aktualisieren, Programm starten) |
||
| 205 | 1 | [X] Daniel S | # [D] Löscht den Shortcut vom Desktop |
| 206 | 3 | [E] Rocco Kreutz | # [X] Beendet RunLocal_Setup (wird automatisch nach 30 Sekunden ohne Benutzer-Aktivität ausgeführt) |
| 207 | 23 | [E] Rocco Kreutz | }} |
| 208 | 16 | [E] Rocco Kreutz | |
| 209 | 1 | [X] Daniel S | h2. Silent Install |
| 210 | |||
| 211 | 17 | [E] Rocco Kreutz | * RunLocal_Setup.bat kann mit 2 Parametern gestartet werden, um eine non-user-interaktive Installation eine der beiden Standard-Installationen auszuführen |
| 212 | ** @RunLocal_Setup.bat SILENT_INSTALL_DEFAULT@ |
||
| 213 | 18 | [E] Rocco Kreutz | *** Führt die Batch aus, als ob der Benutzer @1@ im Menu gedrückt hätte und dannach @x@ |
| 214 | 17 | [E] Rocco Kreutz | ** @RunLocal_Setup.bat SILENT_INSTALL_DEFAULTBDE@ |
| 215 | 18 | [E] Rocco Kreutz | *** Führt die Batch aus, als ob der Benutzer @2@ im Menu gedrückt hätte und dannach @x@ |
| 216 | 20 | [E] Rocco Kreutz | |
| 217 | h3. Automatisierung (Standard 1) |
||
| 218 | |||
| 219 | * Mittels @HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce@ kann @\\Server\ProdatShare\Administration\RunLocal\RunLocal_Setup.bat SILENT_INSTALL_DEFAULT@ aufgerufen werden, um auf der Maschine Prodat-RunLocal zu installieren |
||
| 220 | * Der Shortcut zum starten wird auf dem Desktop des Benutzers angelegt, welcher das Setup tatsächlich ausführt |
||
| 221 | ** Diesen Shortcut @Prodat Lokal - Aktualisieren und neustarten@ entweder auf den öffentlichen Desktop verschieben |
||
| 222 | ** Oder eigenen ShortCut im öffentlichen Desktop erstellen mit Ziel: 'C:\ProdatERP\Administration\RunLocal\ProdatRunLocal.exe' |
||
| 223 | 28 | [X] Daniel S | |
| 224 | 29 | [X] Daniel S | siehe auch: |
| 225 | https://redmine.prodat-sql.de/projects/prodat-v-x/wiki/Konfiguration_(CONFIGSERVERS)_Start_Parameter_Link#RunLocal |
||
| 226 | 28 | [X] Daniel S | |
| 227 | [RunLocal] |
||
| 228 | AllowInstall=False |