Standort-abhängiges kopieren von Konfigurationsdateien

Post Reply
Marvin.aus.HH
Posts: 13
Joined: 03. May 2022, 12:10
Contact:

Standort-abhängiges kopieren von Konfigurationsdateien

Post by Marvin.aus.HH » 12. Sep 2022, 15:55

Hallo zusammen,

ich habe heute ein neues Softwarepaket erstellt, welches bei uns im Konzen in allen Standorten zum Einsatz kommen soll.
Jeder Standort hat einen eigenen Depot-Server, auf den die Pakete regelmäßig gesynct werden.
Nun muss bei der Software allerdings eine Konfigurationsdatei in Abhängigkeit zum Standort des Clients, wo das Paket drauf kommt, eine andere Konfigurationsdatei kopiert werden.
Die Konfigurationsdateien pro Standort habe ich am zentralen EmpirumServer schon unterhalb von Install in einen extra Order angelegt.
Der Copy Job sieht für einen Standort so aus
[Set:Product]
1:DEMIS-1-0-2-0\EIL-profiles.json, %ProgramData%\DEMISMeldung\conf\profiles.json, ALWAYS, 0\

nur weiß ich nihct wie ich das pro Standort als Variable machen kann.

Vielen Dank im Voraus.
Marvin

User avatar
Hendrik_Ambrosius
Moderator
Moderator
Posts: 7965
Joined: 13. Dec 2004, 23:10
Location: Adendorf/Lüneburg

Re: Standort-abhängiges kopieren von Konfigurationsdateien

Post by Hendrik_Ambrosius » 12. Sep 2022, 16:22

Dann würde ich eine Paketvariable anlegen und den Wert auf Standort-Ebene in den Konfigurations- oder Zuweisungsgruppen setzen. Dann die Variable im Paket auslesen und für den COPY Befehl verwenden.

Zum Auslesen habe ich mal eine Anleitung erstellt:

How to read package variables from an Empirum script

1) Create the package variable with the Empirum Manager (Tools/Properties/Package Variables)
2) Add the variable to the setup.inf´s Environment-section:
[Environment]
; Machine-Variable:
VM_Software-SerialNumber=%%%V_MachineValuesPath%\%ComputerName%.ini,%ComputerName%,Software-SerialNumber%%
; User-Variable:
VU_Phone=%%%V_UserValuesPath%\%WindowsUser%.ini,%WindowsUser%,VU_Phone%%
3) Now add a ReplaceEnv statement for each variable in the Product-Section:
[Product]
ReplaceEnv VM_Software-SerialNumber
ReplaceEnv VU_Phone
4) Now you can use the variables in the script.
Example:
Echo Hello %WindowsUser%, your phone number is %VU_PHONE%.
HKLM,"SOFTWARE\SomeApp","serialnumber",0x00000000,"%VM_Software-SerialNumber%"
Hendrik Ambrosius / Senior Presales Consultant
Mobile: +49 172 408 4447 | hendrik.ambrosius@matrix42.com
Matrix42 GmbH | Elbinger Straße 7 | 60487 Frankfurt am Main | Germany | www.matrix42.com

Disclaimer: I participate in this forum on a voluntary basis. Views expressed are not necessarily those of Matrix42 or of the support team.

Post Reply

Return to “Paketierung”

Who is online

Users browsing this forum: No registered users and 5 guests