SAP Uninstall / Install Fehler

Antworten
Golf2
Beiträge: 31
Registriert: 07 Feb 2013, 15:18

SAP Uninstall / Install Fehler

Beitrag von Golf2 »

Hallo zusammen,

ich hänge beim Deinstallieren des SAP Paketes. Die Installation funktioniert problemlos, aber die Deinstallation läuft nicht durch.

delsub32

Code: Alles auswählen

[Winbatch_uninstall]
; Choose one of the following examples as basis for program uninstall
;
; === Nullsoft Scriptable Install System ================================================================
; maybe better called as
; Winbatch_uninstall /WaitforProcessending "Au_.exe" /Timeoutseconds 10
; "$UninstallProgram$" /S
;
; === Inno Setup ========================================================================================
; "$UninstallProgram$" /silent /norestart /SUPPRESSMSGBOXES /nocancel

[Winbatch_uninstall_msi]
cd "C:\%PROGRAMFILES%\SAP\SapSetup\Setup"
nwsapsetup.exe /uninstall /all /silent
Das Problem liegt bestimmt daran, das ich die Setup im Unterordner des Installpfads starten will. Zum Deinstallieren benötigt SAP den Aufruf "nwsapsetup.exe /uninstall /all /silent" damit wird alles gelöscht. Per Batch mit dem o.g. Code funktioniert es...... Wie wäre hier die richtige Syntax?
Zuletzt geändert von Golf2 am 01 Dez 2016, 11:50, insgesamt 1-mal geändert.
andré
Beiträge: 328
Registriert: 07 Jan 2014, 10:48

Re: SAP Uninstall Fehler

Beitrag von andré »

%PROGRAMFILES% ist keine Opsi-Variable, das sollte das Problem verursachen.

Du hast aus meiner Sicht zwei Möglichkeiten.
1) Du arbeitest mit einer Opsi-Variable. (Siehe Opsi-Winst-Handbuch Kapitel 10)

Code: Alles auswählen

[Winbatch_uninstall_msi]
"%ProgramFilesDir%\SAP\SapSetup\Setup\nwsapsetup.exe" /uninstall /all /silent
2) Du lässt Opsi das mit DosInAnIcon direkt als cmd ausführen.

Code: Alles auswählen

[DosInAnIcon_uninstall_msi]
cd "C:\%PROGRAMFILES%\SAP\SapSetup\Setup"
nwsapsetup.exe /uninstall /all /silent
Golf2
Beiträge: 31
Registriert: 07 Feb 2013, 15:18

Re: SAP Uninstall Fehler

Beitrag von Golf2 »

Kurz, schlüssig, hilfreich :D

Funktioniert, somit Problem gelöst.
andré
Beiträge: 328
Registriert: 07 Jan 2014, 10:48

Re: SAP Uninstall Fehler

Beitrag von andré »

Golf2 hat geschrieben:Kurz, schlüssig, hilfreich :D

Funktioniert, somit Problem gelöst.

Freut mich. :)
Golf2
Beiträge: 31
Registriert: 07 Feb 2013, 15:18

Re: SAP Uninstall Fehler

Beitrag von Golf2 »

Ich sehe schon zulange auf den Bildschirm.... :oops:

Jetzt läuft die Setup nicht mehr durch. Immer wenn ich die Setup bei "Angefordert" im Config Editor setze, startet er trotzdem die Uninstall...... versteh ich net. Dabei meine ich, hab ich immer nur die "delsub" geändert...

Wenn ich das so sehe, liegt das problem hier

Code: Alles auswählen

if FileExists("%ScriptPath%\delsub32.opsiscript")
		comment "Start uninstall sub section"
		Sub "%ScriptPath%\delsub32.opsiscript"
	endif
Springt er nicht sobald die delsub32 vorhanden ist, in die Uninstall? Das ist die Templatevorlage. Aber ich setze ja im OCE auf Setup und nicht Uninstall. Somit würde ich erwarten, das er halt die Setup durchzieht und NICHT in die Uninstall springt......

Code: Alles auswählen

; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/en/credits/

[Actions]
requiredWinstVersion >= "4.11.4.6"
ScriptErrorMessages=off

DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $myProperty$

Set $LogDir$ = "%opsiLogDir%"

; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
;$ProductId$ should be the name of the product in opsi
; therefore please: only lower letters, no umlauts, 
; no white space use '-' as a seperator
Set $ProductId$       = "sapgui-7-40"
Set $MinimumSpace$    = "4096 MB"
; the path were we find the product after the installation
Set $InstallDir$      = "%ProgramFiles32Dir%\SAP"
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 "No Space"
	; Stop process and set installation status to failed
else
	comment "Show product picture"
	ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
	
	comment "get property value ....."
	set $myProperty$ = getProductProperty("dummy_prop", "yes")
	if $myProperty$ = "yes"
		comment "myproperty value is yes"
	else
		if $myProperty$ = "no"
			comment "myproperty value is no"
		else
			comment "myproperty value must be may_be"
		endif
	endif
	
	if FileExists("%ScriptPath%\delsub32.opsiscript")
		comment "Start uninstall sub section"
		Sub "%ScriptPath%\delsub32.opsiscript"
	endif
	
	Message "Installing " + $ProductId$ + " ..."
	
	if $LicenseRequired$ = "true"
		comment "Licensing required, reserve license and get license key"
		Sub_get_licensekey
	endif
	
	comment "Start setup program"
	ChangeDirectory "%SCRIPTPATH%"
	Winbatch_install
	Sub_check_exitcode
	
	comment "Copy files"
	Files_install /32Bit
	
	comment "Patch Registry"
	Registry_install /32Bit
	
	comment "Create shortcuts"
	LinkFolder_install
	
endif

[Winbatch_install]
; Choose one of the following examples as basis for your installation
; You can use $LicenseKey$ var to pass a license key to the installer
;
; === Nullsoft Scriptable Install System ================================================================
; "%ScriptPath%\Setup.exe" /S
"%ScriptPath%\sapgui740gepatch.exe" /l* "$LogDir$\$ProductId$.install_log.txt" /silent ALLUSERS=1 REBOOT=ReallySuppress
;
; === MSI package =======================================================================================
; You may use the parameter PIDKEY=$Licensekey$
; msiexec /i "%ScriptPath%\some.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb-! ALLUSERS=1 REBOOT=ReallySuppress
;
; === InstallShield + MSI=====================================================================================
; Attention: The path to the log file should not contain any whitespaces
; "%ScriptPath%\setup.exe" /s /v" /l* $LogDir$\$ProductId$.install_log.txt /qb-! ALLUSERS=1 REBOOT=ReallySuppress"
; "%ScriptPath%\setup.exe" /s /v" /qb-! ALLUSERS=1 REBOOT=ReallySuppress"
;
; === InstallShield =====================================================================================
; Create setup.iss answer file by running: setup.exe /r /f1"c:\setup.iss"
; You may use an answer file by the parameter /f1"c:\setup.iss"
; "%ScriptPath%\setup.exe" /s /sms /f2"$LogDir$\$ProductId$.install_log.txt"
;
; === Inno Setup ========================================================================================
; http://unattended.sourceforge.net/InnoSetup_Switches_ExitCodes.html
; You may create setup answer file by: setup.exe /SAVEINF="filename"
; You may use an answer file by the parameter /LOADINF="filename"
; "%ScriptPath%\setup.exe" /sp- /silent /norestart /nocancel /SUPPRESSMSGBOXES

[Files_install]
; Example of recursively copying some files into the installation directory:
copy -s "%ScriptPath%\saplogon.ini" "%Systemroot%"
;
; copy -s "%ScriptPath%\files\*.*" "$InstallDir$"

[Registry_install]
; Example of setting some values of an registry key:
;
; openkey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
; set "name1" = "some string value"
; set "name2" = REG_DWORD:0001
; set "name3" = REG_BINARY:00 af 99 cd

[LinkFolder_install]
; Example of deleting a folder from AllUsers startmenu:
;
; set_basefolder common_programs
; delete_subfolder $ProductId$
;
; Example of creating an shortcut to the installed exe in AllUsers startmenu:
;
; set_basefolder common_programs
; set_subfolder $ProductId$
;
; set_link
; 	name: $ProductId$
; 	target: <path to the program>
; 	parameters:
; 	working_dir: $InstallDir$
; 	icon_file:
; 	icon_index:
; end_link
;
; Example of creating an shortcut to the installed exe on AllUsers desktop:
;
; set_basefolder common_desktopdirectory
; set_subfolder ""
;
; set_link
; 	name: $ProductId$
; 	target: <path to the program>
; 	parameters: <some_param>
; 	working_dir: $InstallDir$
; 	icon_file: <path to icon file>
; 	icon_index: 2
; end_link

[Sub_get_licensekey]
if opsiLicenseManagementEnabled
	comment "License management is enabled and will be used"

	comment "Trying to get a license key"
	Set $LicenseKey$ = demandLicenseKey ($LicensePool$)
	; If there is an assignment of exactly one licensepool to the product the following call is possible:
	; Set $LicenseKey$ = demandLicenseKey ("", $ProductId$)
	;
	; If there is an assignment of a license pool to a windows software id, it is possible to use:
	; DefVar $WindowsSoftwareId$
	; $WindowsSoftwareId$ = "..."
	; Set $LicenseKey$ = demandLicenseKey ("", "", $WindowsSoftwareId$)
	
	DefVar $ServiceErrorClass$
	set $ServiceErrorClass$ = getLastServiceErrorClass
	comment "Error class: " + $ServiceErrorClass$
	
	if $ServiceErrorClass$ = "None"
		comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
	else
		if $ServiceErrorClass$ = "LicenseConfigurationError"
			LogError "Fatal: license configuration must be corrected"
			LogError getLastServiceErrorMessage
			isFatalError
		else 
			if $ServiceErrorClass$ = "LicenseMissingError"
				LogError "Fatal: required license is not supplied"
				isFatalError
			endif
		endif
	endif
else
	LogError "Fatal: license required, but license management not enabled"
	isFatalError
endif


[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

Anbei das Log

Code: Alles auswählen

(0)       
(1)       [1] [Dez 01 11:44:41:272] --
(2)       [1] [Dez 01 11:44:41:272] --
(3)       [1] [Dez 01 11:44:41:273] c:\opsi.org\log\\opsi-script-part-Yn61Em63.log
(4)       [1] [Dez 01 11:44:41:281] opsi-script 4.11.6.8 started at >>
(5)       [1] [Dez 01 11:44:41:281] opsi-script log file with encoding utf8
(6)       [1] [Dez 01 11:44:41:281] startmessage opsi-script created at CentralForm.FormCreate: 01.12.2016 11:44:41
(7)       [1] [Dez 01 11:44:41:281] Loading skin from: C:\Program Files\opsi.org\opsi-client-agent\opsi-winst\winstskin
(8)       [1] [Dez 01 11:44:41:281] Depot path from readconfig:  p:\ 01.12.2016 11:44:41
(9)       [1] [Dez 01 11:44:41:281] startmessage StartProgramModes and create log: 01.12.2016 11:44:41
(10)      [1] [Dez 01 11:44:41:285] pm: 5 01.12.2016 11:44:41
(11)      [1] [Dez 01 11:44:41:285] startmessage start opsi service connection: 01.12.2016 11:44:41
(12)      [1] [Dez 01 11:44:41:286] startmessage: opsidata initialized: 01.12.2016 11:44:41
(13)      [1] [Dez 01 11:44:41:286] startmessage create log: 01.12.2016 11:44:41
(14)      [6] [Dez 01 11:44:42:373] JSON Bench for getDepotId "params":["w10-v1.et.local"],"id":1} Start: 11:44:41:286 Time: 00:00:01:087
(15)      [6] [Dez 01 11:44:42:462] Starting sorting POC 
(16)      [6] [Dez 01 11:44:42:462] JSON service request https://172.23.10.177:4447/rpc getProductOrdering
(17)      [6] [Dez 01 11:44:43:342] JSON Bench for getProductOrdering "params":["etopsi.et.local"],"id":1} Start: 11:44:42:462 Time: 00:00:00:880
(18)      [6] [Dez 01 11:44:43:431] JSON service request https://172.23.10.177:4447/rpc productOnClient_getObjects
(19)      [6] [Dez 01 11:44:43:539] JSON Bench for productOnClient_getObjects "params":["",{"clientId":"w10-v1.et.local","produc Start: 11:44:43:431 Time: 00:00:00:108
(20)      [6] [Dez 01 11:44:43:649] Finished sorting POC  
(21)      [5] [Dez 01 11:44:43:649] Computername:w10-v1.et.local
(22)      [5] [Dez 01 11:44:43:649] Computername according to Environment Variable :W10-V1
(23)      [5] [Dez 01 11:44:43:649] opsi service URL https://172.23.10.177:4447
(24)      [6] [Dez 01 11:44:43:649] Depot path:  p:\
(25)      [6] [Dez 01 11:44:43:649] 
(26)      [5] [Dez 01 11:44:43:655] bootmode BKSTD
(27)      [5] [Dez 01 11:44:43:655] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(28)      [5] [Dez 01 11:44:43:655] Resolved sequence of products (01.12.2016 11:44:43): 
(29)      [5] [Dez 01 11:44:43:655] Product 9 	sapgui-7-40 : setup
(30)      [5] [Dez 01 11:44:43:655] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(31)      [6] [Dez 01 11:44:43:655] JSON service request https://172.23.10.177:4447/rpc getProduct_hash
(32)      [6] [Dez 01 11:44:43:800] JSON Bench for getProduct_hash "params":["sapgui-7-40","etopsi.et.local"],"id":1} Start: 11:44:43:655 Time: 00:00:00:145
(33)      [6] [Dez 01 11:44:43:889] JSON service request https://172.23.10.177:4447/rpc productOnClient_getObjects
(34)      [6] [Dez 01 11:44:43:952] JSON Bench for productOnClient_getObjects "params":["",{"clientId":"w10-v1.et.local","produc Start: 11:44:43:889 Time: 00:00:00:063
(35)      [6] [Dez 01 11:44:44:042] Actionrequest for product: sapgui-7-40 is (original/actual): (setup / setup)
(36)      [6] [Dez 01 11:44:44:055] [sapgui-7-40] Actionrequest for Product: sapgui-7-40 is: setup
(37)      [6] [Dez 01 11:44:44:056] [sapgui-7-40] JSON service request https://172.23.10.177:4447/rpc getProductProperties_hash
(38)      [6] [Dez 01 11:44:44:308] [sapgui-7-40] JSON Bench for getProductProperties_hash "params":["sapgui-7-40","w10-v1.et.local"],"id":1} Start: 11:44:44:055 Time: 00:00:00:253
(39)      [6] [Dez 01 11:44:44:398] [sapgui-7-40] JSON service request https://172.23.10.177:4447/rpc getProduct_hash
(40)      [6] [Dez 01 11:44:44:525] [sapgui-7-40] JSON Bench for getProduct_hash "params":["sapgui-7-40","etopsi.et.local"],"id":1} Start: 11:44:44:398 Time: 00:00:00:127
(41)      [6] [Dez 01 11:44:44:614] [sapgui-7-40] JSON service request https://172.23.10.177:4447/rpc productOnClient_getObjects
(42)      [6] [Dez 01 11:44:44:680] [sapgui-7-40] JSON Bench for productOnClient_getObjects "params":["",{"clientId":"w10-v1.et.local","produc Start: 11:44:44:614 Time: 00:00:00:066
(43)      [5] [Dez 01 11:44:44:772] [sapgui-7-40] scriptname: "setup32.opsiscript", special path: "p:\sapgui-7-40\"
(44)      [6] [Dez 01 11:44:44:773] [sapgui-7-40] JSON service request https://172.23.10.177:4447/rpc productOnClient_updateObject
(45)      [6] [Dez 01 11:44:44:846] [sapgui-7-40] JSON Bench for productOnClient_updateObject "params":[{"clientId":"w10-v1.et.local","actionRes Start: 11:44:44:772 Time: 00:00:00:074
(46)      [6] [Dez 01 11:44:44:943] [sapgui-7-40] Using old Depot path:  p:\
(47)      [1] [Dez 01 11:44:45:091] [sapgui-7-40] 
(48)      [1] [Dez 01 11:44:45:091] [sapgui-7-40] ============ Version 4.11.6.8 script "p:\sapgui-7-40\setup32.opsiscript"
(49)      [1] [Dez 01 11:44:45:091] [sapgui-7-40]              used script encoding: cp1252
(50)      [1] [Dez 01 11:44:45:091] [sapgui-7-40]              used system encoding: cp1252
(51)      [1] [Dez 01 11:44:45:091] [sapgui-7-40]              start: 2016-12-01  11:44:45 
(52)      [1] [Dez 01 11:44:45:091] [sapgui-7-40]              installing product: sapgui-7-40_7.40-1.1
(53)      [1] [Dez 01 11:44:45:091] [sapgui-7-40]              on client named    "w10-v1.et.local"
(54)      [1] [Dez 01 11:44:45:091] [sapgui-7-40]              loggedin user    ""
(55)      [1] [Dez 01 11:44:45:091] [sapgui-7-40]              opsi-script running as    "SYSTEM"
(56)      [1] [Dez 01 11:44:45:091] [sapgui-7-40]              opsi-script running with admin privileges
(57)      [1] [Dez 01 11:44:45:091] [sapgui-7-40]              opsi-script running in standard script mode
(58)      [1] [Dez 01 11:44:45:091] [sapgui-7-40] executing: "C:\Program Files\opsi.org\opsi-client-agent\opsi-winst\winst32.exe"
(59)      [1] [Dez 01 11:44:45:091] [sapgui-7-40] system infos:
(60)      [1] [Dez 01 11:44:45:095] [sapgui-7-40] 00-15-5D-0A-46-1B  -  PC hardware address
(61)      [1] [Dez 01 11:44:45:095] [sapgui-7-40] W10-V1.ET.LOCAL  -  IP name 
(62)      [1] [Dez 01 11:44:45:095] [sapgui-7-40] 172.23.10.56  -  IP address
(63)      [1] [Dez 01 11:44:45:095] [sapgui-7-40] DEU  -  System default locale 
(64)      [6] [Dez 01 11:44:45:095] [sapgui-7-40] Registry key [HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion]  opened
(65)      [6] [Dez 01 11:44:45:095] [sapgui-7-40] Key closed
(66)      [1] [Dez 01 11:44:45:095] [sapgui-7-40] MS Windows 10.0 32 Bit, Release: 1607, Edition: PRODUCT_PROFESSIONAL
(67)      [1] [Dez 01 11:44:45:095] [sapgui-7-40] opsi service version : 4
(68)      [1] [Dez 01 11:44:45:096] [sapgui-7-40] 
(69)      [6] [Dez 01 11:44:45:097] [sapgui-7-40] Registry key [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion]  opened
(70)      [6] [Dez 01 11:44:45:097] [sapgui-7-40] Key closed
(71)      [6] [Dez 01 11:44:45:170] [sapgui-7-40] opsi-script has version  4.11.6.8, required is : >= 4.11.4.6
(72)      [5] [Dez 01 11:44:45:170] [sapgui-7-40] ReportMessages was True is set to true
(73)      [5] [Dez 01 11:44:45:170] [sapgui-7-40] Set  $LogDir$ = "c:\opsi.org\log"
(74)      [6] [Dez 01 11:44:45:175] [sapgui-7-40]   The value of the variable "$LogDir$" is now: "c:\opsi.org\log"
(75)      [5] [Dez 01 11:44:45:175] [sapgui-7-40] Set  $ProductId$       = "sapgui-7-40"
(76)      [6] [Dez 01 11:44:45:175] [sapgui-7-40]   The value of the variable "$ProductId$" is now: "sapgui-7-40"
(77)      [5] [Dez 01 11:44:45:175] [sapgui-7-40] Set  $MinimumSpace$    = "4096 MB"
(78)      [6] [Dez 01 11:44:45:175] [sapgui-7-40]   The value of the variable "$MinimumSpace$" is now: "4096 MB"
(79)      [5] [Dez 01 11:44:45:175] [sapgui-7-40] Set  $InstallDir$      = "C:\Program Files\SAP"
(80)      [6] [Dez 01 11:44:45:175] [sapgui-7-40]   The value of the variable "$InstallDir$" is now: "C:\Program Files\SAP"
(81)      [5] [Dez 01 11:44:45:175] [sapgui-7-40] Set  $LicenseRequired$ = "false"
(82)      [6] [Dez 01 11:44:45:175] [sapgui-7-40]   The value of the variable "$LicenseRequired$" is now: "false"
(83)      [5] [Dez 01 11:44:45:175] [sapgui-7-40] Set  $LicensePool$     = "p_" + $ProductId$
(84)      [6] [Dez 01 11:44:45:175] [sapgui-7-40]   The value of the variable "$LicensePool$" is now: "p_sapgui-7-40"
(85)      [6] [Dez 01 11:44:45:175] [sapgui-7-40] If
(86)      [6] [Dez 01 11:44:45:175] [sapgui-7-40]     Free on Disk C:: 111.047.843.840 bytes  This is more than the required amount of 4.096.000.000 bytes
(87)      [5] [Dez 01 11:44:45:175] [sapgui-7-40]   HasMinimumSpace ("C:", $MinimumSpace$)   <<< result true
(88)      [5] [Dez 01 11:44:45:175] [sapgui-7-40]   not(HasMinimumSpace ("C:", $MinimumSpace$))   <<< result false
(89)      [6] [Dez 01 11:44:45:175] [sapgui-7-40] Then
(90)      [6] [Dez 01 11:44:45:175] [sapgui-7-40] Else
(91)      [5] [Dez 01 11:44:45:175] [sapgui-7-40]   comment: Show product picture
(92)      [5] [Dez 01 11:44:45:181] [sapgui-7-40]   comment: get property value .....
(93)      [5] [Dez 01 11:44:45:181] [sapgui-7-40]   Set  $myProperty$ = getProductProperty("dummy_prop", "yes")
(94)      [4] [Dez 01 11:44:45:181] [sapgui-7-40]   Property not existing in GetProductProperty - using default
(95)      [6] [Dez 01 11:44:45:181] [sapgui-7-40]     The value of the variable "$myProperty$" is now: "yes"
(96)      [6] [Dez 01 11:44:45:181] [sapgui-7-40]   If
(97)      [5] [Dez 01 11:44:45:182] [sapgui-7-40]     $myProperty$ = "yes"   <<< result true
(98)      [6] [Dez 01 11:44:45:182] [sapgui-7-40]   Then
(99)      [5] [Dez 01 11:44:45:182] [sapgui-7-40]     comment: myproperty value is yes
(100)     [6] [Dez 01 11:44:45:182] [sapgui-7-40]   Else
(101)     [6] [Dez 01 11:44:45:182] [sapgui-7-40]     If
(102)     [6] [Dez 01 11:44:45:182] [sapgui-7-40]     Then
(103)     [6] [Dez 01 11:44:45:182] [sapgui-7-40]     Else
(104)     [6] [Dez 01 11:44:45:182] [sapgui-7-40]     EndIf
(105)     [6] [Dez 01 11:44:45:182] [sapgui-7-40]   EndIf
(106)     [6] [Dez 01 11:44:45:182] [sapgui-7-40]   If
(107)     [5] [Dez 01 11:44:45:182] [sapgui-7-40]       Starting query if file exist ...
(108)     [5] [Dez 01 11:44:45:186] [sapgui-7-40]     FileExists("p:\sapgui-7-40\delsub32.opsiscript")   <<< result true
(109)     [6] [Dez 01 11:44:45:186] [sapgui-7-40]   Then
(110)     [5] [Dez 01 11:44:45:186] [sapgui-7-40]     comment: Start uninstall sub section
(111)     [6] [Dez 01 11:44:45:200] [sapgui-7-40]     
(112)     [6] [Dez 01 11:44:45:200] [sapgui-7-40]     ~~~~~~~ Start Sub ~~~~~~~  Sub "p:\sapgui-7-40\delsub32.opsiscript"
(113)     [5] [Dez 01 11:44:45:206] [sapgui-7-40]     Set  $MsiId$ = '{2385C070-EC26-4AB9-8718-E605C977C0ED}'
(114)     [6] [Dez 01 11:44:45:206] [sapgui-7-40]       The value of the variable "$MsiId$" is now: "{2385C070-EC26-4AB9-8718-E605C977C0ED}"
(115)     [5] [Dez 01 11:44:45:206] [sapgui-7-40]     Set  $UninstallProgram$ = $InstallDir$ + "\uninstall.exe"
(116)     [6] [Dez 01 11:44:45:206] [sapgui-7-40]       The value of the variable "$UninstallProgram$" is now: "C:\Program Files\SAP\uninstall.exe"
(117)     [5] [Dez 01 11:44:45:206] [sapgui-7-40]     message Uninstalling sapgui-7-40 ...
(118)     [6] [Dez 01 11:44:45:208] [sapgui-7-40]     If
(119)     [5] [Dez 01 11:44:45:208] [sapgui-7-40]         Starting query if file exist ...
(120)     [5] [Dez 01 11:44:45:315] [sapgui-7-40]         "C:\Program Files\SAP\uninstall.exe": 
(121)     [5] [Dez 01 11:44:45:315] [sapgui-7-40]       FileExists($UninstallProgram$)   <<< result false
(122)     [6] [Dez 01 11:44:45:315] [sapgui-7-40]     Then
(123)     [6] [Dez 01 11:44:45:317] [sapgui-7-40]     EndIf
(124)     [6] [Dez 01 11:44:45:317] [sapgui-7-40]     If
(125)     [6] [Dez 01 11:44:45:317] [sapgui-7-40]       Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2385C070-EC26-4AB9-8718-E605C977C0ED}]  opened
(126)     [6] [Dez 01 11:44:45:317] [sapgui-7-40]       Key closed
(127)     [5] [Dez 01 11:44:45:317] [sapgui-7-40]       GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId$ + "] DisplayName") = ""   <<< result false
(128)     [5] [Dez 01 11:44:45:317] [sapgui-7-40]       not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId$ + "] DisplayName") = "")   <<< result true
(129)     [6] [Dez 01 11:44:45:317] [sapgui-7-40]     Then
(130)     [5] [Dez 01 11:44:45:317] [sapgui-7-40]       comment: MSI id {2385C070-EC26-4AB9-8718-E605C977C0ED} found in registry, starting msiexec to uninstall
(131)     [5] [Dez 01 11:44:45:318] [sapgui-7-40]       
(132)     [5] [Dez 01 11:44:45:318] [sapgui-7-40]       Execution of Winbatch_uninstall_msi
(133)     [4] [Dez 01 11:44:45:318] [sapgui-7-40]         Warning: file not found :C:\Program Files\SAP\SapSetup\Setup\nwsapsetup.exe -retrying
(134)     [4] [Dez 01 11:44:45:721] [sapgui-7-40]         Warning: file not found :C:\Program Files\SAP\SapSetup\Setup\nwsapsetup.exe -retrying
(135)     [4] [Dez 01 11:44:46:122] [sapgui-7-40]         Warning: file not found :C:\Program Files\SAP\SapSetup\Setup\nwsapsetup.exe -retrying
(136)     [4] [Dez 01 11:44:46:524] [sapgui-7-40]         Warning: file not found :C:\Program Files\SAP\SapSetup\Setup\nwsapsetup.exe -retrying
(137)     [4] [Dez 01 11:44:46:927] [sapgui-7-40]         Warning: file not found :C:\Program Files\SAP\SapSetup\Setup\nwsapsetup.exe -retrying
(138)     [4] [Dez 01 11:44:47:327] [sapgui-7-40]         Warning: file not found :C:\Program Files\SAP\SapSetup\Setup\nwsapsetup.exe -retrying
(139)     [4] [Dez 01 11:44:47:729] [sapgui-7-40]         Warning: file not found :C:\Program Files\SAP\SapSetup\Setup\nwsapsetup.exe -retrying
(140)     [4] [Dez 01 11:44:48:131] [sapgui-7-40]         Warning: file not found :C:\Program Files\SAP\SapSetup\Setup\nwsapsetup.exe -retrying
(141)     [4] [Dez 01 11:44:48:532] [sapgui-7-40]         Warning: file not found :C:\Program Files\SAP\SapSetup\Setup\nwsapsetup.exe -retrying
(142)     [4] [Dez 01 11:44:48:933] [sapgui-7-40]         Warning: file not found :C:\Program Files\SAP\SapSetup\Setup\nwsapsetup.exe -retrying
(143)     [4] [Dez 01 11:44:49:336] [sapgui-7-40]         Warning: file not found :C:\Program Files\SAP\SapSetup\Setup\nwsapsetup.exe - giving up
(144)     [6] [Dez 01 11:44:49:336] [sapgui-7-40]         Call ""C:\Program Files\SAP\SapSetup\Setup\nwsapsetup.exe" /uninstall /all /silent"
(145)     [6] [Dez 01 11:44:49:336] [sapgui-7-40]            Waiting until the called process is finished
(146)     [6] [Dez 01 11:44:49:336] [sapgui-7-40]         Start process as invoker: SYSTEM
(147)     [3] [Dez 01 11:44:49:336] [sapgui-7-40]         Exception in StartProcess_cp: Failed to execute "C:\Program Files\SAP\SapSetup\Setup\nwsapsetup.exe" /uninstall /all /silent : 2
(148)     [6] [Dez 01 11:44:49:336] [sapgui-7-40]         
(149)     [6] [Dez 01 11:44:49:339] [sapgui-7-40]       
(150)     [6] [Dez 01 11:44:49:339] [sapgui-7-40]       ~~~~~~~ Start Sub ~~~~~~~  sub_check_exitcode
(151)     [5] [Dez 01 11:44:49:340] [sapgui-7-40]       comment: Test for installation success via exit code
(152)     [5] [Dez 01 11:44:49:340] [sapgui-7-40]       Set  $ExitCode$ = getLastExitCode
(153)     [6] [Dez 01 11:44:49:340] [sapgui-7-40]         The value of the variable "$ExitCode$" is now: "-1"
(154)     [6] [Dez 01 11:44:49:340] [sapgui-7-40]       If
(155)     [5] [Dez 01 11:44:49:340] [sapgui-7-40]         $ExitCode$ = "0"   <<< result false
(156)     [5] [Dez 01 11:44:49:340] [sapgui-7-40]         ($ExitCode$ = "0")   <<< result false
(157)     [6] [Dez 01 11:44:49:340] [sapgui-7-40]       Then
(158)     [6] [Dez 01 11:44:49:340] [sapgui-7-40]       Else
(159)     [5] [Dez 01 11:44:49:340] [sapgui-7-40]         comment: Setup program gives a exitcode unequal zero: -1
(160)     [6] [Dez 01 11:44:49:340] [sapgui-7-40]         If
(161)     [5] [Dez 01 11:44:49:340] [sapgui-7-40]           $ExitCode$ = "1605"   <<< result false
(162)     [5] [Dez 01 11:44:49:341] [sapgui-7-40]           ($ExitCode$ = "1605")   <<< result false
(163)     [6] [Dez 01 11:44:49:341] [sapgui-7-40]         Then
(164)     [6] [Dez 01 11:44:49:341] [sapgui-7-40]         Else
(165)     [6] [Dez 01 11:44:49:341] [sapgui-7-40]           If
(166)     [5] [Dez 01 11:44:49:341] [sapgui-7-40]             $ExitCode$ = "1641"   <<< result false
(167)     [5] [Dez 01 11:44:49:341] [sapgui-7-40]             ($ExitCode$ = "1641")   <<< result false
(168)     [6] [Dez 01 11:44:49:341] [sapgui-7-40]           Then
(169)     [6] [Dez 01 11:44:49:341] [sapgui-7-40]           Else
(170)     [6] [Dez 01 11:44:49:341] [sapgui-7-40]             If
(171)     [5] [Dez 01 11:44:49:341] [sapgui-7-40]               $ExitCode$ = "3010"   <<< result false
(172)     [5] [Dez 01 11:44:49:341] [sapgui-7-40]               ($ExitCode$ = "3010")   <<< result false
(173)     [6] [Dez 01 11:44:49:341] [sapgui-7-40]             Then
(174)     [6] [Dez 01 11:44:49:341] [sapgui-7-40]             Else
(175)     [3] [Dez 01 11:44:49:341] [sapgui-7-40]               Error: Fatal: Setup program gives an unknown exitcode unequal zero: -1
(176)     [2] [Dez 01 11:44:49:341] [sapgui-7-40]               Error level set to fatal
(177)     [5] [Dez 01 11:44:49:341] [sapgui-7-40]               Process aborted
(178)     [6] [Dez 01 11:44:49:341] [sapgui-7-40]       
(179)     [6] [Dez 01 11:44:49:341] [sapgui-7-40]       ~~~~~~~ End Sub   ~~~~~~~  sub_check_exitcode
(180)     [6] [Dez 01 11:44:49:341] [sapgui-7-40]       
(181)     [5] [Dez 01 11:44:49:341] [sapgui-7-40]       Process aborted
(182)     [6] [Dez 01 11:44:49:341] [sapgui-7-40]     
(183)     [6] [Dez 01 11:44:49:341] [sapgui-7-40]     ~~~~~~~ End Sub   ~~~~~~~  Sub "p:\sapgui-7-40\delsub32.opsiscript"
(184)     [6] [Dez 01 11:44:49:341] [sapgui-7-40]     
(185)     [5] [Dez 01 11:44:49:341] [sapgui-7-40]     Process aborted
(186)     [1] [Dez 01 11:44:49:341] [sapgui-7-40] ___________________
(187)     [1] [Dez 01 11:44:49:341] [sapgui-7-40] script finished
(188)     [1] [Dez 01 11:44:49:341] [sapgui-7-40] 2 errors
(189)     [1] [Dez 01 11:44:49:341] [sapgui-7-40] 12 warnings
(190)     [1] [Dez 01 11:44:49:341] [sapgui-7-40] 
(191)     [1] [Dez 01 11:44:49:341] [sapgui-7-40] installed product: sapgui-7-40 Version: 7.40-1.1
(192)     [1] [Dez 01 11:44:49:341] [sapgui-7-40] 
(193)     [5] [Dez 01 11:44:49:341] [sapgui-7-40] We do not look for a update script, because the setup script is failed
(194)     [6] [Dez 01 11:44:49:342] [sapgui-7-40] JSON service request https://172.23.10.177:4447/rpc productOnClient_updateObject
(195)     [6] [Dez 01 11:44:49:457] [sapgui-7-40] JSON Bench for productOnClient_updateObject "params":[{"clientId":"w10-v1.et.local","actionRes Start: 11:44:49:342 Time: 00:00:00:115
(196)     [6] [Dez 01 11:44:49:548] Registry key [HKLM\SOFTWARE\opsi.org\winst]  opened
(197)     [6] [Dez 01 11:44:49:548]                 Variable "RebootRequested"  is keeping its value "0"
(198)     [6] [Dez 01 11:44:49:548]                 Variable "LastLogFilename"  is keeping its value "c:\opsi.org\log\opsi-script.log"
(199)     [6] [Dez 01 11:44:49:548]                 Variable "ContinueLogFile"  is keeping its value "0"
(200)     [4] [Dez 01 11:44:49:548]                 Variable "NumberOfErrors"  not found. Code: 2
(201)     [6] [Dez 01 11:44:49:551]                 Key flushed
(202)     [6] [Dez 01 11:44:49:552]                 Key closed
(203)     [5] [Dez 01 11:44:49:556] -------- submitted part of log file ends here, see the rest of log file on client ----------
andré
Beiträge: 328
Registriert: 07 Jan 2014, 10:48

Re: SAP Uninstall / Install Fehler

Beitrag von andré »

Wenn du im Opsiconfigeditor setup auswählst, wird die Datei ausgeführt, die innerhalb der control-Datei unter setupScript eingetragen ist. Bei dir ist das die Datei setup32.opsiscript.

Alles was in der Datei drin steht, wird beim Ausführen von setup durchgeführt. Ich vermute, du hast einen Denkfehler bei der Auswirkung dieses Befehls.

Code: Alles auswählen

if FileExists("%ScriptPath%\delsub32.opsiscript")
      comment "Start uninstall sub section"
      Sub "%ScriptPath%\delsub32.opsiscript"
endif
Das bedeutet, dass das Setup-Skript nachprüft, ob die delsub32 vorhanden ist, und wenn sie da ist, wird sie mittels Sub aufgerufen, ergo, vor der Installation wird eine Deinstallation durchgeführt. Wenn du das nicht möchtest, solltest du die ganze if-Abfrage entfernen.

Edit: Zum Abbruch des Skriptes: Normalerweise ruft man den uninstaller mittels einer uninstall.ins, oder ähnlich, auf. Teilweise sind Befehle dann in einer delsub-Datei ausgelagert. Wenn du also aus dem blauen heraus nur die delsub aufrufst die nur einen Teil des Uninstallers enthält, bricht das Skript dann halt ab. Kommt halt darauf an, was genau in der delsub32.opsiscript drin steht.
Golf2
Beiträge: 31
Registriert: 07 Feb 2013, 15:18

Re: SAP Uninstall / Install Fehler

Beitrag von Golf2 »

Jup, hab ich eben auch gesehen.... war nur etwas verplant, warum das Setupscript ins die delsub springt. Nach dem löschen ging es.
Aber auch den Sinn habe ich jetzt verstanden. Aber wenn mal als Anfänger im Bereich Scripting zwei Tage nur Code liest, sieht man irgendwann den Wald vor lauter Bäumen nicht mehr.

Als letztes, stolpere ich noch über diesen Fehler.
Ich versuche nach der Deinstallation den SAP Ordner zu löschen mit:

Code: Alles auswählen

del -sf "$InstallDir$\"
Erhalte dann im Log aber den Fehler:

Code: Alles auswählen

Warning: "Directory C:\Program Files\SAP" cannot be deleted, error 145 ("Das Verzeichnis ist nicht leer.<"). 
Dies stimmt natürlich (Es sind noch logs drin), sollte doch aber mit dem Schalter -sf erledigt sein....oder?
andré
Beiträge: 328
Registriert: 07 Jan 2014, 10:48

Re: SAP Uninstall / Install Fehler

Beitrag von andré »

Irgendein Prozess greift noch auf die Log-Dateien zu. Zumindest ist das bei mir immer der Fall gewesen, wenn das bei mir auftrat.

Dafür habe ich vorm Löschen solcher Ordner immer noch mal alle Prozesse gekillt, die mit dem Programm zu tun hatten.
Beispiel:

Code: Alles auswählen

[WinBatch_Kill_Programm]
taskkill /IM Programm.exe /F
Golf2
Beiträge: 31
Registriert: 07 Feb 2013, 15:18

Re: SAP Uninstall / Install Fehler

Beitrag von Golf2 »

Sollte dann aber nicht

Code: Alles auswählen

del -sfc "$InstallDir$\"
nach einem Reboot alles löschen?

Code: Alles auswählen

Delete [-sfcd[n]] <Datei(maske)> [W/L]
Löschen einer Datei bzw. eines Verzeichnisses. Mögliche Optionen (die in beliebiger Reihenfolge aufgeführt sein
können) sind:
– s → subdirectories
Steht für die Rekursion in Subdirectories, das heißt, der ganze Pfad bzw. alle der Dateimaske entsprechenden
Dateien im Verzeichnisbaum ab der angegebenen Stelle werden gelöscht.
Achtung
Der Befehl
delete -s c:\opsi
Bedeutet nicht lösche das Verzeichnis c:\opsi rekursiv, sondern lösche ab c:\ rekursiv alle Dateien namens
opsi (und führt damit evtl. zum kompletten Durchsuchen der Festplatte). Zum rekursiven Löschen von
c:\opsi verwenden Sie das Kommando:
delete -s c:\opsi\
Durch den angehängen Backslash ist deutlich, dass Sie ein Verzeichnis meinen.
Es ist sicherer das Kommando del stattdessen zu verwenden
– f → force
Erzwingt ("force") das Löschen auch von read-only-Dateien.
– c → continue [W]
Wenn eine Datei in Benutzung ist, kann sie im Rahmen eines Reboots gelöscht werden. Das opsi-winst/opsi-script
default-Verhalten ist dabei, dass ein Datei in Benutzung zum Löschen beim nächsten Reboot markiert wird UND
die opsi-winst/opsi-script Reboot Markierung gesetzt wird. Das Setzen der Option -c stellt den automatischen
Reboot aus. Das Löschen wird in diesem Fall erst dann vervollständigt, wenn ein Reboot auf eine andere Weise
ausgelöst wird.
– d [n] → date
Dateien werden nur gelöscht, sofern sie mindestens n Tage alt sind. Default für n ist 1.
• del [Options] <path[/mask]] //since 4.11.2.1 [W/L]
Arbeitet wie delete aber bei
del -s -f c:\not-exists
wenn c:\not-exists nicht existiert wird nicht das komplette c:\ nach not-exits durchsucht.
Beispiel (Der anhängende Backslash darf weggelassen werden):
del -sf c:\delete_this_dir
Anmerkung
+ Mit del oder delete lassen sich bestimmte Verzeichnisse aus Sicherheitsgründen nicht löschen:
c:\,c:\windows,c:\windows\system32,\*

Ich werde deinen Vorschlag morgen mal testen. :)
andré
Beiträge: 328
Registriert: 07 Jan 2014, 10:48

Re: SAP Uninstall / Install Fehler

Beitrag von andré »

Golf2 hat geschrieben:Sollte dann aber nicht

Code: Alles auswählen

del -sfc "$InstallDir$\"
nach einem Reboot alles löschen?
Eigentlich schon, hat das etwa nicht funktioniert? Ich kille die Prozesse, damit ich einen Reboot vermeiden kann und bisher hat das hier auch immer geklappt.

Edit: Quatsch, habe mich verlesen. -c sorgt nur dafür, dass du anderweitig neu starten musst. Keine Ahnung, ob das was bringt. Ich habe es bisher noch nicht erlebt, dass das Löschen nach einem Neustart fortgesetzt wurde, dazu kann ich nichts sagen.
Antworten