Firefox lässt sich nicht deinstallieren mit opsi Script

Antworten
Joschua_G
Beiträge: 2
Registriert: 26 Jun 2019, 13:14

Firefox lässt sich nicht deinstallieren mit opsi Script

Beitrag von Joschua_G »

Guten Tag alle zusammen,

ich bin neu hier und musste im auftrage eines Projects opsi installieren und konfiguerieren. Nun trat aber das Problem aufm das sich Mozilla Firefox sich zwar installieren lässt aber nicht mehr Deinstallieren. Bräuchte da mal hilfe ich habe auch die Vorlage benutzt die zur verfügung gestellt wird.

LG
Benutzeravatar
ThomasT
uib-Team
Beiträge: 529
Registriert: 26 Jun 2013, 12:26

Re: Firefox lässt sich nicht deinstallieren mit opsi Script

Beitrag von ThomasT »

Hallo Joschua,

herzlich willkommen.
Was hast du bereits versucht? Wie sieht dein Deinstallationsskript aus?
Hast du dir die Doku vom Hersteller durchgelesen?
Kein Support per DM!
_________________________
opsi support - https://www.uib.de/
For productive opsi installations we recommend support contracts.
Joschua_G
Beiträge: 2
Registriert: 26 Jun 2019, 13:14

Re: Firefox lässt sich nicht deinstallieren mit opsi Script

Beitrag von Joschua_G »

Das Deinstallations Sript sieht so aus.

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/
 
 
 
[Actions]
requiredWinstVersion >= "4.10.8.6"
 
DefVar $UninstallProgram32$
DefVar $MsiId64$
DefVar $UninstallProgram64$
DefVar $LogDir$
DefVar $ExitCode$
DefVar $ProductId$
DefVar $MozInstallDir$
DefVar $MozInstallDir64$
DefVar $LicenseRequired$
DefVar $LicensePool$
DefVar $INST_SystemType$
DefVar $INST_architecture$
DefVar $UninstallCommand$
 
Set $INST_SystemType$ = GetSystemType
set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
 
Set $LogDir$ = "%SystemDrive%\tmp"
; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
Set $ProductId$       = "firefox"
Set $MozInstallDir$    = "%ProgramFilesDir%\Mozilla Firefox"
Set $LicenseRequired$ = "false"
Set $LicensePool$     = "p_" + $ProductId$
; ----------------------------------------------------------------
 
 
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".bmp" $ProductId$
 
Message "Uninstalling " + $ProductId$ + " ..."
 
if FileExists("%ScriptPath%\delsub.ins")
        comment "Start uninstall sub section"
        Sub "%ScriptPath%\delsub.ins"
endif
 
if $LicenseRequired$ = "true"
        comment "Licensing required, free license used"
        Sub_free_license
endif
 
[Sub_free_license]
comment "License management is enabled and will be used"
 
comment "Trying to free license used for the product"
DefVar $result$
Set $result$ = FreeLicense($LicensePool$)
; If there is an assignment of a license pool to the product, it is possible to use
; Set $result$ = FreeLicense("", $ProductId$)
;
; If there is an assignment of a license pool to a windows software id, it is possible to use
; DefVar $WindowsSoftwareId$
; $WindowsSoftwareId$ = "..."
; set $result$ = FreeLicense("", "", $WindowsSoftwareId$)
Dazu gehört dann auch die delsub.ins

Code: Alles auswählen

;************************************************************
;
;delsub.ins
;
;************************************************************
 
; Message at install time:
Message "Deinstalling "+$ProductId$+" ..."
 
; kill a running firefox
killtask "firefox.exe"
 
; if firefox uninstall program exists then start it
 
if FileExists(""+$MozInstallDir$+"\uninstall\helper.exe")
    set $UninstallCommand$ = ""+$MozInstallDir$+"\uninstall\helper.exe"
    set $UninstallCommand$ = '"'+$UninstallCommand$+'" /S'
    WinBatch_start_FirefoxUninstall /WaitSeconds 20
    sub_check_exitcode
endif
 
; delete registry entry to the current installed version
Registry_delete_current_version
; delete files of current version
if not ($MozInstallDir$ = "")
        Files_copy_deinstall
endif
 
 
 
[WinBatch_start_FirefoxUninstall]
$UninstallCommand$
;%SCRIPTPATH%\sleep 5
 
[Files_copy_deinstall]
delete -sf "$MozInstallDir$\"
 
[Registry_delete_current_version]
OpenKey [HKEY_LOCAL_MACHINE\Software\Mozilla\Mozilla Firefox]
set "CurrentVersion" = ""
 
[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
Aber alles was kommt ist Aktion wird gestartet und Firefox bleibt aber Aktion wird als erfolgreich angezeigt.
Benutzeravatar
SisterOfMercy
Beiträge: 1522
Registriert: 22 Jun 2012, 19:18

Re: Firefox lässt sich nicht deinstallieren mit opsi Script

Beitrag von SisterOfMercy »

Try

Code: Alles auswählen

Set $MozInstallDir$    = "%ProgramFiles64Dir%\Mozilla Firefox"

or 

Set $MozInstallDir$    = "%ProgramFiles32Dir%\Mozilla Firefox"
If you have a 64 bit firefox, this will also not work, without /64Bit or /SysNative:

Code: Alles auswählen

WinBatch_start_FirefoxUninstall /WaitSeconds 20
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Antworten