Script wird nach /ImmeditateReboot nicht fortgeführt.

Antworten
djdodo
Beiträge: 164
Registriert: 12 Jan 2011, 10:54

Script wird nach /ImmeditateReboot nicht fortgeführt.

Beitrag von djdodo »

Hallo zusammen,
eine meiner Installationen sollte vor dem eigentlichen Setup immer einen sauberen Reboot haben. Da ich aber nie genau weiß, welches Paket vorher läuft, habe ich den Reboot also ins eigentliche Paket:

Code: Alles auswählen

[Initial]
Message "Installation SAPGui (8 Minuten Dauer!)"
setLogLevel=6
[Actions]
DefVar $BIT$
DefVar $NTVersion$
Set $BIT$ = GetSystemType
Set $NTVersion$ = GetMSVersionInfo


;DefVar %ScriptPath%
;Set %ScriptPath%="P:\packages\SAPGui"	

DefVar $Flag$
DefVar $WinstRegKey$
DefVar $RebootRegVar$
Set $WinstRegKey$ = "HKLM\SOFTWARE\opsi.org\winst"
Set $Flag$ = GetRegistryStringValue32("["+$WinstRegKey$+"] "+"RebootFlag")

if not ($Flag$ = "1")
	Set $Flag$ = "1"
	Registry_SaveRebootFlag
	ExitWindows /ImmediateReboot
else
	Set $Flag$ = "0"
	Registry_SaveRebootFlag
	if ( $NTVersion$ = "10.0" )
		;Win10
		if ($BIT$ = "64 Bit System")
			;64Bit?
			sub_install
		else
			stop "Keine unterstützte Betriebssystem-Version"
		endif
	else
		stop "Keine unterstützte Betriebssystem-Version"			
	endif
endif


[Registry_SaveRebootFlag]
openKey [$WinstRegKey$]
set "RebootFlag" = "$Flag$"


[sub_install]
if FileExists ("%ProgramFiles32Dir%\SAP\FrontEnd\SAPgui\sapgui.exe")
	WinBatch_Setup
else
	WinBatch_Setup
endif


[WinBatch_Setup]
"%scriptpath%\vstor_redist.exe" /q /norestart
"%scriptpath%\MicrosoftEdgeWebview2Setup.exe" /silent /install

"%scriptpath%\Standard.exe" /silent

regedit /s %ScriptPath%\SAPGUI.reg
Nach dem Reboot wird aber das Script nicht mehr angestartet, sondern gleich das nächste.

Auszug aus dem Log:

Code: Alles auswählen

(2368)    [6] [Mai 03 10:10:25:220] Actionrequest for product: sapgui is (original/actual): (setup / setup)
(2369)    [6] [Mai 03 10:10:25:224] [sapgui] Actionrequest for Product: sapgui is: setup
(2370)    [6] [Mai 03 10:10:25:359] [sapgui] JSON Bench for getProductProperties_hash "params":["sapgui","<removed>"],"id": Start: 10:10:25:224 Time: 00:00:00:135
(2371)    [6] [Mai 03 10:10:25:455] [sapgui] JSON Bench for getProduct_hash "params":["sapgui","<removed>"],"id" Start: 10:10:25:360 Time: 00:00:00:095
(2372)    [6] [Mai 03 10:10:25:485] [sapgui] JSON Bench for productOnClient_getObjects "params":["",{"clientId":"<removed>", Start: 10:10:25:456 Time: 00:00:00:028
(2373)    [6] [Mai 03 10:10:25:486] [sapgui] scriptname: "setup.ins", special path: "p:\sapgui\"
(2374)    [6] [Mai 03 10:10:25:527] [sapgui] JSON Bench for productOnClient_updateObject "params":[{"clientId":"<removed>","ac Start: 10:10:25:486 Time: 00:00:00:041
(2375)    [6] [Mai 03 10:10:25:527] [sapgui] Using new Depot path:  p:\
(2376)    [1] [Mai 03 10:10:25:549] [sapgui] 
(2377)    [1] [Mai 03 10:10:25:549] [sapgui] ============ Version 4.12.3.12 script "p:\sapgui\setup.ins"
(2378)    [1] [Mai 03 10:10:25:549] [sapgui]              used script encoding: cp1252
(2379)    [1] [Mai 03 10:10:25:549] [sapgui]              used system encoding: cp1252
(2380)    [1] [Mai 03 10:10:25:549] [sapgui]              start: 2021-05-03  10:10:25
(2381)    [1] [Mai 03 10:10:25:549] [sapgui]              installing product: sapgui_7.70-1
(2382)    [1] [Mai 03 10:10:25:549] [sapgui]              on client named    "<removed>"
(2383)    [1] [Mai 03 10:10:25:549] [sapgui]              loggedin user    ""
(2384)    [1] [Mai 03 10:10:25:549] [sapgui]              opsi-script running as    "SYSTEM"
(2385)    [1] [Mai 03 10:10:25:549] [sapgui]              opsi-script running with admin privileges
(2386)    [1] [Mai 03 10:10:25:549] [sapgui]              opsi-script running in standard script mode
(2387)    [1] [Mai 03 10:10:25:549] [sapgui] executing: "C:\Program Files (x86)\opsi.org\opsi-client-agent\opsi-winst\winst32.exe"
(2388)    [1] [Mai 03 10:10:25:549] [sapgui] system infos:
(2389)    [1] [Mai 03 10:10:25:550] [sapgui] <removed>  -  PC hardware address
(2390)    [1] [Mai 03 10:10:25:550] [sapgui] <removed>  -  IP name
(2391)    [1] [Mai 03 10:10:25:550] [sapgui] <removed>  -  IP address
(2392)    [1] [Mai 03 10:10:25:550] [sapgui] DEU  -  System default locale
(2393)    [6] [Mai 03 10:10:25:550] [sapgui] Registry key [HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion]  opened
(2394)    [6] [Mai 03 10:10:25:550] [sapgui] Key closed
(2395)    [1] [Mai 03 10:10:25:550] [sapgui] MS Windows 10.0 64 Bit, Release: 2009, Edition: PRODUCT_PROFESSIONAL
(2396)    [1] [Mai 03 10:10:25:550] [sapgui] opsi service version : 4
(2397)    [1] [Mai 03 10:10:25:550] [sapgui] 
(2398)    [6] [Mai 03 10:10:25:551] [sapgui] Registry key [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion]  opened
(2399)    [6] [Mai 03 10:10:25:551] [sapgui] Key closed
(2400)    [5] [Mai 03 10:10:25:592] [sapgui] message Installation SAPGui (8 Minuten Dauer!)
(2401)    [6] [Mai 03 10:10:25:595] [sapgui] LogLevel was 6
(2402)    [6] [Mai 03 10:10:25:595] [sapgui] LogLevel set to 6
(2403)    [6] [Mai 03 10:10:25:596] [sapgui] Set  $BIT$ = GetSystemType
(2404)    [6] [Mai 03 10:10:25:596] [sapgui]   The value of the variable "$BIT$" is now: "64 Bit System"
(2405)    [6] [Mai 03 10:10:25:596] [sapgui] Set  $NTVersion$ = GetMSVersionInfo
(2406)    [6] [Mai 03 10:10:25:596] [sapgui]   The value of the variable "$NTVersion$" is now: "10.0"
(2407)    [6] [Mai 03 10:10:25:596] [sapgui] Set  $WinstRegKey$ = "HKLM\SOFTWARE\opsi.org\winst"
(2408)    [6] [Mai 03 10:10:25:596] [sapgui]   The value of the variable "$WinstRegKey$" is now: "HKLM\SOFTWARE\opsi.org\winst"
(2409)    [6] [Mai 03 10:10:25:597] [sapgui] Set  $Flag$ = GetRegistryStringValue32("["+$WinstRegKey$+"] "+"RebootFlag")
(2410)    [6] [Mai 03 10:10:25:597] [sapgui] Registry key [HKLM\SOFTWARE\opsi.org\winst]  opened
(2411)    [6] [Mai 03 10:10:25:597] [sapgui] Variable "RebootFlag"  not found. Code: 2
(2412)    [6] [Mai 03 10:10:25:597] [sapgui] Variable "RebootFlag"  not found. Code: 2
(2413)    [6] [Mai 03 10:10:25:597] [sapgui] Key closed
(2414)    [6] [Mai 03 10:10:25:597] [sapgui]   The value of the variable "$Flag$" is now: ""
(2415)    [6] [Mai 03 10:10:25:597] [sapgui] If
(2416)    [6] [Mai 03 10:10:25:597] [sapgui]   not ($Flag$ = "1")   <<< result true
(2417)    [6] [Mai 03 10:10:25:597] [sapgui] Then
(2418)    [6] [Mai 03 10:10:25:597] [sapgui]   Set  $Flag$ = "1"
(2419)    [6] [Mai 03 10:10:25:597] [sapgui]     The value of the variable "$Flag$" is now: "1"
(2420)    [5] [Mai 03 10:10:25:597] [sapgui]   Execution of: Registry_SaveRebootFlag
(2421)    [5] [Mai 03 10:10:25:597] [sapgui]   
(2422)    [6] [Mai 03 10:10:25:597] [sapgui]     Registry key [HKLM\SOFTWARE\opsi.org\winst]  opened
(2423)    [6] [Mai 03 10:10:25:597] [sapgui]         Variable "RebootFlag"  set to "1"
(2424)    [6] [Mai 03 10:10:25:597] [sapgui]         Key closed
(2425)    [6] [Mai 03 10:10:25:597] [sapgui]   ExitWindows set to Immediate Reboot
(2426)    [6] [Mai 03 10:10:25:597] [sapgui]   Process stopped
(2427)    [1] [Mai 03 10:10:25:597] [sapgui] ___________________
(2428)    [1] [Mai 03 10:10:25:597] [sapgui] script finished: success
(2429)    [1] [Mai 03 10:10:25:597] [sapgui] 0 errors
(2430)    [1] [Mai 03 10:10:25:597] [sapgui] 0 warnings
(2431)    [1] [Mai 03 10:10:25:598] [sapgui] 
(2432)    [1] [Mai 03 10:10:25:598] [sapgui] installed product: sapgui Version: 7.70-1
(2433)    [1] [Mai 03 10:10:25:598] [sapgui] 
(2434)    [6] [Mai 03 10:10:25:598] Registry key [HKLM\SOFTWARE\opsi.org\winst]  opened
(2435)    [6] [Mai 03 10:10:25:598]                 Variable "RebootRequested"  had value  "0"
(2436)    [6] [Mai 03 10:10:25:598]                 Info:    "RebootRequested"  changed to "4"
(2437)    [6] [Mai 03 10:10:25:598]                 Variable "LastLogFilename"  is keeping its value "c:\opsi.org\log\opsi-script.log"
(2438)    [6] [Mai 03 10:10:25:598]                 Variable "ContinueLogFile"  is keeping its value "1"
(2439)    [6] [Mai 03 10:10:25:598]                 Variable "NumberOfErrors"  is keeping its value "2"
(2440)    [6] [Mai 03 10:10:25:606]                 Key flushed
(2441)    [6] [Mai 03 10:10:25:606]                 Key closed
(2442)    [6] [Mai 03 10:10:25:623]                 JSON Bench for backend_getSystemConfiguration "params":[],"id":1} Start: 10:10:25:608 Time: 00:00:00:015
(2443)    [6] [Mai 03 10:10:25:623]                 Checking if partlog: is bigger than 5 MB :.
(2444)    [6] [Mai 03 10:10:25:623]                 Checking if partlog: c:\opsi.org\log\\opsi-script-part-Pz93Af68.log is bigger than 5 MB - found: 0 MB
(2445)    [5] [Mai 03 10:10:25:623] -------- submitted part of log file ends here, see the rest of log file on client ----------
(2446)    [1] [Mai 03 10:17:48:538] --
(2447)    [1] [Mai 03 10:17:48:538] --
(2448)    [1] [Mai 03 10:17:48:538] c:\opsi.org\log\\opsi-script-part-Vf86Go36.log
(2449)    [1] [Mai 03 10:17:48:538] 
(2450)    [1] [Mai 03 10:17:48:538] 
(2451)    [1] [Mai 03 10:17:48:538] ======= APPEND   03.05.2021 10:17:48
(2452)    [1] [Mai 03 10:17:48:538] opsi-script 4.12.3.12 started at >>
(2453)    [1] [Mai 03 10:17:48:538] opsi-script log file with encoding utf8
(2454)    [1] [Mai 03 10:17:48:538] startmessage opsi-script created at CentralForm.FormCreate: 03.05.2021 10:17:47
(2455)    [1] [Mai 03 10:17:48:538] Loading skin from: C:\Program Files (x86)\opsi.org\opsi-client-agent\opsi-winst\winstskin
(2456)    [1] [Mai 03 10:17:48:539] Called with parameter: /opsiservice\r\nhttps://<removed>:4447/rpc\r\n/clientid\r\n<removed>\r\n/username\r\n<removed>\r\n/password\r\n***(confidential)***
(2457)    [1] [Mai 03 10:17:48:539] Depot path from readconfig:  p:\ 03.05.2021 10:17:47
(2458)    [1] [Mai 03 10:17:48:539] startmessage StartProgramModes and create log: 03.05.2021 10:17:47
(2459)    [1] [Mai 03 10:17:48:539] pm: 5 03.05.2021 10:17:47
(2460)    [1] [Mai 03 10:17:48:539] startmessage start opsi service connection: 03.05.2021 10:17:47
(2461)    [1] [Mai 03 10:17:48:539] startmessage: opsidata initialized: 03.05.2021 10:17:48
(2462)    [1] [Mai 03 10:17:48:539] <removed>
(2463)    [1] [Mai 03 10:17:48:539] Starting Servicecall: backend_info
(2464)    [1] [Mai 03 10:17:48:539] Success Servicecall: backend_info
(2465)    [1] [Mai 03 10:17:48:539] got AutoActivityDisplay: true
(2466)    [1] [Mai 03 10:17:48:539] got debug_lib: false
(2467)    [1] [Mai 03 10:17:48:539] got debug_prog: false
(2468)    [1] [Mai 03 10:17:48:539] got default_loglevel: 6
(2469)    [1] [Mai 03 10:17:48:539] got config: opsi-script.global.force_min_loglevel
(2470)    [1] [Mai 03 10:17:48:539] got force_min_loglevel: 0
(2471)    [1] [Mai 03 10:17:48:539] got ReverseProductOrderByUninstall: false
(2472)    [1] [Mai 03 10:17:48:539] got ScriptErrorMessages: false
(2473)    [1] [Mai 03 10:17:48:539] got w10BitlockerSuspendOnReboot: false
(2474)    [1] [Mai 03 10:17:48:539] readConfigFromService: ok
(2475)    [1] [Mai 03 10:17:48:539] startmessage create log: 03.05.2021 10:17:48
(2476)    [1] [Mai 03 10:17:48:539] force_min_loglevel: 0
(2477)    [1] [Mai 03 10:17:48:539] default_loglevel: 6
(2478)    [1] [Mai 03 10:17:48:539] debug_prog: false
(2479)    [1] [Mai 03 10:17:48:539] debug_lib: false
(2480)    [6] [Mai 03 10:17:48:622] JSON Bench for getDepotId "params":["<removed>"],"id":1} Start: 10:17:48:539 Time: 00:00:00:083
(2481)    [6] [Mai 03 10:17:48:814] JSON Bench for getProductOrdering "params":["<removed>"],"id":1} Start: 10:17:48:622 Time: 00:00:00:192
(2482)    [6] [Mai 03 10:17:48:914] JSON Bench for productOnClient_getObjects "params":["",{"clientId":"<removed>", Start: 10:17:48:814 Time: 00:00:00:100
(2483)    [1] [Mai 03 10:17:48:950] Computername:<removed>
(2484)    [1] [Mai 03 10:17:48:950] Computername according to Environment Variable :<removed>
(2485)    [1] [Mai 03 10:17:48:950] opsi service URL https://<removed>:4447
(2486)    [6] [Mai 03 10:17:48:950] Depot path:  p:\
(2487)    [6] [Mai 03 10:17:48:950] 
(2488)    [6] [Mai 03 10:17:48:953] bootmode BKSTD
(2489)    [6] [Mai 03 10:17:48:953] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(2490)    [6] [Mai 03 10:17:48:953] Resolved sequence of products (03.05.2021 10:17:48):
(2491)    [6] [Mai 03 10:17:48:954] Product 23 	slc : setup
(2492)    [6] [Mai 03 10:17:48:954] Product 24 	systemupdate : setup
(2493)    [6] [Mai 03 10:17:48:954] Product 25 	ultravnc : setup
(2494)    [6] [Mai 03 10:17:48:954] Product 26 	swaudit : setup
(2495)    [6] [Mai 03 10:17:48:954] Product 27 	lenovodocktreiber : setup
(2496)    [6] [Mai 03 10:17:48:954] Product 28 	initialconfig : setup
(2497)    [6] [Mai 03 10:17:48:954] Product 29 	windowsupdates : setup
(2498)    [6] [Mai 03 10:17:48:954] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Die Reboot-Schleife ist nach dem Beispiel aus winstdoc-de gestaltet.

Kann jemand helfen?

Lg
Dodo
Antworten