Registrywerte mit übergeben

Antworten
dslthomas
Beiträge: 86
Registriert: 26 Mär 2012, 15:49

Registrywerte mit übergeben

Beitrag von dslthomas »

Moin, Moin,

nachdem ich nun seit Montag morgen ausschließlich damit beschäftigt bin den Teamviewer irgend wie in Opsi einzupflegen und es doch nicht hin bekomme, muss ich einfach jetzt hier fragen:

Mit dem Opsi-Setup-Detektor habe ich den Teamviewer ruck-zuck installiert bekommen. Allerdings kann man dem Teamviewer auch exportierte Einstellungen in Form von Registry-werten mit übergeben. Genau hier scheitere ich. Ich habe die Handbücher und das Forum hoch und runter gelesen.

Versucht habe ich das hier:

Code: Alles auswählen

[winbatch_regedit]
"%SystemRoot%\system32\regedit.exe" /s "%ScriptPath%\TeamViewer_Settings.reg"
und das hier:

Code: Alles auswählen

[Registry_install]

openkey [HKEY_CURRENT_USER\SOFTWARE\WOW6432Node\TeamViewer]
set "MinimizeToTray"=dword:00000001
oder das hier:

Code: Alles auswählen

registry loadUnicodeTextFile("%scriptpath%/TeamViewer_Settings.reg") /regedit
nicht funktioniert!

Code: Alles auswählen

; ----------------------------------------------------------------
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/en/credits/
; ----------------------------------------------------------------

;****************************************
; SETUPTYPE      msi
;****************************************
; PRODUCTID      teamviewer-13
; SETUPFILE      TeamViewer.msi
;****************************************
; LICENSE        false     
; PRODUCTDESC    TeamViewer 13

; PRODUCTNAME    TeamViewer 13
; PRODUCTSIZE    122 MB
; PRODUCTVER     13.2.14327
;****************************************
; SETUPSCRIPT    setup.opsiscript
; UNINSSCRIPT    uninstall.opsiscript
;****************************************
; MSIID          {2643D545-C819-4E31-9078-8BA0277AA05C}
; USE-MST        
; INSTALLDIR     (not used)
;****************************************
; TIMESTAMP      11.09.2018 08:32:49
;****************************************

[Actions]
requiredWinstVersion >= "4.11.4.3"
ScriptErrorMessages = false

DefVar $SetupType$
DefVar $ProductId$ 
DefVar $Setupfile$ 
DefVar $InstallDir$
DefVar $MinimumSpace$
DefVar $ExitCode$
DefVar $ErrorMsg$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $MsiId$
DefVar $NsisInstallBatch$
DefVar $LogDir$

Set $LogDir$ = "%opsiLogDir%"

include_append "%ScriptPath%\check_msi_exitcode.opsiscript"

; ----------------------------------------------------------------
Set $SetupType$       = "msi"
; ----------------------------------------------------------------

; $ProductId$ is the name of the product in opsi, only lower letters, no umlauts, no white spaces, use '-' as a seperator
Set $ProductId$       = "teamviewer-13"
Set $Setupfile$       = "TeamViewer.msi"
; the path where we find the product after the installation
Set $InstallDir$      = "(not used)"
Set $LicenseRequired$ = "false"
Set $LicensePool$     = "p_" + $ProductId$
Set $MsiId$           = "{2643D545-C819-4E31-9078-8BA0277AA05C}"
Set $MinimumSpace$    = "122 MB"
; ----------------------------------------------------------------
; ----------------------------------------------------------------

if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
   LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
   isFatalError "No Space"
   ; Stop process and set installation status to failed
else
   comment "Show product picture"
   ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$

   if FileExists("%ScriptPath%\delsub.opsiscript")
      comment "Start uninstall sub section"
      Sub "%ScriptPath%\delsub.opsiscript"
   endif
   
   Message "Installing " + $ProductId$ + " ..."
   
   if $LicenseRequired$ = "true"
      comment "Licensing required, reserve license and get license key"
      Sub_get_licensekey
   endif

   
   comment "Start setup program"
   ChangeDirectory "%SCRIPTPATH%"
   ;----------------------------------------------
   Winbatch_install_msi
   ;----------------------------------------------
   Sub_check_exitcode	
endif

; ----------------------------------------------------------------
; install section
; ----------------------------------------------------------------

[Winbatch_install_msi]
msiexec /i "%ScriptPath%\TeamViewer.msi"  /l* "$LogDir$\$ProductId$.install_log.txt" /qb-! ALLUSERS=1 REBOOT=ReallySuppress

registry loadUnicodeTextFile("%scriptpath%/TeamViewer_Settings.reg") /regedit

[Sub_get_licensekey]
if opsiLicenseManagementEnabled
   comment "License management is enabled and will be used"

   comment "Trying to get a license key"
   Set $LicenseKey$ = demandLicenseKey ($LicensePool$)
   ; If there is an assignment of exactly one licensepool to the product the following call is possible:
   ; Set $LicenseKey$ = demandLicenseKey ("", $ProductId$)
   ;
   ; If there is an assignment of a license pool to a windows software id, it is possible to use:
   ; DefVar $WindowsSoftwareId$
   ; $WindowsSoftwareId$ = "..."
   ; Set $LicenseKey$ = demandLicenseKey ("", "", $WindowsSoftwareId$)

   DefVar $ServiceErrorClass$
   set $ServiceErrorClass$ = getLastServiceErrorClass
   comment "Error class: " + $ServiceErrorClass$
   
   if $ServiceErrorClass$ = "None"
      comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
   else
      if $ServiceErrorClass$ = "LicenseConfigurationError"
         LogError "Fatal: license configuration must be corrected"
         LogError getLastServiceErrorMessage
         isFatalError
      else 
         if $ServiceErrorClass$ = "LicenseMissingError"
            LogError "Fatal: required license is not supplied"
            isFatalError
         endif
      endif
   endif
else
   LogError "Fatal: license required, but license management not enabled"
   isFatalError
endif

; ----------------------------------------------------------------
; ----------------------------------------------------------------

Kann mir hier jemand nen Tipp geben was ich falsch mache? Einzig wenn ich die TeamViewer_Settings.reg direkt auf dem System ausführe,- dann funktioniert das.

Danke und Gruß aus Hamburg
thomas.besser
Beiträge: 455
Registriert: 09 Sep 2009, 09:40

Re: Registrywerte mit übergeben

Beitrag von thomas.besser »

Ohne ein Logfile der entsprechenden nicht funktionierenden Aktionen wird dir keiner helfen können.
AlexB
Beiträge: 80
Registriert: 07 Mär 2017, 17:41

Re: Registrywerte mit übergeben

Beitrag von AlexB »

Servus,

du installierst als User SYSTEM. Du musst für jeden einzelnen User den Zweig "HKCU" aufrufen und ihn patchen.
Wie auch in der Doku hier beschrieben:
https://download.uib.de/opsi_stable/doc ... -allntuser

VG
Benutzeravatar
SisterOfMercy
Beiträge: 1522
Registriert: 22 Jun 2012, 19:18

Re: Registrywerte mit übergeben

Beitrag von SisterOfMercy »

Code: Alles auswählen

Registry_install_AllProfiles /AllNTUserDats

[Registry_install_AllProfiles]
openkey [HKEY_CURRENT_USER\Software\TeamViewer]
set "LastCorrectorRun" = REG_DWORD:00000001
set "WhatsNewShown" = REG_DWORD:00000002
set "IntroShown" = REG_DWORD:00000001
Something like this. HKEY_CURRENT_USER doesn't have much to do with WOW6432Node.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Antworten