Paketverteilung anhand einer Variable?

Post Reply
Dante3
Posts: 1
Joined: 13. Nov 2020, 08:53
Contact:

Paketverteilung anhand einer Variable?

Post by Dante3 » 19. Nov 2020, 09:27

Hallo zusammen,

wir würden gerne ein Programm namens Veyon (Schulungs Software) anhand einer Variable verteilen.

Zu erst lesen wir den PC-Namen aus der Registry aus und dann setzten wir die 4 Befehle ab (je nach dem welcher PC Name es ist)

; richtige Veyon Konfiguration laden für Schulungs-PC's
Set Vendor=%HKLM,SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName,ComputerName%
If %Vendor% >= "PCName-xx1" & %Vendor% <= "PCName-xx9" Then "InstallationRaum1-schulung" EndIf
If %Vendor% >= "PCName-yy1" & %Vendor% <= "PCName-yy9" Then "InstallationRaum2-schulun" EndIf
und das gleiche halt für Dozenten (keine SchulungsPC's)

- Schulungsraum 1
- Master (nur 1 PC) Befehl hierzu lautet =
setup.exe" /S /Master /ApplyConfig=%Src%\Konfig\Raum1.json
- Schulungs PC (10 PC's) Befehl hierzu lautet =
setup.exe" /S /NoMaster /ApplyConfig=%Src%\Konfig\Raum1.json

Schulungsraums 2
- Master (nur 1 PC) Befehl hierzu lautet =
setup.exe" /S /Master /ApplyConfig=%Src%\Konfig\Raum2.json
- Schulungs PC (10 PC's) Befehl hierzu lautet =
Setup.exe" /S /NoMaster /ApplyConfig=%Src%\Konfig\Raum2.json

Also es sind diese 4 Unterschiede (je nach dem, welcher PC Name) = Master/ NoMaster und Raum1/Raum2.

Wie kann man in Empirum diese Konfiguration besser mit Variablen lösen?

Beipsiel:
Variable 1: PCName qqq = Master, Raum 1
Variable 2: PCName www = Master, Raum 2
Variable 3: >= "PCName-xx1" & <= "PCName-xxx9" = SchulungsPC's, Raum 1
Variable 4: >= "PCName-xx1" & <= "PCName-xxx9" = SchulungsPC's, Raum2

also wie kann ich diese Variablen in Empirum setzten und abrufen?

Danke

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

Re: Paketverteilung anhand einer Variable?

Post by Hendrik_Ambrosius » 19. Nov 2020, 13:06

Die Variablen können über Extras/Variablendefinitionen in der EMC angelegt werden.
Werte dann am Client oder die Gruppen (Vererbung) setzen.
Dann so auslesen in der setup.inf:

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) Activate the check for the INI-files in the Product-section (delete ;):
[Product]
;#FileCheckMachine, MACHINE => #FileCheckMachine, MACHINE
;#FileCheckClient, CLIENT => #FileCheckClient, CLIENT
5) 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: Google [Bot] and 9 guests