Execute-Process stalls - process finishes, but the toolkit is stuck

Hi guys,

I’m fairly new to psappdeploytoolkit. I’ve wrapped a few apps so far; Adobe Reader and MS Office 2016. And I’m currently in the process of wrapping our SAP GUI installation.

So executing NWsapsetup.exe works fine. The NWsapsetup logs finishes with error code 0, but psappdeploytoolkit doesn’t move on from installation phase to post-installation. It’s just stuck forever at Executing the process according to the log. To be sure I’ve tried finding and kill nwsapsetup.exe afterwards, but it is not running. I figured it’s because it’s spawning some other processes and maybe keeping an eye on those instead, but I can’t find other processes to fit that narrative.

Anyway - has anyone experienced something like this?

If not I will just add the parameter -nowait, and add my own powershell while loop that looks for the NWsapsetup log and final installation OK message, and then it can go on to post-installation.

Any help is appreciated.

1 Like

Hello,

that shouldn’t happen. After 3 years I hope it got fixed for you. My SAP script went through correctly. So I can’t really confirm this behavior. Could be due to an older toolkit version.

1 Like

Thanks for the reply - I had to execute the command “execute-process” with the parameter " -NoWait"

and create my own little loop:

    do{

        $ProcessActive = Get-Process SAP_GUI_7.60_patch_3_with_SSO_20200107_0920 -ErrorAction SilentlyContinue
        if($ProcessActive.Name -ne $null){
            $done = $false
            write-log "Wait 20 seconds for SAP_GUI_7.60_patch_3_with_SSO_20200107_0920.exe to finish." -Source 'Timing' -LogType 'CMTrace'
            }else{
            $done = $true
            write-log "SAP_GUI_7.60_patch_3_with_SSO_20200107_0920.exe is finished." -Source 'Timing' -LogType 'CMTrace'
            }
            start-sleep -s 10


        }
        Until($done)

Wow you replied after 3 years :smiley: I was curious whether the same would happen for you with newer toolkit versions.

1 Like

I think it does - but haven’t tried. I think it’s down to the SAP executable and nothing to do with PSADT.
Now it will launch the setup and then re-launch the setup in system context with a new Process ID and PSADT will continue too soon, so I am sticking to my little powershell snip that just monitors any ongoing process with that name.

Well yeah but I wrote scripts for SAP as well with no issues. It did wait for the process just fine. Not sure if the was additional parameter for it.