Ich habe damit ebenfalls Probleme...
Ich habe insgesamt folgende Files:
uninstall.ins
Code: Alles auswählen
Message = Removing software, please wait...
setLogLevel = 6
ExitOnError = false
ScriptErrorMessages = on
TraceMode = off
StayOnTop = false
[Actions]
sub "%ScriptPath%\product.ins"
sub "%ScriptPath%\subuninstall.ins"
product.ins
Code: Alles auswählen
DefVar $OS$
DefVar $NTVersion$
DefVar $ProductName$
DefVar $ProductGUID$
DefVar $ProductSize$
DefVar $ExitCode$
DefStringList $ProductGUIDlist$
set $OS$ = GetOS
set $NTVersion$ = GetNTVersion
Set $ProductName$ = "ArcGIS 9.3"
Set $ProductGUID$ = "{5033400B-0977-45AB-94CE-CC135A8E1BBB}"
Set $ProductGUIDlist$ = loadTextFile("%scriptpath%\guid.ini")
Set $ProductSize$ = "2GB"
ShowBitmap /3 "%scriptpath%\product.png" $ProductName$
subuninstall.ins
Code: Alles auswählen
DefVar $UninstallCommand$
DefVar $DisplayName$
for %guid% in $ProductGUIDlist$ do Sub_uninstmsi
[Sub_uninstmsi]
Set $DisplayName$ = GetRegistryStringValue32("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%guid%] DisplayName")
if $DisplayName$ = ""
Set $DisplayName$ = GetRegistryStringValue64("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%guid%] DisplayName")
endif
if not ($DisplayName$ = "")
Message "Removing "+$DisplayName$
set $UninstallCommand$ = "MsiExec.exe /x %guid% /qb-! REBOOT=ReallySuppress MSIRESTARTMANAGERCONTROL=Disable"
Winbatch_Uninstall
sub "%ScriptDrive%\_scripts\check_msi-exitcode.ins"
endif
[Winbatch_Uninstall]
$UninstallCommand$
Die Iteration funktioniert auch problemlos, nur habe ich das selbe Problem, dass die Winbatch-Section als leer erkannt wird (siehe nachfolgendes Log...)
Gibt es eine Möglichkeit, das anders zu lösen bzw. kennt jemand einen Trick wie ich die selbe Funktionalität anders realisieren könnte?
Ach zur Info: Das Konstrukt funktioniert ohne die for-Schleife problemlos

Danke & lg
LOG:
Code: Alles auswählen
[6] [06.11.2012 16:49:41] ~~~~~~~ Start Sub ~~~~~~~ sub "P:\arcgis93\subuninstall.ins"
[6] [06.11.2012 16:49:41] retrieving strings from $ProductGUIDlist$ [switch to loglevel 7 for debugging]
[6] [06.11.2012 16:49:41]
[6] [06.11.2012 16:49:41] ~~~~~~ Looping through: '{5033400B-0977-45AB-94CE-CC135A8E1BBB}', '{6D35038C-8A9F-4783-9A3C-BC778D3DD4EE}
[6] [06.11.2012 16:49:41]
[6] [06.11.2012 16:49:41] ~~~~~~~ Start Sub ~~~~~~~ Sub_uninstmsi
[5] [06.11.2012 16:49:41]
[5] [06.11.2012 16:49:41] Set $DisplayName$ = GetRegistryStringValue32("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5033400B-0977-45AB-94CE-CC135A8E1BBB}] DisplayName")
[6] [06.11.2012 16:49:41] Info: Registry key [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5033400B-0977-45AB-94CE-CC135A8E1BBB}] could not be opened by RegOpenKeyEx, Errorno 2 "Das System kann die angegebene Datei nicht finden.
"
[6] [06.11.2012 16:49:41] The value of the variable "$DisplayName$" is now: ""
[5] [06.11.2012 16:49:41]
[5] [06.11.2012 16:49:41] If
[5] [06.11.2012 16:49:41] $DisplayName$ = "" <<< result true
[5] [06.11.2012 16:49:41] Then
[5] [06.11.2012 16:49:41]
[5] [06.11.2012 16:49:41] Set $DisplayName$ = GetRegistryStringValue64("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5033400B-0977-45AB-94CE-CC135A8E1BBB}] DisplayName")
[6] [06.11.2012 16:49:41] Info: Registry key [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5033400B-0977-45AB-94CE-CC135A8E1BBB}] could not be opened by RegOpenKeyEx, Errorno 2 "Das System kann die angegebene Datei nicht finden.
"
[6] [06.11.2012 16:49:41] The value of the variable "$DisplayName$" is now: ""
[5] [06.11.2012 16:49:41] EndIf
[5] [06.11.2012 16:49:41]
[5] [06.11.2012 16:49:41] If
[5] [06.11.2012 16:49:41] $DisplayName$ = "" <<< result true
[5] [06.11.2012 16:49:41] not ($DisplayName$ = "") <<< result false
[5] [06.11.2012 16:49:41] Then
[5] [06.11.2012 16:49:41] EndIf
[6] [06.11.2012 16:49:41]
[6] [06.11.2012 16:49:41] ~~~~~~~ End Sub ~~~~~~~ Sub_uninstmsi
[6] [06.11.2012 16:49:41]
[6] [06.11.2012 16:49:41]
[6] [06.11.2012 16:49:41] ~~~~~~~ Start Sub ~~~~~~~ Sub_uninstmsi
[5] [06.11.2012 16:49:41]
[5] [06.11.2012 16:49:41] Set $DisplayName$ = GetRegistryStringValue32("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6D35038C-8A9F-4783-9A3C-BC778D3DD4EE}] DisplayName")
[6] [06.11.2012 16:49:41] Registry key [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6D35038C-8A9F-4783-9A3C-BC778D3DD4EE}] opened
[6] [06.11.2012 16:49:41] Key closed
[6] [06.11.2012 16:49:41] The value of the variable "$DisplayName$" is now: "ArcGIS Desktop 9.3 - Deutsches Supplement"
[5] [06.11.2012 16:49:41]
[5] [06.11.2012 16:49:41] If
[5] [06.11.2012 16:49:41] $DisplayName$ = "" <<< result false
[5] [06.11.2012 16:49:41] Then
[5] [06.11.2012 16:49:41] EndIf
[5] [06.11.2012 16:49:41]
[5] [06.11.2012 16:49:41] If
[5] [06.11.2012 16:49:41] $DisplayName$ = "" <<< result false
[5] [06.11.2012 16:49:41] not ($DisplayName$ = "") <<< result true
[5] [06.11.2012 16:49:41] Then
[5] [06.11.2012 16:49:41] message Removing ArcGIS Desktop 9.3 - Deutsches Supplement
[5] [06.11.2012 16:49:41]
[5] [06.11.2012 16:49:41] Set $UninstallCommand$ = "MsiExec.exe /x {6D35038C-8A9F-4783-9A3C-BC778D3DD4EE} /qb-! REBOOT=ReallySuppress MSIRESTARTMANAGERCONTROL=Disable"
[6] [06.11.2012 16:49:41] The value of the variable "$UninstallCommand$" is now: "MsiExec.exe /x {6D35038C-8A9F-4783-9A3C-BC778D3DD4EE} /qb-! REBOOT=ReallySuppress MSIRESTARTMANAGERCONTROL=Disable"
[5] [06.11.2012 16:49:41]
[5] [06.11.2012 16:49:41] Warning: The section "Winbatch_Uninstall" (called in line 8 of the calling section) does not exist or is empty
[5] [06.11.2012 16:49:41]
[4] [06.11.2012 16:49:41] Warning: Section "Winbatch_Uninstall" does not exist or is empty
[6] [06.11.2012 16:49:41]
[6] [06.11.2012 16:49:41] ~~~~~~~ Start Sub ~~~~~~~ sub "P:\_scripts\check_msi-exitcode.ins"
[5] [06.11.2012 16:49:41]
[5] [06.11.2012 16:49:41] Set $ExitCode$ = getLastExitCode
[6] [06.11.2012 16:49:41] The value of the variable "$ExitCode$" is now: "0"
[5] [06.11.2012 16:49:41]
[5] [06.11.2012 16:49:41] If
[5] [06.11.2012 16:49:41] "arcgis93"="acad2010" <<< result false
[5] [06.11.2012 16:49:41] $ExitCode$="259" <<< result false
[5] [06.11.2012 16:49:41] ($ExitCode$="259") <<< result false
[5] [06.11.2012 16:49:41] ("arcgis93"="acad2010") AND ($ExitCode$="259") <<< result false
[5] [06.11.2012 16:49:41] Then
[5] [06.11.2012 16:49:41] EndIf
[1] [06.11.2012 16:49:41] LogLevel was 6
[1] [06.11.2012 16:49:41] LogLevel set to 4
[1] [06.11.2012 16:49:41] LogLevel was 4
[1] [06.11.2012 16:49:41] LogLevel set to 5
[5] [06.11.2012 16:49:41] comment: ExitCode = 0 Action completed successfully.
[1] [06.11.2012 16:49:41] LogLevel was 5
[1] [06.11.2012 16:49:41] LogLevel set to 4
[1] [06.11.2012 16:49:41] LogLevel was 4
[1] [06.11.2012 16:49:41] LogLevel set to 6
[6] [06.11.2012 16:49:41]
[6] [06.11.2012 16:49:41] ~~~~~~~ End Sub ~~~~~~~ sub "P:\_scripts\check_msi-exitcode.ins"
[6] [06.11.2012 16:49:41]
[5] [06.11.2012 16:49:41] EndIf
[6] [06.11.2012 16:49:41]
[6] [06.11.2012 16:49:41] ~~~~~~~ End Sub ~~~~~~~ Sub_uninstmsi
[6] [06.11.2012 16:49:41]
[6] [06.11.2012 16:49:41]
[6] [06.11.2012 16:49:41] ~~~~~~ End Loop
[6] [06.11.2012 16:49:41] Section ending since next line is starting with "["
[6] [06.11.2012 16:49:41]
[6] [06.11.2012 16:49:41] ~~~~~~~ End Sub ~~~~~~~ sub "P:\arcgis93\subuninstall.ins"