Packer windows installer never finishes

26 views
Skip to first unread message

Gomsy

unread,
Jan 23, 2020, 2:50:10 PM1/23/20
to Packer
Hi,

I am using packer with ebs-builder and powershell provisioner to build a Windows Server 2016 image. I am running a silent installer using following powershell command
Start-Process "$InstallPath" -ArgumentList "$AnswerFilePath"  -Wait -NoNewWindow

When running this command manually the command is exiting without any issue but when running from powershell provisioner in packer the packer build get stuck at this step.
I ensured that the variables $InstallPath and $AnswerFilePath and properly set. The reason while I am running installer via Start-Process is because otherwise the installer exist immediately while installation happens in the background.

Any idea what could be the issue?

Thanks,
-Gautam


Ravi Tiwary

unread,
Feb 6, 2020, 10:14:28 PM2/6/20
to Packer
Hi Gautam,

I am facing same issue, did you had a chance to find a solution for the below?

Thanks,
Ravi

Andy Burrows

unread,
Feb 7, 2020, 4:49:41 AM2/7/20
to Packer
Gautam, I;'ve read a post where you should run the process in the foreground as follows

            $proc = Start-Process -FilePath "<Path to Execuable>" -ArgumentList "arg1","arg2" -Wait -WindowStyle Maximized -PassThru
            $proc.WaitForExit()

haven't yet tried it, will let you know how we get on

Cheers,
Andy

Gautam Singh

unread,
Feb 7, 2020, 9:16:15 AM2/7/20
to packe...@googlegroups.com
Hi Andy

You don't need to call waitOnExit explicitly. When you use -Wait switch Start-Process waits for installer to finish. 
Assuming your installer is not opening any dialog, you only need following.


Start-Process -FilePath "<Path to Execuable>" -ArgumentList "arg1","arg2" -Wait -WindowStyle Maximized -PassThru
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/d5a0de8f-eaac-451a-91fb-6978812e9c22%40googlegroups.com.

Gautam Singh

unread,
Feb 7, 2020, 9:19:19 AM2/7/20
to packe...@googlegroups.com
Hi Ravi,

No I was not able to solve this particular issue, but the same way is working for other installers. Hence I assumed something is wrong with the installer itself. I workaround the problem by using sleep in conjunction with checking if the service that needs to be installed is up and running.



--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages