ich möchte bei meinem ghostscript-Paket in der delsub.ins alle in einer Stringliste angegebenen Versionen prüfen und falls eine installiert ist, diese deinstallieren.Hier mein Ansatz:
Code: Alles auswählen
...
Set $Versionen$ = createStringlist('8.62','8.63','8.64')
set $regpfad$ = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghostscript "
for %Vers% in $Versionen$ do sub_install_version
[sub_install_version]
if not (GetRegistryStringValue("["+$regpfad$+"%Vers%] DisplayName") = "")
comment "Version %Vers% gefunden " found in registry, starting msiexec to uninstall"
Message "Found "+$ProductId$+"%Vers% => uninstalling first"
set $UninstallCommand$ = GetRegistryStringValue ("["+$regpfad$+"%Vers%] UninstallString")
Winbatch_uninstall
sub_check_exitcode
endif
[Winbatch_uninstall]
$UninstallCommand$ -q
[sub_check_exitcode]
...
Warum bekomme ich hier eine Warnung, daß die section "Winbatch_uninstall" nicht existiert?snip
[6] [02.02.2011 12:39:03] ~~~~~~ Looping through: '8.62', '8.63', '8.64
snip
[6] [02.02.2011 12:39:03] ~~~~~~~ Start Sub ~~~~~~~ sub_version
[5] [02.02.2011 12:39:03]
[5] [02.02.2011 12:39:03] If
[6] [02.02.2011 12:39:03] Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghostscript 8.64] opened
[6] [02.02.2011 12:39:03] Key closed
[5] [02.02.2011 12:39:03] GetRegistryStringValue("["+$regpfad$+"8.64] DisplayName") = "" <<< result false
[5] [02.02.2011 12:39:03] not (GetRegistryStringValue("["+$regpfad$+"8.64] DisplayName") = "") <<< result true
[5] [02.02.2011 12:39:03] Then
[5] [02.02.2011 12:39:03] comment: Version gefunden 8.64
[5] [02.02.2011 12:39:03] message Found Ghostscript8.64 => uninstalling first
[5] [02.02.2011 12:39:03]
[5] [02.02.2011 12:39:03] Set $UninstallCommand$ = GetRegistryStringValue ("["+$regpfad$+"8.64] UninstallString")
[6] [02.02.2011 12:39:03] Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghostscript 8.64] opened
[6] [02.02.2011 12:39:03] Key closed
[6] [02.02.2011 12:39:03] The value of the variable "$UninstallCommand$" is now: "C:\Programme\gs\uninstgs.exe "C:\Programme\gs\gs8.64\uninstal.txt""
[5] [02.02.2011 12:39:03]
[5] [02.02.2011 12:39:03] Warning: The section "Winbatch_uninstall" (called in line 5 of the calling section) does not exist or is empty
[5] [02.02.2011 12:39:03]
[4] [02.02.2011 12:39:03] Warning: Section "Winbatch_uninstall" does not exist or is empty
[5] [02.02.2011 12:39:03]
[5] [02.02.2011 12:39:03] Warning: The section "sub_check_exitcode" (called in line 6 of the calling section) does not exist or is empty
[6] [02.02.2011 12:39:03]
[6] [02.02.2011 12:39:03] ~~~~~~~ Start Sub ~~~~~~~ sub_check_exitcode
[6] [02.02.2011 12:39:03]
[6] [02.02.2011 12:39:03] ~~~~~~~ End Sub ~~~~~~~ sub_check_exitcode
lg
Bernhard Gerg