ERLEDIGT: Löschen von Registry-Einträgen schlägt fehl!

Antworten
JMS
Beiträge: 94
Registriert: 22 Nov 2010, 12:05

ERLEDIGT: Löschen von Registry-Einträgen schlägt fehl!

Beitrag von JMS »

Hallo zusammen,

ich habe bei meinen Clients das Problem, dass zwar meine Anweisungen, Einträge aus der Registry zu löschen, laut inst.log ausgeführt werden...

Code: Alles auswählen

[5] [Feb 22 11:44:27:591]   Execution of registry_wipe
[6] [Feb 22 11:44:27:591]       Registry key [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0]  opened
[6] [Feb 22 11:44:27:591]         Key closed
[6] [Feb 22 11:44:27:591]         Registry key [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\Workflows]  opened
[6] [Feb 22 11:44:27:591]         Key closed
[6] [Feb 22 11:44:27:591]         Registry key [HKEY_CURRENT_USER\]  opened
[6] [Feb 22 11:44:27:591]         Software\Adobe\Acrobat Reader\11.0\Workflows deleted
[6] [Feb 22 11:44:27:591]         Key closed
[6] [Feb 22 11:44:27:591]       Registry key [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0]  opened
[6] [Feb 22 11:44:27:591]         Key closed
[6] [Feb 22 11:44:27:592]         Registry key [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\Security]  opened
[6] [Feb 22 11:44:27:592]           Key closed
[6] [Feb 22 11:44:27:592]           Registry key [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\Security\cDigSig]  opened
[6] [Feb 22 11:44:27:592]             Key closed
[6] [Feb 22 11:44:27:592]             Registry key [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\Security\cDigSig\cAdobeDownload]  opened
[6] [Feb 22 11:44:27:592]             Key closed
[6] [Feb 22 11:44:27:592]             Registry key [HKEY_CURRENT_USER\]  opened
[6] [Feb 22 11:44:27:592]             Software\Adobe\Acrobat Reader\11.0\Security\cDigSig\cAdobeDownload deleted
[6] [Feb 22 11:44:27:592]             Key closed
[6] [Feb 22 11:44:27:592]           Registry key [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\Security\cDigSig]  opened
[6] [Feb 22 11:44:27:592]           Key closed
[6] [Feb 22 11:44:27:592]           Registry key [HKEY_CURRENT_USER\]  opened
[6] [Feb 22 11:44:27:592]           Software\Adobe\Acrobat Reader\11.0\Security\cDigSig deleted
[6] [Feb 22 11:44:27:592]           Key closed
[6] [Feb 22 11:44:27:592]         Registry key [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\Security]  opened
[6] [Feb 22 11:44:27:592]         Key closed
[6] [Feb 22 11:44:27:592]         Registry key [HKEY_CURRENT_USER\]  opened
[6] [Feb 22 11:44:27:592]         Software\Adobe\Acrobat Reader\11.0\Security deleted
[6] [Feb 22 11:44:27:592]         Key closed
[6] [Feb 22 11:44:27:592]       Registry key [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0]  opened
[6] [Feb 22 11:44:27:592]         Key closed
[6] [Feb 22 11:44:27:592]         Registry key [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\InstallPath]  opened
[6] [Feb 22 11:44:27:592]         Key closed
[6] [Feb 22 11:44:27:592]         Registry key [HKEY_CURRENT_USER\]  opened
[6] [Feb 22 11:44:27:592]         Software\Adobe\Acrobat Reader\11.0\InstallPath deleted
[6] [Feb 22 11:44:27:592]         Key closed
[6] [Feb 22 11:44:27:592]       Registry key [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0]  opened
[6] [Feb 22 11:44:27:592]         Key closed
[6] [Feb 22 11:44:27:592]         Registry key [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\Installer]  opened
[6] [Feb 22 11:44:27:592]         Key closed
[6] [Feb 22 11:44:27:592]         Registry key [HKEY_CURRENT_USER\]  opened
[6] [Feb 22 11:44:27:592]         Software\Adobe\Acrobat Reader\11.0\Installer deleted
[6] [Feb 22 11:44:27:592]         Key closed
[6] [Feb 22 11:44:27:592]       Registry key [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0]  opened
[6] [Feb 22 11:44:27:592]         Key closed
[6] [Feb 22 11:44:27:592]         Registry key [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\AdobeViewer]  opened
[6] [Feb 22 11:44:27:592]         Key closed
[6] [Feb 22 11:44:27:592]         Registry key [HKEY_CURRENT_USER\]  opened
[6] [Feb 22 11:44:27:593]         Software\Adobe\Acrobat Reader\11.0\AdobeViewer deleted
[6] [Feb 22 11:44:27:593]         Key closed
[6] [Feb 22 11:44:27:593]       Registry key [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0]  opened
[6] [Feb 22 11:44:27:593]       Key closed
[6] [Feb 22 11:44:27:593]       Registry key [HKEY_CURRENT_USER\]  opened
[6] [Feb 22 11:44:27:593]       Software\Adobe\Acrobat Reader\11.0 deleted
[6] [Feb 22 11:44:27:593]       Key closed
[6] [Feb 22 11:44:27:593]   Section ending since next line is starting with "["
... doch der anschließende Blick in die Registry zeigt, dass noch alles da ist...

Ich kann mir nicht vorstellen, dass ich was falsch mache, denn ansonsten stünde das ja im Log, oder? Oder logt OPSI falsch?

Grüße

JMS


OPSI auf Server und Winst etc. pp. auf Clients ist die aktuelle Version, gerade eben noch mal geprüft...
Zuletzt geändert von JMS am 24 Feb 2013, 14:29, insgesamt 1-mal geändert.
Benutzeravatar
SisterOfMercy
Beiträge: 1524
Registriert: 22 Jun 2012, 19:18

Re: Löschen von Registry-Einträgen schlägt fehl!

Beitrag von SisterOfMercy »

Can you upload the script here?
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
JMS
Beiträge: 94
Registriert: 22 Nov 2010, 12:05

Re: Löschen von Registry-Einträgen schlägt fehl!

Beitrag von JMS »

Here wo go... this is my delsub.ins, injected several times by setup.ins & uninstall.ins (called several times, because of probably existing installations with different localized installers -> 1033,1031, 1034... etc. Thats's the way i try to scratch everting from disk)

Keep in mind: delsub is "stolen" from java-package... that's why there are probably some non-interesting and dead subs... still working on it...

Code: Alles auswählen

; *: muss hier deaktiviert werden, da dieses Unterskript mehrfach aufgerufen wird!
; * DefVar $MsiCode$
; * DefVar $DisplayName$
; * DefVar $UninstallCommand$

; ----------------------------------------------------------------
; - Produktbild UNINSTALL anzeigen		                 -
; ----------------------------------------------------------------
	comment "Show product picture"
	; Grafik max 160x160px
	ShowBitmap "%ScriptPath%\SPMS\" + "icon_uninst.png" $ProductName$

; ----------------------------------------------------------------
; - Ausnahmen, die beruecksichtigt werden sollen	         -
; ----------------------------------------------------------------
	; custom specific stuff
	if FileExists("%ScriptPath%\custom_ins_dir\prevent_uninstall.ins")
		sub "%ScriptPath%\custom_ins_dir\prevent_uninstall.ins"
	endif

; ----------------------------------------------------------------
; - Geoeffnete Programme beenden                                 -
; ----------------------------------------------------------------
;	if FileExists("%ScriptPath%\kill_apps.ins")
;		comment "Killing defined Applications..."
;		Sub "%ScriptPath%\kill_apps.ins"
;	endif


; ----------------------------------------------------------------
; - Hier beginnt die Suche in der Registry...                    -
; ----------------------------------------------------------------


; Deinstalliere Adobe Reader 9.3.1 - 9.3.4, sofern Eintrag in Registry vorhanden
Set $MsiCode$ = "{AC76BA86-7AD7-"+$MsiLangCode$+"-7B44-A93000000001}"
Set $DisplayName$ = GetRegistryStringValue ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiCode$+"] DisplayName")
if not ($DisplayName$ = "")
    Message $MSG_UNINSTALL$ + $DisplayName$
    Set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
    Winbatch_uninstall
    Message $MSG_CHECKEXITCODES$
    Sub_check_exitcode
endif
 
; Deinstalliere Adobe Reader 9.4.0, sofern Eintrag in Registry vorhanden
Set $MsiCode$ = "{AC76BA86-7AD7-"+$MsiLangCode$+"-7B44-A94000000001}"
Set $DisplayName$ = GetRegistryStringValue ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiCode$+"] DisplayName")
if not ($DisplayName$ = "")
    Message $MSG_UNINSTALL$ + $DisplayName$
    Set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
    Winbatch_uninstall
    Message $MSG_CHECKEXITCODES$
    Sub_check_exitcode
endif
 
; Deinstalliere Adobe Reader 10.0.x, sofern Eintrag in Registry vorhanden
Set $MsiCode$ = "{AC76BA86-7AD7-"+$MsiLangCode$+"-7B44-AA0000000001}"
Set $DisplayName$ = GetRegistryStringValue ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiCode$+"] DisplayName")
if not ($DisplayName$ = "")
    Message $MSG_UNINSTALL$ + $DisplayName$
    Set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
    Winbatch_uninstall
    Message $MSG_CHECKEXITCODES$
    Sub_check_exitcode
endif
 
; Deinstalliere Adobe Reader 10.1.x, sofern Eintrag in Registry vorhanden
Set $MsiCode$ = "{AC76BA86-7AD7-"+$MsiLangCode$+"-7B44-AA1000000001}"
Set $DisplayName$ = GetRegistryStringValue ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiCode$+"] DisplayName")
if not ($DisplayName$ = "")
    Message $MSG_UNINSTALL$ + $DisplayName$
    Set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
    Winbatch_uninstall
    Message $MSG_CHECKEXITCODES$
    Sub_check_exitcode
endif

; Deinstalliere Adobe Reader 11.0.x, sofern Eintrag in Registry vorhanden
Set $MsiCode$ = "{AC76BA86-7AD7-"+$MsiLangCode$+"-7B44-AB0000000001}"
Set $DisplayName$ = GetRegistryStringValue ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiCode$+"] DisplayName")
if not ($DisplayName$ = "")
    Message $MSG_UNINSTALL$ + $DisplayName$
    Set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
    Winbatch_uninstall
    Message $MSG_CHECKEXITCODES$
    Sub_check_exitcode
endif


; TEST: es müsste ja schon alles weg sein - ist es aber nicht! Daher jetzt die Brechstange:
registry_wipe

; ----------------------------------------------------------------
; - Hier Subs                                                    -
; ----------------------------------------------------------------

[registry_wipe]
deletekey [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0]


[sub_deinstall_with_retry]
Winbatch_sun_uninstall
set $ExitCode$ = getLastExitCode
if $ExitCode$ = "1618"
	sleepSeconds 10
	Winbatch_sun_uninstall
	set $ExitCode$ = getLastExitCode
	if $ExitCode$ = "1618"
		sleepSeconds 10
		Winbatch_sun_uninstall
		set $ExitCode$ = getLastExitCode
		if $ExitCode$ = "1618"
			sleepSeconds 10
			Winbatch_sun_uninstall 
			set $ExitCode$ = getLastExitCode
			if $ExitCode$ = "1618"
				sleepSeconds 10
				Winbatch_sun_uninstall 
				set $ExitCode$ = getLastExitCode
				if $ExitCode$ = "1618"
					sleepSeconds 10
					Winbatch_sun_uninstall
				endif
			endif
		endif
	endif
endif


[Winbatch_uninstall]
$UninstallCommand$

[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
	comment "Looks good: setup program gives exitcode zero"
else
	comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
	if ($ExitCode$ = "1605")
		comment "ERROR_UNKNOWN_PRODUCT	1605	This action is only valid for products that are currently installed."
		comment "Uninstall of a not installed product failed - no problem"
	else
		if ($ExitCode$ = "1641")
			comment "looks good: setup program gives exitcode 1641"
			comment "ERROR_SUCCESS_REBOOT_INITIATED	1641	The installer has initiated a restart. This commentis indicative of a success."
		else
			if ($ExitCode$ = "3010")
				comment "looks good: setup program gives exitcode 3010"
				comment "ERROR_SUCCESS_REBOOT_REQUIRED	3010	A restart is required to complete the install. This commentis indicative of a success."
			else
				logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
				isFatalError
			endif
		endif
	endif
endif
Because of the fact, registry-setting weren't deleted, i try to call the sub called "[registry_wipe]". This sub is executed and instlog says, that everything went fine.
Benutzeravatar
d.oertel
uib-Team
Beiträge: 3319
Registriert: 04 Jun 2008, 14:27

Re: Löschen von Registry-Einträgen schlägt fehl!

Beitrag von d.oertel »

Hi,

macht nicht das was Du erwartest.

Wenn Du in HKCU arbeiten willst lies hier:
http://download.uib.de/opsi4.0/doc/html ... -allntuser

gruß
d.oertel
opsi support - uib gmbh

For productive opsi installations we recommend support contracts.
http://www.uib.de
http://www.opsi.org
JMS
Beiträge: 94
Registriert: 22 Nov 2010, 12:05

Re: Löschen von Registry-Einträgen schlägt fehl!

Beitrag von JMS »

Hi Detlef,

den Abschnitt aus dem Handbuch habe ich schon auswendig gelernt und kann in in allen Sprachen "runterbeten". Dennoch bin ich schon wieder und zum x-ten mal über den Param AllNTUserdats gestolpert bzw. dem fehlerhaften instlog aufgesessen. Jetzt funktionierts natürlich... Asche auf mein Haupt...

AD "macht nicht das was Du erwartest."
Hab' ich gemerkt. ;-)
Die Meldungen im Log stimmen dann aber nicht: das instlog sagt, dass der Schlüssel gelöscht sei... ist er aber nicht.

Nochmals Danke

JMS


P.S: Wer das Snipplet (delsub.ins) sequentiell mehrfach verwenden will, muss den Aufruf [registry_wipe] in das aufrufende Sktipt (setup.ins oder uninstall.ins) packen ... anderenfalls wird der Registry-Key schon beim ersten Aufruf gelöscht. Es muss dann also so aussehen (setup.ins):

Code: Alles auswählen

; ----------------------------------------------------------------
; - Subroutine DEINSTALLATION aufrufen                           -
; ----------------------------------------------------------------
    Set $MSG_UNINSTALL$ = $MSG_UNINSTALLFIRST$
    Message $MSG_UNINSTALLFIRST$

    DefVar $MsiCode$
    DefVar $DisplayName$
    DefVar $UninstallCommand$

    if FileExists("%ScriptPath%\delsub.ins")
	ShowBitmap "%ScriptPath%\SPMS\" + "icon_uninst.png" $ProductName$
	comment "Start uninstall sub section"
	DefVar $MsiLangCode$

	; Installer Deutsch
	Set $MsiLangCode$ = "1031"
	Sub "%ScriptPath%\delsub.ins"

	; Installer Englisch
	Set $MsiLangCode$ = "1033"
	Sub "%ScriptPath%\delsub.ins"

	; Installer Franzoesisch
	Set $MsiLangCode$ = "1036"
	Sub "%ScriptPath%\delsub.ins"

	; Installer Italienisch
	Set $MsiLangCode$ = "1040"
	Sub "%ScriptPath%\delsub.ins"

	; Installer Spanisch
	Set $MsiLangCode$ = "1034"
	Sub "%ScriptPath%\delsub.ins"

	; Jetzt mit der Brechstange die Registry aufräumen
	registry_wipe /AllNTUserDats

    endif
Benutzeravatar
d.oertel
uib-Team
Beiträge: 3319
Registriert: 04 Jun 2008, 14:27

Re: ERLEDIGT: Löschen von Registry-Einträgen schlägt fehl!

Beitrag von d.oertel »

Hi,
Die Meldungen im Log stimmen dann aber nicht: das instlog sagt, dass der Schlüssel gelöscht sei... ist er aber nicht.
das ist so nicht richtig. HKCU ist im Gegensatz zu HKLM nicht unabhängig von der Situation. Aus Sicht des opsi-client-agent kann es sehr wohl ein HKCU geben aus dem er löscht, das ist aber nicht der in den Du später reinschaust.

gruß
d.oertel
opsi support - uib gmbh

For productive opsi installations we recommend support contracts.
http://www.uib.de
http://www.opsi.org
Antworten