winget install

esullivan37

New Member
Messages
8
Reaction score
1
Just playing around with NTLite and I am hoping to install WINGET to the ISO or after. I have seen several posts with 10+ steps of goofy things to do, some appear to be no longer in NTLite.

In the Updates section you can add packages, if I have the appx package and the prerequisites shouldn't it just install?
 
Here's my current guide on installing winget, so you can start installing winget packages from Post-Setup (Before logon).

1. From Downloads Updater, download and integrate ALL THREE listed Appx packages:
Microsoft.DesktopAppInstaller​
Microsoft.UI.Xaml.2.7​
Microsoft.VCLibs.140.00.UWPDesktop​

2. Add a single PowerShell command to activate DesktopAppInstaller, so it works immediately instead of waiting a few minutes to be authorized.
 
Here's my current guide on installing winget, so you can start installing winget packages from Post-Setup (Before logon).

1. From Downloads Updater, download and integrate ALL THREE listed Appx packages:
Microsoft.DesktopAppInstaller​
Microsoft.UI.Xaml.2.7​
Microsoft.VCLibs.140.00.UWPDesktop​

2. Add a single PowerShell command to activate DesktopAppInstaller, so it works immediately instead of waiting a few minutes to be authorized.
When I do post setups, I do not have powershell commands, only command prompt commands
 
If you've already read some of my winget posts, I've repeated the same facts:
- winget is not a standalone app, it's bundled as part of UWP app DesktopAppInstaller.
- All UWP apps (including free ones) require a license, usually acquired by a background process.​
- Unless you've integrated a specific License1.xml into the image, this activation doesn't happen for several minutes.​
- winget as a command is useless, until DesktopAppInstaller is activated.​

Therefore you have three options:
1. Follow the older posts "with 10+ steps of goofy things to do", which still work. The only difference is Post-Setup (Machine) and (User) are now renamed as (Before logon) and (After logon). Just a different label.

2. Follow my above link, and add one PS command line to immediately activate DesktopAppInstaller. Which is my current advice.

3. Wait 5-10 minutes after Windows is done installing (for the background process), and run your CMD lines.
 
If you've already read some of my winget posts, I've repeated the same facts:
- winget is not a standalone app, it's bundled as part of UWP app DesktopAppInstaller.
- All UWP apps (including free ones) require a license, usually acquired by a background process.​
- Unless you've integrated a specific License1.xml into the image, this activation doesn't happen for several minutes.​
- winget as a command is useless, until DesktopAppInstaller is activated.​

Therefore you have three options:
1. Follow the older posts "with 10+ steps of goofy things to do", which still work. The only difference is Post-Setup (Machine) and (User) are now renamed as (Before logon) and (After logon). Just a different label.

2. Follow my above link, and add one PS command line to immediately activate DesktopAppInstaller. Which is my current advice.

3. Wait 5-10 minutes after Windows is done installing (for the background process), and run your CMD lines.

Like I said, I do not have the option to run a powershell command. Only Command Prompt. In the link you shared it says "PowerShell". Sorry I just found and started playing with NTLite yesterday. If I am missing something, my apologies. In Post-Setup I have commands for before and after login and the command shows the command prompt icon. I cannot set anything to powershell.

And if I cannot get winget running automatically, it's not the end of the world. Just trying and learning the software.
 
NTLite uses the same CMD icon to symbolize whatever Command (executable file) you're entering. This command can be any EXE found on the system, like cmd, wscript, cscript, powershell, etc.

Don't get phased by the icon. NTLite will copy this line into a batch script, but it's any command you would have executed sitting in CMD.
 
NTLite uses the same CMD icon to symbolize whatever Command (executable file) you're entering. This command can be any EXE found on the system, like cmd, wscript, cscript, powershell, etc.

Don't get phased by the icon. NTLite will copy this line into a batch script, but it's any command you would have executed sitting in CMD.
Sorry, In your link it says to run "Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe" but you cannot run that sitting in CMD as it's a powershell command.

One would expect that to be "powershell -command "Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe""? Or am I misunderstanding?
 
I THINK I am following now. Entering the task as powershell and the parameters as the add-app, NTLite will run that as "powershell -command" from CMD.

And adding the 3 files to the "Updates" section will make them available to the Post-Setup command, I assume?
 
For PowerShell, using the "-Command" argument is optional as it's implicit anything following on the command line is a PS statement. As long as the statement doesn't have any special characters that need escaping from CMD, it's all good.

"powershell -F" is mandatory for running a PS script.
 
And if I want to run a PS1 file, in the After Logon section, I would do type File and add the PS1 script (like in the screenshot). Anything in parameters? "-F" in parameters? Sorry once I understand what NTLite is looking for I can figure it out further.

Screenshot 2024-07-26 101634.png
 
When you add a Post-Setup file, NTLite does implicit recognition of several file types.
- *.bat, *.cmd files will be executed by "cmd /c"​
- *.ps1 files by "powershell -f"​
- *.exe files are executed as-is​
- *.reg files by "reg import"​
- *.jpg file is assumed to be a replacement desktop wallpaper image​

Parameters are always optional for Added files, and you're supposed to figure out if the script or EXE requires them or not.

Sometimes you will need a single CMD or powershell command to be executed. For those cases, you need to enter:

CommandParameters
cmd/c copy C:\file1 D:\file2
powershellGet-AppxPackage
 
For the last line, you don't need the Command to be "powershell", since "winget" is it's own executable file.

The line works any way, because PS generally assumes anything that isn't a PS statement will be an external command. You can invoke winget from within CMD or PS, but that's just wasting an extra step.

CommandParameters
wingetinstall -e -h --accept-package-agreements --accept-source-agreements --force --id CPUID.CPU-Z
 
For the last line, you don't need the Command to be "powershell", since "winget" is it's own executable file.

The line works any way, because PS generally assumes anything that isn't a PS statement will be an external command. You can invoke winget from within CMD or PS, but that's just wasting an extra step.

CommandParameters
wingetinstall -e -h --accept-package-agreements --accept-source-agreements --force --id CPUID.CPU-Z
Good to know thanks!
 
Yes, but winget isn't activated as a working command for another 5-10 min. after Windows installation ends. Open a CMD window immediately when you see the desktop, and try running winget. What happens? It's broken for the next 5-10 min.

For users wanting to install packages from Post-Setup, this is an obvious problem waiting for the licensing to finish.
 
Back
Top