Seite 1 von 1

Programme deinstallieren

Verfasst: 15 Jun 2009, 13:53
von DerPue
Hallo zusammen,

ich hab ein kleines Problem, vielleicht könnt Ihr mir ja helfen.....
Zur Zeit teste ich den Opsi 3.3.1, der läuft soweit und installiert soweit ganz gut. Was muss ich tun, wenn ich installierte Programme beim booten deinstallieren möchte.
Habe bisher ausprobiert die "Anstehende Aktion" auf uninstall zu setzten, passiert leider nur nichts.
Über Denkanstösse oder Hilfen würde ich mich sehr freuen.
Lieben Gruss
DerPue

Re: Programme deinstallieren

Verfasst: 04 Aug 2010, 10:43
von Thomas_H
Hallo,

das gleiche Problem hab ich auch in der Version 3.4. Wenn ich die Software "nochmal" installiere, dann klappt es auch mit der vorherigen Deinstallation. Also eigentlich alles okay. Nur wenn ich dem configed sage, dass das Programm auf dem jeweiligen Rechner deinstalliert werden soll, dann läuft ein script durch ohne Fehler, macht aber nichts.

Wo mache ich einen Denkfehler ? (Verflixt, mein Boss soll mich endlich zu Eurem Lehrgang schicken... :/)

Diese uninstall.ins ist für das Programm BayWotch, falls einer die install.ins möchte, oder falls gewünscht stelle ich das auch komplett der Allgemeinheit zur Verfügung.

Diese uninstall.ins hat einen Schönheitsfehler, den ich momentan noch (mangels Wissen) nicht ausräumen kann. Bei der Deinstallation fragt BayWotch, ob auch das Verzeichnis des Benutzers gelöscht werden soll. Das würd ich gern automatisch mit Nein beantworten wollen. Falls mir da jemand helfen möchte, ist Hilfe IMMER gern gesehen.

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.5"
DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ExitCode$
DefVar $ProductId$
DefVar $InstallDir$
DefVar $LicenseRequired$
DefVar $LicensePool$
Set $LogDir$ = "%SystemDrive%\tmp"
; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
Set $ProductId$       = "baywotchlite"
Set $InstallDir$      = "%ProgramFilesDir%\BayWotch4"
Set $LicenseRequired$ = "false"
Set $LicensePool$     = 
; ----------------------------------------------------------------
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]
if opsiLicenseManagementEnabled
	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$)
else
	LogError "Error: licensing required, but license management not enabled"
	isFatalError
endif
und hier die delsub.ins

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/

;Set $MsiId$ = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
DefVar $UninstallProgram$
Set $UninstallProgram$ = "%ProgramFilesDir%\BayWotch4\unins000.exe"

Message "Uninstalling " + $ProductId$ + " ..."
if FileExists($UninstallProgram$)
	comment "Uninstall program found, starting uninstall"
	Winbatch_uninstall
	sub_check_exitcode
endif
; 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

comment "Delete files"
Files_uninstall
comment "Cleanup registry"
Registry_uninstall
comment "Delete program shortcuts"
LinkFolder_uninstall

[Winbatch_uninstall]
; Choose one of the following examples as basis for program uninstall
;
; === Nullsoft Scriptable Install System ==================================
; "$UninstallProgram$" /S
;
; === Inno Setup ==========================================================
"$UninstallProgram$" /silent /norestart

[Winbatch_uninstall_msi]
;msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress

[Files_uninstall]
; Example for recursively deleting the installation directory 
; (don't forget the trailing backslash):
;
; delete -sf "$InstallDir$\"

[Registry_uninstall]
; Example of deleting a registry key:
;
; deletekey [HKEY_LOCAL_MACHINE\Software\$ProductId$]

[LinkFolder_uninstall]
; Example of deleting a folder from AllUsers startmenu:
;
; set_basefolder common_programs
; delete_subfolder $ProductId$
;
; Example of deleting a shortcut from AllUsers desktop:
;
; set_basefolder common_desktopdirectory
; set_subfolder ""
; delete_element $ProductId$

[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"
		comment "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"
				comment "complete the install. This message is indicative of a success."
   			else
				logError "Fatal: Setup program gives an unknown exitcode unequal zero: "
				logError $ExitCode$
				isFatalError
			endif
		endif
	endif
endif
Vielen Dank

Thomas_H