GetRegistryStringValue
Verfasst: 20 Mai 2011, 09:11
Moin zusammen,
es ergibt sich folgende Schwierigkeit:
Bei dem Versuch den Adobe Reader 10.0.1 zu deinstallieren scheint das Auslesen der Registry nicht ganz hinzuhauen (nach meiner derzeitigen Auffassungsgabe).
Was der Testlauf mit winst32.exe ergibt ist Folgendes:
Hat jemand einen Rat oder sogar ein fertiges Skript für die Deinstallation von Adobe Reader X ?
Vielen Dank und Gruß,
Maddin
es ergibt sich folgende Schwierigkeit:
Bei dem Versuch den Adobe Reader 10.0.1 zu deinstallieren scheint das Auslesen der Registry nicht ganz hinzuhauen (nach meiner derzeitigen Auffassungsgabe).
Code: Alles auswählen
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
DefVar $MsiId$
Message "Deinstalliere Adobe Reader 10 ..."
; Acrobat Reader 10.0 - DEU
Set $MsiId$ = '{AC76BA86-7AD7-1033-7B44-AA0000000001}'
if not (GetRegistryStringValue("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId$ + "] DisplayName") = "")
comment "MSI id " + $MsiId$ + " found in registry, starting msiexec to uninstall"
Winbatch_uninstall_msi
sub_check_exitcode
endif
[Winbatch_uninstall_msi]
msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress "$LogDir$\$ProductId$.delete-adobereader-x-log.txt"
[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 message is 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 message is indicative of a success."
else
logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
isFatalError
endif
endif
endif
endif
Code: Alles auswählen
[1] [20.05.2011 09:08:28] opsi-winst 4.10.8.15 started at 20.05.2011 08:53:41
[1] [20.05.2011 09:08:28]
[1] [20.05.2011 09:08:28] ============ Version 4.10.8.15 WIN32 script "C:\tmp\adobereader-x\delsub.ins"
[1] [20.05.2011 09:08:28] start: 2011-05-20 09:08:28
[1] [20.05.2011 09:08:28] on client named "PCMZ41"
[1] [20.05.2011 09:08:28] user account "Administrator"
[1] [20.05.2011 09:08:28] [executing: "C:\Program Files\opsi.org\opsi-client-agent\opsi-winst\winst32.exe"]
[1] [20.05.2011 09:08:28] system infos:
[1] [20.05.2011 09:08:28] 00:1B:FC:FB:E2:D8 - PC hardware address
[1] [20.05.2011 09:08:28] PCMZ41.ver.local - IP name
[1] [20.05.2011 09:08:28] 192.168.42.32 - IP address
[1] [20.05.2011 09:08:28] DEU - System default locale
[1] [20.05.2011 09:08:28]
[6] [20.05.2011 09:08:28] Registry key [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion] opened
[6] [20.05.2011 09:08:28] Key closed
[1] [20.05.2011 09:08:28] ___________________
[1] [20.05.2011 09:08:28] script finished
[1] [20.05.2011 09:08:28] 0 errors
[1] [20.05.2011 09:08:28] 0 warnings
[1] [20.05.2011 09:08:28]
[1] [20.05.2011 09:08:28]
[6] [20.05.2011 09:08:28] Delete "c:\tmp\_winstbat_*"
[6] [20.05.2011 09:08:28] Search "c:\tmp\"
Vielen Dank und Gruß,
Maddin