NTLite command line from non-interactive GUI?

cshirley101675

New Member
Messages
14
Reaction score
0
I am trying to automate building images with a build tool (e.g. Jenkins) via using the CLI. Is there a way we can run NTLite in a non-interactive GUI (console only)?

This is the command I am currently running:
E:\NTLite\NTLite.exe /LoadImage:"E:\Win10_Pro" /ImageIndex:1 /LoadPreset:"Win10_Pro" /CreateIso:"E:\Win10_Pro.iso" /IsoLabel:"Win10 Pro" /ExitAfter:1

This command runs perfectly as expected locally testing, however when running via Jenkins, it is expecting the GUI to be launched and Jenkins is expecting the application to run in a console only mode. Is this possible?
 
There's only one NTLite program file, and it doesn't support a console-only mode.

I don't know Jenkins, but two probable problems will present themselves:
1. NTLite expects to run inside the context of a desktop window session.
2. Your calling instance should wait for NTLite to exit before returning control back to Jenkins.

Here's an example PowerShell script. You can't use CMD since NTLite forks itself into the background, so "start /wait" has no effect.
Code:
$NTLite = 'E:\NTLite\NTLite.exe'
$Args = '/LoadImage:"E:\Win10_Pro" /ImageIndex:1 /LoadPreset:"Win10_Pro" /CreateIso:"E:\Win10_Pro.iso" /IsoLabel:"Win10 Pro"'

Start-Process $NTLite -ArgumentList $($Args + ' /ExitAfter:1')

# Wait for exit
while (Get-Process NTLite) { Start-Sleep 60 }
 
Back
Top