Seite 1 von 1

Pakete deinstallieren Probleme bei .exe

Verfasst: 19 Mär 2015, 12:23
von Keller
Hallo zusammen

ich stehe leider an.
Ich möchte das Notepad++ deinstallieren, welches ich erfolgreich via Scripte installieren konnte.

install.ins

Code: Alles auswählen

[Actions]
requiredWinstVersion >= "4.10.8.6"
 
DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $SetupFile$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
 
Set $LogDir$ 		= "%SystemDrive%\tmp"
Set $ProductId$       	= "notepadpp"
Set $MinimumSpace$    	= "30 MB"
Set $InstallDir$      	= "%ProgramFiles32Dir%\Notepad++"
Set $SetupFile$		= "npp.6.1.5.Installer.exe"
Set $LicenseRequired$ 	= "false"
Set $LicensePool$     	= "p_" + $ProductId$
; ----------------------------------------------------------------
 
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
	LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
	isFatalError
	; Stop process and set installation status to failed
else
	comment "Show product picture"
	ShowBitmap "%ScriptPath%\" + $ProductId$ + "" $ProductId$
 
	if FileExists("%ScriptPath%\delsub.ins")
		comment "Start uninstall sub section"
		Sub "%ScriptPath%\delsub.ins"
	endif
 
	Message "Installing " + $ProductId$ + " ..."
 
	comment "Start setup program"
	Winbatch_install
	Sub_check_exitcode 
endif
 
[Winbatch_install]
"%ScriptPath%\npp.6.1.6.Installer.exe" /S
 

 
[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

[LinkFolder_Custom]
;Startmenü anpassen
set_basefolder common_programs
set_subfolder ""
delete_subfolder "Notepad++"
set_subfolder ""
set_link
        name: Notepad++
        target: "%ProgramFiles32Dir%\Application\npp.6.1.6.Installer.exe"
        parameters:
        working_dir: "%ProgramFiles32Dir%\Application"
        icon_file:
        icon_index:
end_link
uninstall.ins

Code: Alles auswählen

[Actions]
requiredWinstVersion >= "4.10.8.6"
 
DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ExitCode$
DefVar $ProductId$
DefVar $InstallDir$
DefVar $LicenseRequired$
DefVar $LicensePool$
 
Set $LogDir$ 		= "%SystemDrive%\tmp"
Set $ProductId$		= "notepadpp"
Set $InstallDir$      	= "%ProgramFiles32Dir%\Notepad++"
Set $LicenseRequired$ 	= "false"
Set $LicensePool$     	= "p_" + $ProductId$
; ----------------------------------------------------------------
 
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $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$)
delsub.ins

Code: Alles auswählen

Set $UninstallProgram$ = $InstallDir$ + "\npp.6.1.5.Installer.exe"
 
Message "Uninstalling " + $ProductId$ + " ..."
 
if FileExists($UninstallProgram$)
	comment "Uninstall program found, starting uninstall"
	Winbatch_uninstall
	sub_check_exitcode
endif
 
 
[Winbatch_uninstall]
"$UninstallProgram$" /S
 
 
 
[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
Über eine Information welches Files was macht wäre ich sehr dankbar, denn für mich ist die Auszeichnun aus dem Support: viewtopic.php?f=7&t=2852&p=13700&hilit= ... lla#p13700 leider nicht klar.

Grüsse keller

Re: Pakete deinstallieren Probleme bei .exe

Verfasst: 19 Mär 2015, 14:47
von andre_m87
Moin Keller,

die Zeile

Code: Alles auswählen

Set $UninstallProgram$ = $InstallDir$ + "\npp.6.1.5.Installer.exe"
in der Datei "delsub.ins" musst du durch

Code: Alles auswählen

Set $UninstallProgram$ = $InstallDir$ + "\uninstall.exe"
ersetzten.

Ich empfehle dir das Kapitel 5 des "opsi Getting Started" Dokuments durchzulesen, dort findest du ein schönes Tutorial für den Einstieg in winst-Scripts.

LG,
André

Re: Pakete deinstallieren Probleme bei .exe

Verfasst: 27 Mär 2015, 15:10
von Keller
Hoi André

Vielen Dank für Deine Hilfe!
Ich habe dies nun geschafft... nun hange ich an den Paketen von Java, Adobe Reader und Office :-/
Hast du hierzu allenfalls einen Tipp?

Grüessli Keller

Re: Pakete deinstallieren Probleme bei .exe

Verfasst: 27 Mär 2015, 18:32
von SisterOfMercy

Re: Pakete deinstallieren Probleme bei .exe

Verfasst: 29 Mär 2015, 13:35
von Keller
Da war ich schon und mit etwas probieren habe ich es auch geschafft, mit den angegebenen Pakten.
Leider nicht mit dem neusten Adobe Reader oder Java.

Re: Pakete deinstallieren Probleme bei .exe

Verfasst: 29 Mär 2015, 19:35
von SisterOfMercy
Keller hat geschrieben:Leider nicht mit dem neusten Adobe Reader oder Java.
I've put my working adobe reader 11 scripts online here:
wiki/doku.php?id=userspace:adobe_reader_xi_yet_another

(and now I demand a human sacrifice! :evil: :twisted: :D )