[Initial]
Message=Deinstalliere Python...
DefVar $ExitCode$
DefVar $Version$

[Aktionen]
ShowBitmap "%ScriptPath%\logo.png" "MDG Python"
Sub_PrepareSetup
WinBatch_Setup
Files_Cleanup

[Sub_PrepareSetup]
Set $Version$ = GetValue("productversion", GetProductMap)

[WinBatch_Setup]
"%ScriptPath%\data\python-$Version$-amd64.exe" /quiet /uninstall

[Files_Cleanup]
delete -sf "%ProgramFiles64Dir%\Python39\"

[Sub_HandleExitCode]
; check return code
Set $ExitCode$ = GetLastExitCode
comment "GetLastExitCode: " + $ExitCode$
if not($ExitCode$ = "0" or $ExitCode$ = "1605" or $ExitCode$ = "3010")
  ; 0    ERROR_SUCCESS
  ; 1605 ERROR_UNKNOWN_PRODUCT
  ; 3010 ERROR_SUCCESS_REBOOT_REQUIRED
  LogError "Fatal: setup returned exit code " + $ExitCode$
  IsFatalError
endif
