Managing Reboots

(imported topic written by StiRazzi)

Hello,

I’m trying to write a custom actiont that uninstall a program (there are several services), then wait for the agent to reboot (whitout disturbing the user) and then reinstall it.

How is it possible to let the action wait before proceding with the new install???

Thansk

Gio

(imported comment written by StiRazzi)

waithidden __Download\uninstallAll.cmd

action requires restart

wait __Download\deployca.exe /VERYSILENT /NORESTART

tried this with no success…

the III line starts immediately without waiting for reboot

(imported comment written by SystemAdmin)

A short baseline would be a good approach to handle the reboot.

Custom task 1:

waithidden __Download\uninstallAll.cmd

action requires restart

restart 60

Custom task 2:

pause while {pending restart}

wait __Download\deployca.exe /VERYSILENT /NORESTART

Put these tasks into a baseline, then run the baseline.

(imported comment written by StiRazzi)

Thanks for the prompt replay.

i made the baseline but the Custom task 2 fails on the first row:

pause while {pending restart}

(imported comment written by SystemAdmin)

Try it without that line.

(imported comment written by StiRazzi)

I’ trying with that script:

Completato delete “c:\uno.txt”

Completato delete “c:\due.txt”

Completato createfile until fineFile1

Completato Operating system = {name of operating system}

Completato Processor count = {number of processors}

Completato fineFile1

Completato copy __createfile “c:\uno.txt”

Completato action requires restart

In esecuzione pause while {pending restart} <---- The script stops here, waiting a reboot

createfile until fineFile2

Operating system = {name of operating system}

Processor count = {number of processors}

fineFile2

copy __createfile “c:\due.txt”

after the reboot the action fails.

removing the line the script execute all the lines and then signals a pending restart.

(imported comment written by SystemAdmin)

Look back at my original post and try following that exactly. The two part need to be in separate custom tasks that are run one after another in a baseline. If you try to put it all in one task, it will not work.

(imported comment written by StiRazzi)

Ok, with your first script it works!

But the problem is that the agent is rebooted also without user intervention, cause of the restart command.

if I try without the “restart 60” command, the client starts the next action before the client restart, and when the user reboots, the clause fails with error.