Copy in das Benutzerprofil des Loggedin Users

Post Reply
Denfen
Posts: 13
Joined: 20. Sep 2016, 15:57
Contact:

Copy in das Benutzerprofil des Loggedin Users

Post by Denfen » 25. Feb 2020, 16:53

Hallo liebe Matrix42 Community,

wir haben aktuell folgendes Problem:

Wir kopieren mit dem Script unten eine Datei in das %Appdata% Verzeichnissdes Installationsadmins.

Wir hätten aber gerne die Datei in %Appdata% Verzeichnis des angemeldeten Benutzers(Dieser ist kein Admin):

Ist das möglich?


Die wichtigsten Codeteile:

Code: Select all

[SetupInfo]
Command line options    = /AW /S2

[Produkt]
#Set:Product
#Set:CopySAPLogon, DONTDELETE
#Set:Installation, DONTDELETE
#Set:Deinstallation, DELETE
#Reg:OnUninstallProduct, DELETE
#Reg:Product
#Ini:Product
#Security:Product

[Set:CopySAPLogon]
Copy "%SRC%\Source\SAPUILandscape.xml" "%APPDATA%\SAP\Common\SAPUILandscape.xml" ,CLIENT ALWAYS, 0

Die Komplette Setup.inf, falls was fehlt.

Code: Select all

[SetupInfo]
Author                  = XXXXXX
CreationDate            =XX.XX.XXXX
InventoryID             =
Description             =
Method                  =
Tested on               =
Dependencies            =
Command line options    = /AW /S2
Last Change             =
Build                   =

[VarDefInfo]
; <Variable>, <Type: 0=Computer 1=User>, <Allow NULL values: 0=No 1=Yes>

[Setup]
Version=14.2
ShowCaption=1
BlockInput=0
Platform=x64

[Requirements]

[Application]
ProductName=SAP_Secure_Login_Client
DeveloperName=SAP
Version=1.0
Revision=0
SetupName=%ProductName% %Version% %SetupWizard%
Text1="%ProductName% %Version%",         Arial,           30, , 2170F3, 4,    , LEFT BOLD ITALIC
Text2="%DeveloperName%",                 Arial,           24, , 2170F3, 4,    , LEFT BOLD ITALIC
Text8="%Company%",                       Arial,           18, , 2170F3, 4,  10, RIGHT BOLD ITALIC
Text9="%InstallationFor% %WindowsUser%", Arial,           16, , 2170F3, 4, -18, BOTTOM ITALIC LEFT
BackgroundColor=EFEFEF,000000
CopyDialogRect=0%, 0%, 100%, 100%, HCENTER VCENTER

; Register all installations in common registry key
UserKeyName=$Matrix42Packages$\%DeveloperName%\%ProductName%
MachineKeyName=$Matrix42Packages$\%DeveloperName%\%ProductName%\%Version%
UninstallKeyName=Matrix42 - %DeveloperName% %ProductName% %Version%
UninstallDisplayName=Matrix42 - %DeveloperName% %ProductName% %Version%
UninstallString=%ReinstallString% /U
ReinstallString="%CommonSetupDir%\Setup.exe" "%App%\%SetupInfDir%\Setup.inf"
;UninstallDisplayIcon="%ApplicationDir%\%SetupInfDir%\Setup.ico",0
UninstallOptions=NOREMOVE NOREPAIR NOMODIFY
ReinstallMode=1
SrcDir=..

; Matrix42 Scripts are copied in a common scripts directory
ApplicationDir=%CommonAppData%\$Matrix42Scripts$\%DeveloperName%\%ProductName%\%Version%

SetupInfDir=Install
DataDir=%Personal%
AskUninstallOld=1
ShellLinks=1
CommonShellLinks=1
CreateUnresolvableShellLinks=1
UseStringSection=Strings:09
UseSysStringSection=SysStrings:09
DateWarning=1
SizeWarning=0
Reboot=0
PreventExternalReboot=1
StartServicesOnReboot=0
CallTimeOut=3600
AbortAfterCallTimeOut=1
DisableCancelButton=1
ShowEndMessage=1
EndMessage=%EndMessageDesc%

[Strings:07]
Disk1=Installationsmedium 1
EndMessageDesc=Die Installation wurde erfolgreich abgeschlossen!
ErrorLogMessage=Die Installation/Deinstallation wurde mit einer Fehlermeldung abgebrochen!
InstallationFor=Installation für:
InstallerDesc=Dienstprogramm zum Installieren einzelner Komponenten.
InstallerName=Installationsprogramm
SetupWizard=Installations-Assistent
Uninstallation=deinstallieren
ErrorText=Fehler
CallingText=beim Aufruf von

[Strings:09]
Disk1=Installation media 1
EndMessageDesc=Installation was completed successfully!
ErrorLogMessage=The installation/uninstallation aborted with an error message!
InstallationFor=Installation for:
InstallerDesc=Service program to install single components.
InstallerName=Setup program
SetupWizard=Installation Wizard
Uninstallation=Uninstallation
ErrorText=Error
CallingText=launching

[SysStrings:07]
Users=Benutzer

[SysStrings:09]
Users=Users

[Environment]
CommonSetupDir=%CommonFilesDir%\Setup%SetupBits%
V_MachineValuesPath=\\%EmpirumServer%\Values$\MachineValues\%DomainName%
V_UserValuesPath=%HKLM,"Software\matrix42\Software Depot","HomeServer"%\Values$\UserValues\%UserDomain%

; Maschinenabhängige Variablen
; machine dependent variables
;VM_<Variable>=%%%V_MachineValuesPath%\%ComputerName%.ini,%ComputerName%,<Variable>%%

; Userabhängige Variablen
; user dependent variables
;VU_<Variable>=%%%V_UserValuesPath%\%WindowsUser%.ini,%WindowsUser%,<Variable>%%

; !!! Setzen der entsprechenden ReplaceEnv Befehle für die Variablen im Abschnitt [Product] nicht vergessen!!!
; !!! Don't forget to set the appropriate ReplaceEnv instructions for the variables in the section [Product]!!!

[Encryption]

[Disks]
1=%Disk1%

[Options]
Installer = %InstallerName%, COPYALWAYS, Installer, "%InstallerDesc%"
Product   = %ProductName%,   COPYALWAYS, Product,   "%ProductDesc%"

[Installer]
1:..\..\..\..\User\Setup.exe,          %CommonSetupDir%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP, 0
1:..\..\..\..\User\SetupDeu.chm,       %CommonSetupDir%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP, 0
1:..\..\..\..\User\SetupEnu.chm,       %CommonSetupDir%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP, 0
1:%Temp%\Setup64.exe,                  %CommonSetupDir%\Setup.exe, OPTIONAL ALWAYS NOSIZEWARNING SETUP WINDOWS64,     0
1:..\..\..\..\User\Setup64.exe,        %CommonSetupDir%\Setup.exe, OPTIONAL ALWAYS NOSIZEWARNING SETUP WINDOWS64,     0
1:%SetupInfDir%\Setup.inf,                             , ALWAYS,                                             0
; 1:%SetupInfDir%\Setup.ico,                             , NORMAL,                                           0
; 1:%SetupInfDir%\Logo.bmp,                              , NORMAL,                                           0

[Product]
; ReplaceEnv <Variable>

#Set:Product
#Set:CopySAPLogon, DONTDELETE
#Set:Installation, DONTDELETE
#Set:Deinstallation, DELETE
#Reg:OnUninstallProduct, DELETE
#Reg:Product
#Ini:Product
#Security:Product

[Set:Product]

[Set:Installation]
AddMeter -1
Call "%Src%\Source\SAPSetupSLC02_4-80001954.EXE" /noDLG

[Set:CopySAPLogon]
Copy "%SRC%\Source\SAPUILandscape.xml" "%APPDATA%\SAP\Common\SAPUILandscape.xml" ,CLIENT ALWAYS, 0

[Set:Deinstallation]
If "%ErrorLevel%" <> "0" Then "SET:DeInstallationError" EndIf
-Call "C:\Program Files (x86)\SAP\SAPsetup\setup\NwSapSetup.exe" /Product="SLC" /uninstall /noDLG

-AddMeter -1

[Reg:OnUninstallProduct]

[Reg:Product]

[Ini:Product]

[Security:Product]

[Shell:Product]

[Set:InstallationError]
ErrorLogMsg %ErrorText% %ErrorLevel% %CallingText% SAPSetupSLC02_4-80001954.EXE

[Set:DeInstallationError]
-Abort
-ErrorLogMsg %ErrorText% %ErrorLevel% %CallingText% SAPSetupSLC02_4-80001954.EXE

Vielen Dank und Grüße
Denfen :D

User avatar
r.wiegel
Posts: 896
Joined: 05. Feb 2010, 13:45
Location: Regensburg
Contact:

Re: Copy in das Benutzerprofil des Loggedin Users

Post by r.wiegel » 26. Feb 2020, 10:40

Hallo,

die Flags CLIENT ALWAYS beziehen sich auf Empirum Copy-Befehl:
"1:Quelldatei, Zielverzeichnis, Kopierflags, Größe"

Beim Kopieren nach %AppData% mit /AW als Commandline Parameter bekommt die Datei jeder Benutzer. So hätte ich das auch gemacht.

;~ohne Test~
Wenn es jedoch darum geht nur dem angemeldeten Benutzer die Datei zu kopieren (warum denn?), kann man /AW weglassen.
Die Paketeigenschaften\Installationskontext auf "nur nach Benutzeranmeldung" setzen. Aufruf:
Copy "%SRC%\Source\SAPUILandscape.xml" "C:\Users\%WindowsUser%\AppData\Roaming\SAP\Common\SAPUILandscape.xml"
Viele Grüße
Roman Wiegel
IT-Consultant

MR Datentechnik - Vertriebs- und Service GmbH

Denfen
Posts: 13
Joined: 20. Sep 2016, 15:57
Contact:

Re: Copy in das Benutzerprofil des Loggedin Users

Post by Denfen » 26. Feb 2020, 11:15

Hallo Herr Wiegel,

vielen Dank für ihre schnelle Antwort.

Also, theoretisch kann jeder Benutzer diese Datei in %Appdata% bekommen. Nicht nur der angemeldete Benutzer.

Uns ist leider nicht genau bewusst, was AW bzw. Benutzeranteil bedeutet. Laut meinem Verständnis, bin ich davon ausgegangen, das alles was außerhalb des Benutzerprofils passiert, Maschinenanteil ist, und alles was innerhalb passiert, Benutzeranteil.


Beim ersten Kopierversucht, wurden die Daten nur in %Appdata% des ausführenden Admins kopiert, und nicht in %Appdata% aller User.


Bedeutet Benutzeranteil, immer das die Daten in alle Benutzerprofile kopiert werden sollen?
Und gibt es einen Unterschied zwischen dem COPY befehl und dem 1: Befehl?

StephanSch
Posts: 60
Joined: 03. Jul 2010, 20:20
Location: Berlin
Contact:

Re: Copy in das Benutzerprofil des Loggedin Users

Post by StephanSch » 27. Feb 2020, 13:15

AW führt dazu, dass beim Anmelden eines Users an dem Gerät dieser User-Abschnitt des Pakets ausgeführt wird. Das passiert dementsprechend nur bei den angemeldeten Usern.
Meldet sich ein User das erste Mal an einem Gerät werden alle User-Teile der zugewiesene Pakete für diesen User (und als dieser) ausgeführt.
Das lässt sich auch sehr gut im Log nachvollziehen.

Wenn sich alle User an dem zugewiesenen Rechner anmelden sollten, würde es alle ins Profil bekommen, ja. Aber auch nur dann!
Empirum 23.0.1; Service Store/DWP 12.0
Windows Server 2019
Clients: Windows 10 Enterprise x64 21H2

Post Reply

Return to “Paketierung”

Who is online

Users browsing this forum: No registered users and 8 guests