Wieso wird nicht kopiert?

Post Reply
knivel
Posts: 19
Joined: 29. Nov 2012, 09:45
Contact:

Wieso wird nicht kopiert?

Post by knivel » 13. Nov 2014, 16:01

Huhu@all,

ich schätze, ist mal wieder eine simple Frage.

Ich möchte in das lokale Firefox User Profil eine neue Zertifikatsdatenbank und Ausnahmen + ein paar Updates der Extensions kopieren.

Das Auslesen des von Firefox erstellten Zufalls-Pfad z.B.
C:\Users\%username%\AppData\Roaming\Mozilla\Firefox\Profiles\x6dayepi.default
hat nach etwas tüfteln ja noch geklappt.

Aber warum funktioniert im letzten Abschnitt kein einziger der 4 copy-Befehle? Es kommt einfach nichts in dem Verzeichnis an...

Tomaten auf den Augen?

Danke für Tipps.

*Musste es grad nochmal etwas editieren, aber so sieht die Setup.inf aus

Code: Select all

[SetupInfo]
Author                  = knivel
CreationDate            = 12.11.2014 14:00
InventoryID             = 
Description             = Mozilla Firefox ESR Profile Update
Method                  = manuell
Tested on               = Win7 x86
Dependencies            = 
Command line options    = /S1 /AW
Last Change             = 12.11.2014 14:00
Build                   = 0

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

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

[Requirements]

[Application]
ProductName=Firefox ESR Profile Update
DeveloperName=Mozilla
Version=0
Revision=0
SetupName=%ProductName% %Version% %SetupWizard%
Text1="%ProductName%",                                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,0,BOTTOM LEFT ITALIC
BackgroundColor=EFEFEF,000000
CopyDialogRect=0%, 0%, 100%, 100%, HCENTER VCENTER
UserKeyName=%DeveloperName%\%ProductName%
MachineKeyName=%DeveloperName%\%ProductName%\%Version%
UninstallKeyName=%DeveloperName% %ProductName% %Version%
UninstallDisplayName=%ProductName% %Version%
UninstallString=%ReinstallString% /U
ReinstallString="%CommonSetupDir%\Setup.exe" "%App%\%SetupInfDir%\Setup.inf"
ReinstallMode=1
SrcDir=..
ApplicationDir=%ProgramFilesDir%\%ProductName%
SetupInfDir=Install
DataDir=%Personal%
AskUninstallOld=1
ShellLinks=1
CommonShellLinks=0
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

[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

[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%

MozDefaultProfile="%ProgramFiles%\Mozilla Firefox\browser\defaults\profile"

[Encryption]

[Processes]
FIREFOX=Firefox.exe, Mozilla Firefox, KILLPROCESS ABORT

[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:%SetupInfDir%\Setup.inf,                             , NORMAL,                                             0
1:%Temp%\Setup64.exe,                  %CommonSetupDir%\Setup.exe, OPTIONAL NOSIZEWARNING SETUP ALWAYS WINDOWS64,      0

[FileCheckMachine]
ReplaceEnv V_MachineValuesPath
If DoesFileExist ("%V_MachineValuesPath%\%ComputerName%.ini") == "0" Then "FileIsntThere" EndIf

[FileCheckClient]
ReplaceEnv V_UserValuesPath
If "%UserDomain%" <> "%ComputerName%" Then "CheckClientFile" EndIf

[CheckClientFile]
If DoesFileExist ("%V_UserValuesPath%\%WindowsUser%.ini") == "0" Then "FileIsntThere" EndIf

[FileIsntThere]
ErrorLogMsg Values$\MachineValues\%DomainName%\%ComputerName%.ini or Values$\UserValues\%UserDomain%\%WindowsUser%.ini not found!
Abort

[Product]
AskKillProcesses 900, FIREFOX
#Set:Product
-AskKillProcesses 900, FIREFOX

[Set:Product]
If DoesFileExist("%ProgramFilesDir%\Mozilla FireFox\firefox.exe") == "1" Then "CopyNewDefaultProfile" Else AllIsDone
If DoesFileExist ("%AppData%\Mozilla\FireFox\profiles.ini") == "1" Then "CopyNewUsersProfile" Else AllIsDone

[CopyNewDefaultProfile]
Mkdir "%App%\Default"
Copy "%SRC%\Default\*.*" "%App%\Default" /S /D
Copy "%App%\Default\*.*" %MozDefaultProfile% /S /D

[CopyNewUsersProfile]
;Schreibe den Zufallsnamen des Mozialla-Profils in eine txt-Datei
Callhidden cmd.exe /c dir %AppData%\Mozilla\Firefox\Profiles /B > "%AppData%\Mozilla\Firefox\%username%_ProfilePath.txt"
;Lies den inhalt der txt-Datei aus und schreibe ihn in eine Variable
Set MozPath=ReadTextFile ("%AppData%\Mozilla\Firefox\%username%_ProfilePath.txt")
ReplaceEnv MozPath
;Kopiere die benötigten Files in den richtigen Pfad
Copy "%App%\Default\cert8.db" %AppData%\Mozilla\Firefox\Profiles\%MozPath% /S /D
Copy "%App%\Default\cert_override.txt" %AppData%\Mozilla\Firefox\Profiles\%MozPath% /S /D
Copy "%App%\Default\adblockplus\*.*" %AppData%\Mozilla\Firefox\Profiles\%MozPath%\adblockplus /S /D
Copy "%App%\Default\extensions\*.*" %AppData%\Mozilla\Firefox\Profiles\%MozPath%\extensions /S /D

[AllIsDone]
Exit

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

Re: Wieso wird nicht kopiert?

Post by Hendrik_Ambrosius » 14. Nov 2014, 11:40

Wird die Sektion überhaupt angesprungen?
Versuchen Sie mal die IF-Bedingungen in eine separate Sektion zu packen die nur im Userteil angesprungen wird (CLIENT-Flag).
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.

knivel
Posts: 19
Joined: 29. Nov 2012, 09:45
Contact:

Re: Wieso wird nicht kopiert?

Post by knivel » 14. Nov 2014, 12:38

Ja, wird sie.
ich hab's zum Troubleshooting umgebaut, jetzt kommt eine Fehlermeldung.
Er kann nicht in den Pfad mit dem Punkt kopieren.

Code: Select all

[Set:Product]
If DoesFileExist("C:\Program Files\Mozilla Firefox\firefox.exe") == "1" Then "FirefoxExist" Else AllIsDone

[FirefoxExist]
If DoesFileExist("C:\Program Files\Mozilla Firefox\browser\defaults\profile\BD.txt") == "1" Then "CheckUsersProfile" Else "CopyNewDefaultProfile"

[CheckUsersProfile]
If DoesFileExist ("%AppData%\Mozilla\FireFox\profiles.ini") == "1" Then "CopyNewUsersProfile" Else AllIsDone

[CopyNewDefaultProfile]
MkDir "%App%\Defaults"
Copy "%SRC%\Defaults\*.*" "%App%\Defaults" /S /D
Copy "%App%\Defaults\*.*" %MozDefaultProfile% /S /D

[CopyNewUsersProfile]
;Schreibe den Zufallsnamen des Mozialla-Profils in eine txt-Datei
Callhidden cmd.exe /c dir %AppData%\Mozilla\Firefox\Profiles /B > "%AppData%\Mozilla\Firefox\%username%_ProfilePath.txt"
;Lies den inhalt der txt-Datei aus und schreibe ihn in eine Variable
Set ProfName=ReadTextFile ("%AppData%\Mozilla\Firefox\%username%_ProfilePath.txt")
ReplaceEnv ProfName
Set MozPath="%AppData%\Mozilla\Firefox\Profiles\%ProfName%\"
ReplaceEnv MozPath
;Kopiere die benötigten Files in den richtigen Pfad
Copy "C:\Program Files\Firefox ESR Profile Update\Defaults\profile\cert8.db" %MozPath%
Copy "C:\Program Files\Firefox ESR Profile Update\Defaults\profile\cert_override.txt" %MozPath%
Copy "C:\Program Files\Firefox ESR Profile Update\Defaults\profile\adblockplus\*.*" %MozPath%\adblockplus
Copy "C:\Program Files\Firefox ESR Profile Update\Defaults\profile\extensions\*.*" %MozPath%\extensions
Fehlermeldung bei den letzten 4 Copy-Befehlen:
Kann Verzeichnis
C:\Users\knivel\AppData\Roaming\Mozilla\Firefox\Profiles\x6dayepi.default\
nicht anlegen!

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

Re: Wieso wird nicht kopiert?

Post by Hendrik_Ambrosius » 14. Nov 2014, 13:48

Die Variable mal in Anführungszeichen setzen?
Copy "C:\Program Files\Firefox ESR Profile Update\Defaults\profile\cert8.db" "%MozPath%"
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.

knivel
Posts: 19
Joined: 29. Nov 2012, 09:45
Contact:

Re: Wieso wird nicht kopiert?

Post by knivel » 14. Nov 2014, 14:05

Ja, mal mit, mal ohne Anführungszeichen und jeweils einmal mit Backslash am Ende und einmal ohne, und den jeweils einmal in der Variable selbst und auch direkt nach der Variable.
Es will nicht...

Interessanter Weise wird die Variable ja immer korrekt gefüllt.
Wenn man den Pfad aus der Variable direkt als Copy-Ziel angibt, klappt auch der Kopiervorgang...

Was bedeutet das jetzt?

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

Re: Wieso wird nicht kopiert?

Post by Hendrik_Ambrosius » 14. Nov 2014, 16:24

Mal die Variablenwerte per ErrorLogMsg in das SetupErrorLog ausgeben um zu sehen ob die wirklich alle korrekt sind?
Statt COPY mal "1:" Kommandos nehmen?
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.

Deep_Thought
Posts: 18
Joined: 21. Jun 2013, 11:00
Contact:

Re: Wieso wird nicht kopiert?

Post by Deep_Thought » 17. Nov 2014, 09:14

Moin,

fehlt dort am Ende nicht ein nicht ein "EndIf"?

Code: Select all

...
If DoesFileExist("C:\Program Files\Mozilla Firefox\firefox.exe") == "1" Then "FirefoxExist" Else AllIsDone (EndIf ????)

Gruß
Frank
Viele Grüße
Frank

---------------------------------------------------------------------------------------------
"Forty-two," said Deep Thought with infinite majesty and calm.

knivel
Posts: 19
Joined: 29. Nov 2012, 09:45
Contact:

Agent kann nicht in Verzeichnis mit "." Punkt kopieren?

Post by knivel » 17. Nov 2014, 17:34

Hendrik_Ambrosius wrote:Mal die Variablenwerte per ErrorLogMsg in das SetupErrorLog ausgeben um zu sehen ob die wirklich alle korrekt sind?
Statt COPY mal "1:" Kommandos nehmen?
Die Variablen kommen alle sauber an.

Mit 1: Kommandos selber Fehler.
Es manifestiert sich, dass Empirum hier nicht in ein Verzeichnis mit "." Punkt kopieren kann. Siehe angehängten Screenshot.
Das kann man ganz gut nachvollziehen, wenn man einfach mal ein Verzeichnis anlegt, welches einen Punkt beinhaltet.
Und danach mal versucht, dieses umzubenennen oder etwas herein zu kopieren. z.B.

Code: Select all

MkDir "%AppData%\Mozilla\Firefox\Profiles\Test.test"
Ren "%AppData%\Mozilla\Firefox\Profiles\Test.test" "%AppData%\Mozilla\Firefox\Profiles\Test1"
Das wird schlichtweg nicht ausgeführt.

Daher hab ich jetzt auch mal den Betreff des Beitrags geändert.

Irgendwie gehen mir die Ideen aus.
Deep_Thought wrote:Moin,

fehlt dort am Ende nicht ein nicht ein "EndIf"?

Code: Select all

...
If DoesFileExist("C:\Program Files\Mozilla Firefox\firefox.exe") == "1" Then "FirefoxExist" Else AllIsDone (EndIf ????)

Gruß
Frank
Ja, da fehlten überall die Endif's *schäm*
Nur leider hat das Beheben auch nicht den gewünschten Effekt gebracht.

An bei noch einmal der komplette Code, evtl. hat ja jemand noch einen Tipp...

Code: Select all

[SetupInfo]
Author                  = igolla
CreationDate            = 12.11.2014 14:00
InventoryID             = 
Description             = Mozilla Firefox ESR Profile Update
Method                  = manuell
Tested on               = Win7 x86
Dependencies            = 
Command line options    = /S1 /AW
Last Change             = 12.11.2014 14:00
Build                   = 0

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

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

[Requirements]

[Application]
ProductName=Firefox ESR Profile Update
DeveloperName=Mozilla
Version=0
Revision=0
SetupName=%ProductName% %Version% %SetupWizard%
Text1="%ProductName%",                                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,0,BOTTOM LEFT ITALIC
BackgroundColor=EFEFEF,000000
CopyDialogRect=0%, 0%, 100%, 100%, HCENTER VCENTER
UserKeyName=%DeveloperName%\%ProductName%
MachineKeyName=%DeveloperName%\%ProductName%\%Version%
UninstallKeyName=%DeveloperName% %ProductName% %Version%
UninstallDisplayName=%ProductName% %Version%
UninstallString=%ReinstallString% /U
ReinstallString="%CommonSetupDir%\Setup.exe" "%App%\%SetupInfDir%\Setup.inf"
ReinstallMode=1
SrcDir=..
ApplicationDir=%ProgramFilesDir%\%ProductName%
SetupInfDir=Install
DataDir=%Personal%
AskUninstallOld=1
ShellLinks=1
CommonShellLinks=0
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

[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

[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%

MozDefaultProfile="%ProgramFiles%\Mozilla Firefox\browser\defaults"

[Encryption]

[Processes]
FIREFOX=Firefox.exe, Mozilla Firefox, KILLPROCESS ABORT

[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:%SetupInfDir%\Setup.inf,                             , NORMAL,                                             0
1:%Temp%\Setup64.exe,                  %CommonSetupDir%\Setup.exe, OPTIONAL NOSIZEWARNING SETUP ALWAYS WINDOWS64,      0

[FileCheckMachine]
ReplaceEnv V_MachineValuesPath
If DoesFileExist ("%V_MachineValuesPath%\%ComputerName%.ini") == "0" Then "FileIsntThere" EndIf

[FileCheckClient]
ReplaceEnv V_UserValuesPath
If "%UserDomain%" <> "%ComputerName%" Then "CheckClientFile" EndIf

[CheckClientFile]
If DoesFileExist ("%V_UserValuesPath%\%WindowsUser%.ini") == "0" Then "FileIsntThere" EndIf

[FileIsntThere]
ErrorLogMsg Values$\MachineValues\%DomainName%\%ComputerName%.ini or Values$\UserValues\%UserDomain%\%WindowsUser%.ini not found!
Abort

[Product]
AskKillProcesses 900, FIREFOX
#Set:Product
-AskKillProcesses 900, FIREFOX
#CopyNewUsersProfile,ADMIN CLIENT 

[Set:Product]
;Checke. ob FF installiert ist, wenn nein, Ende, wenn ja, checke, ob schon einmal das neue Profil kopiert wurde.
If DoesFileExist("C:\Program Files\Mozilla Firefox\firefox.exe") == "1" Then "FirefoxExist" Else AllIsDone

[FirefoxExist]
;Wenn das neue Profil bereits schon einmal kopiert wurde (erkennbar an der "BD.txt"), dann springe direkt zur Prüfung des Userprofils, ansonsten kopiere erst einmal das neue All-Users Default Profile
If DoesFileExist("C:\Program Files\Mozilla Firefox\browser\defaults\profile\BD.txt") == "1" Then "CheckUsersProfile" Else "CopyNewDefaultProfile" Endif	

[CheckUsersProfile]
;Prüfe, ob der angemeldete User ein FF-Profil hat, wenn ja, wechsle in den Abschnitt zum aktualisieren des Userprofils
If DoesFileExist ("%AppData%\Mozilla\FireFox\profiles.ini") == "1" Then "CopyNewUsersProfile" Else AllIsDone Endif

[CopyNewDefaultProfile]
;Hier wird das Default-Profil des FF aktualisiert
MkDir "%App%\Defaults"
Copy "%SRC%\Defaults\*.*" "%App%\Defaults" /S /D
Copy "%App%\Defaults\*.*" %MozDefaultProfile% /S /D

[CopyNewUsersProfile]
;Hier wird das Userprofil aktualisiert.
;Wenn kein Userprofil vorhanden ist, mache nichts.
If DoesFileExist ("%AppData%\Mozilla\FireFox\profiles.ini") == "0" Then AllIsDone Endif
;Wenn doch ein Userprofil vorhanden ist, schreibe den Zufallsnamen des Mozialla-Profils in eine txt-Datei
Callhidden cmd.exe /c dir %AppData%\Mozilla\Firefox\Profiles /B > "%AppData%\Mozilla\Firefox\%username%_ProfilePath.txt"
;Lies den inhalt der txt-Datei aus und schreibe ihn in Variable "ProfName"
Set ProfName=ReadTextFile ("%AppData%\Mozilla\Firefox\%username%_ProfilePath.txt")
ReplaceEnv ProfName
;Fülle eine weitere Variable "MozPath" mit dem kompletten Pfad des FF-Userprofils
Set MozPath=%AppData%\Mozilla\Firefox\Profiles\%ProfName%\
ReplaceEnv MozPath
;Kopiere die benötigten Files in den richtigen Pfad
Copy "C:\Program Files\Firefox ESR Profile Update\Defaults\profile\cert8.db" "%MozPath%\"
Copy "C:\Program Files\Firefox ESR Profile Update\Defaults\profile\cert_override.txt" "%MozPath%\"
Copy "C:\Program Files\Firefox ESR Profile Update\Defaults\profile\adblockplus\*.*" "%MozPath%\adblockplus\"
Copy "C:\Program Files\Firefox ESR Profile Update\Defaults\profile\extensions\*.*" "%MozPath%\extensions\"
;Versuch, auf andere Art und Weise zu kopieren
1:"C:\Program Files\Firefox ESR Profile Update\Defaults\profile\cert8.db", "%MozPath%", ALWAYS BACKUP USEFILENAME NOSIZEWARNING, 0
1:"C:\Program Files\Firefox ESR Profile Update\Defaults\profile\cert_override.txt", "%MozPath%", ALWAYS BACKUP USEFILENAME NOSIZEWARNING, 0

[AllIsDone]
Exit

Rene
Posts: 474
Joined: 26. May 2005, 11:16
Location: Zürich
Contact:

Re: Wieso wird nicht kopiert?

Post by Rene » 18. Nov 2014, 08:59

Passiert das nur auf 64bit Systemen oder auch auf 32bit Systemen ?
Ich habe ein ähnlich gelagertes Problem, dass irgendwie auf 64bit Systemen einige Systemvariable (vorzüglich %AppData% oder %LocalAppData%) nich aufgelöst werden.

knivel
Posts: 19
Joined: 29. Nov 2012, 09:45
Contact:

Re: Wieso wird nicht kopiert?

Post by knivel » 18. Nov 2014, 09:04

Moin,
imo versuchen ich das nur auf 32bit. 64bit ist bei uns noch nicht in der Softwareverteilung :(
Grüße aus HH

knivel
Posts: 19
Joined: 29. Nov 2012, 09:45
Contact:

Re: Wieso wird nicht kopiert?

Post by knivel » 18. Nov 2014, 18:56

Huhu,
bis jetzt scheitern alle Versuche, über Empirum in ein Verzeichnis mit "." Punkt zu kopieren.

Vom Support gab's noch den Tipp, es evtl. per Batch zu probieren, aber das will auch nicht so recht.

Ich kann 4 Einzelbefehle auf der Kommandozeile ausführen, die alles kopieren, was ich brauch. Jedoch als Batch, die ich dann über Empirum im Userkontext aufrufen könnte, will es nicht.

An bei die Einzelbefehle, wer kann daraus eine lauffähige Batch zaubern? *pls*

Code: Select all


# Wechsle in das Userverzeichnis, in dem die von Empirum abgelegte txt-Datei liegt, in der der zufällige Name des Firefox-User-Profils steht 

CD /D "%AppData%\Mozilla\Firefox"

# lies die txt-Datei aus und wechsle in das Verzeichnis mit dem Zufallsnamen, zB. "xxxxxxxx.default"

for /f %f IN (ProfilePath.txt) DO CD /D profiles\%f

# Schreibe den kompletten Pfad in eine Variable, hier: mozpa

set mozpa=%cd%

# kopiere die benötigten Aktualisierungsfiles

xcopy "%programfiles%\Firefox ESR Profile Update\Userdefaults\*.*" "%mozpa%" /S /E /R /F /Y

TPrummer
Posts: 36
Joined: 20. Apr 2011, 15:03
Contact:

Re: Wieso wird nicht kopiert?

Post by TPrummer » 19. Nov 2014, 13:25

Hallo,

ich habe das ganze mal so gelöst, mittlerweile mache ich aber alles via Machinenteil.
Wie du in [CreateProfile] sehen kannst ist das kopieren mit Punkten kein Problem.

;prüfe ob es schon ein Userprofil gibt
set V_Profilesini=%AppData%\Mozilla\Firefox\profiles.ini
If DoesFileExist ("%V_Profilesini%") == "0" Then "CreateProfile" EndIf

;Profilename herausfinden
If DoesTextInFileExist ("user.default","%V_Profilesini%") == "0" Then "ProfileName" EndIf

[CreateProfile]
set V_ProfileName=user.default
If DoesTextInFileExist ("user.default","%V_Profilesini%") == "0" Then "Ini:Profiles" EndIf
;sessionstore.js wird benötigt, damit man Firefox überhaupt starten kann.
1:%APP%\sessionstore.js,"%AppData%\Mozilla\Firefox\profiles\%V_ProfileName%\sessionstore.js",CLIENT REPLACEVARS,0

[ProfileName]
;ermittelt den Profilnamen
set V_ProfileNameLang=%%%V_Profilesini%,Profile0,Path%%
ReplaceEnv V_ProfileNameLang
; führendes "Profiles/" abschneiden
set V_ProfileName = RemoveFromLeft ("%V_ProfileNameLang%", 9)
ReplaceEnv V_ProfileName
;benennt das Profilesverzeichnis um
Rename "%AppData%\Mozilla\Firefox\Profiles\%V_ProfileName%" "%AppData%\Mozilla\Firefox\Profiles\user.default"
sleep 1000
;passt die Profilesini an und tauscht den Pfad aus.
If DoesTextInFileExist ("user.default","%V_Profilesini%") == "0" Then "Ini:Profiles" EndIf

[Ini:Profiles]
"%V_Profilesini%","General",,"StartWithLastProfile=1"
"%V_Profilesini%","Profile0",,"Name=default"
"%V_Profilesini%","Profile0",,"IsRelative=1"
"%V_Profilesini%","Profile0",,"Path=Profiles/user.default"

Beste Grüße,
Tom

knivel
Posts: 19
Joined: 29. Nov 2012, 09:45
Contact:

Re: Wieso wird nicht kopiert?

Post by knivel » 20. Nov 2014, 09:08

Hi Tom,

auch eine schöne Lösung :)

Mittlerweile (dank Hilfe aus dem Support) kam ich zu dieser Lösung:

Code: Select all


[SetupInfo]
Author                  = ...
CreationDate            = 12.11.2014 14:00
InventoryID             = 
Description             = Mozilla Firefox ESR Profile Update
Method                  = manuell
Tested on               = Win7 x86
Dependencies            = 
Command line options    = /S1 /AW
Last Change             = 12.11.2014 14:00
Build                   = 0

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

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

[Requirements]

[Application]
ProductName=Firefox ESR Profile Update
DeveloperName=Mozilla
Version=0
Revision=0
SetupName=%ProductName% %Version% %SetupWizard%
Text1="%ProductName%",                                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,0,BOTTOM LEFT ITALIC
BackgroundColor=EFEFEF,000000
CopyDialogRect=0%, 0%, 100%, 100%, HCENTER VCENTER
UserKeyName=%DeveloperName%\%ProductName%
MachineKeyName=%DeveloperName%\%ProductName%\%Version%
UninstallKeyName=%DeveloperName% %ProductName% %Version%
UninstallDisplayName=%ProductName% %Version%
UninstallString=%ReinstallString% /U
ReinstallString="%CommonSetupDir%\Setup.exe" "%App%\%SetupInfDir%\Setup.inf"
ReinstallMode=1
SrcDir=..
ApplicationDir=%ProgramFilesDir%\%ProductName%
SetupInfDir=Install
DataDir=%Personal%
AskUninstallOld=1
ShellLinks=1
CommonShellLinks=0
CreateUnresolvableShellLinks=1
UseStringSection=Strings:09
UseSysStringSection=SysStrings:09
DateWarning=1
SizeWarning=0
Reboot=2
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

[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

[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%

MozDefaultProfile=%ProgramFilesDir%\Mozilla Firefox

[Encryption]

[Processes]
FIREFOX=Firefox.exe, Mozilla Firefox, KILLPROCESS ABORT

[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:%SetupInfDir%\Setup.inf,                             , NORMAL,                                             0
1:%Temp%\Setup64.exe,                  %CommonSetupDir%\Setup.exe, OPTIONAL NOSIZEWARNING SETUP ALWAYS WINDOWS64,      0

[FileCheckMachine]
ReplaceEnv V_MachineValuesPath
If DoesFileExist ("%V_MachineValuesPath%\%ComputerName%.ini") == "0" Then "FileIsntThere" EndIf

[FileCheckClient]
ReplaceEnv V_UserValuesPath
If "%UserDomain%" <> "%ComputerName%" Then "CheckClientFile" EndIf

[CheckClientFile]
If DoesFileExist ("%V_UserValuesPath%\%WindowsUser%.ini") == "0" Then "FileIsntThere" EndIf

[FileIsntThere]
ErrorLogMsg Values$\MachineValues\%DomainName%\%ComputerName%.ini or Values$\UserValues\%UserDomain%\%WindowsUser%.ini not found!
Abort

[Product]
AskKillProcesses 900, FIREFOX
#Set:Product, MACHINE
-AskKillProcesses 900, FIREFOX
#CheckUsersProfile, CLIENT

[Set:Product]
;Checke. ob FF installiert ist. Wenn nein, dann Ende. Wenn ja, dann checke unter FirefoxExist, ob schon einmal das neue default Profil kopiert wurde, nur erkkennbar an der dafür erzeugten BD.txt
If DoesFileExist("%ProgramFilesDir%\Mozilla Firefox\firefox.exe") == "1" Then "FirefoxExist" Else "AllIsDone" Endif	

[FirefoxExist]
; Wenn die BD.txt (leere Textdatei) nicht vorhanden ist, kopiere das neue Default Profile
If DoesFileExist("%ProgramFilesDir%\Mozilla Firefox\browser\defaults\profile\BD.txt") == "0" Then "CopyNewDefaultProfile" Endif

[CheckUsersProfile]
;Wird bei jeder Useranmeldung einmal ausgeführt und prüft, ob es ein Userprofil beim angemeldeten User gibt, wenn ja, kopiere die neue Files
If DoesFileExist ("%AppData%\Mozilla\Firefox\profiles.ini") == "1" Then "CopyNewUsersProfile" Else AllIsDone Endif	

[CopyNewDefaultProfile]
;Maschinenteil
;1. Kopiere den Inhalt von %SRC% in das Verzeichnis %APP%, damit die Files dauerhaft für CopyJobs zur Verfügung stehen.
1:,  %App%\defaults,            CREATE DIRECTORY,        0
Copy "%SRC%\Defaults\*.*" "%App%\Defaults\" /S /D
1:,  %App%\Userdefaults,            CREATE DIRECTORY,        0
Copy "%SRC%\Userdefaults\*.*" "%App%\Userdefaults\" /S /D
;2. erzeuge die Unterverzeichnisse (so noch nicht vorhanden) und kopiere die Default-Dateien in den Programmpfad des Firefox
1:,  "%MozDefaultProfile%\browser\defaults",            CREATE DIRECTORY,        0
Copy "%App%\Defaults\*.*" "%MozDefaultProfile%\browser\defaults\" /S /D
1:,  "%MozDefaultProfile%\defaults",            CREATE DIRECTORY,        0
Copy "%App%\Defaults\*.*" "%MozDefaultProfile%\defaults\" /S /D


[CopyNewUsersProfile]
;Userteil
;Wenn kein Userprofil vorhanden ist, mache nichts.
If DoesFileExist ("%AppData%\Mozilla\FireFox\profiles.ini") == "0" Then AllIsDone Endif
;Wenn doch ein Userprofil vorhanden ist, schreibe den Zufallsnamen des Mozialla-Profils in eine txt-Datei
Callhidden cmd.exe /c dir %AppData%\Mozilla\Firefox\Profiles /B > "%AppData%\Mozilla\Firefox\ProfilePath.txt"
;Lies den inhalt der txt-Datei aus und schreibe ihn in die Variable %ProfName%
Set ProfName=ReadTextFile ("%AppData%\Mozilla\Firefox\ProfilePath.txt")
ReplaceEnv ProfName
;Fülle eine weitere Variable %MozPath% mit dem kompletten Pfad des FF-Userprofils
Set MozPath=%AppData%\Mozilla\Firefox\Profiles\%ProfName%
ReplaceEnv MozPath
ErrorLogMsg Mozilla User-Profil Pfad lautet: %MozPath%
;Kopiere die benötigten Files in den richtigen Pfad
Copy "%App%\Userdefaults\*.*" "%MozPath%" /S /D

[AllIsDone]
Exit

Danke für die Tipps

User avatar
bboehm
Posts: 569
Joined: 07. Apr 2008, 18:47
Location: München
Contact:

Re: Wieso wird nicht kopiert?

Post by bboehm » 12. Dec 2014, 09:04

Guten Morgen,

Sehr interessanter Beitrag! Wir haben auch einige Pakete, wo für den Benutzer Dateien kopiert werden (Lizenzfiles, etc...). Letzte Woche haben wir nun bemerkt, dass es damit Probleme (vermutlich seit Patch 7 eingespielt wurde) gibt und wir darauf gleich einige Störfälle hatten. Jedenfalls ist das Verhalten mit unserem Testserver, der bereits auf Patch 9 ist, identisch.

Hier ein kurzer Auszug aus einem Paket von uns, wie es früher immer funktioniert hat:

Code: Select all

#Set:CopyUser, CLIENT

[Set:CopyUser]
Copy "%SRC%\config\Common.dat3" "%APPDATA%\Swiss Academic Software\Common.dat3"
Copy "%SRC%\config\StartupSettings4.xml" "%APPDATA%\Swiss Academic Software\StartupSettings4.xml"
Die Lösung, dass die Dateien wieder z.B. in das jeweilige Userprofil kopiert werden, ist genau der Beitrag http://www.matrix42.de/forum/viewtopic. ... 098#p55098 in diesem Thread.

Hier die Zusammenfassung bzw. wie wir es schlussendlich gelöst haben:

Code: Select all

#Set:Product, DONTDELETE
#Set:CopyUser, CLIENT

[Set:Product]
1:,  %App%\Config,            CREATE DIRECTORY,        0
Copy "%SRC%\Config\*.*" "%App%\Config\" /S /D

[Set:CopyUser]
Copy "%App%\Config\*.*" "%APPDATA%\Swiss Academic Software\" /S /D
Schöne Grüße
Bernhard
IT-Administrator mit Migrationshintergrund bei Fraunhofer-Gesellschaft

Produktionssystem: W2k22, Empirum 23.0.1, MS SQL 2017 Enterprise
Testsystem: W2k19, Empirum 23.0.1, MS SQL 2017 Express

Post Reply

Return to “Paketierung”

Who is online

Users browsing this forum: Ahrefs [Bot] and 9 guests