0

I have a bootstrap script which does a lot of things to setup a new Windows installation. It calls other scripts within that script, including this one which installs some packages using winget:

@echo off

:: Install essential packages
winget install -e --id Git.Git
winget install -e --id Google.Chrome
winget install -e --id Logitech.OptionsPlus
winget install -e --id M2Team.NanaZip
winget install -e --id Microsoft.PowerToys
winget install -e --id Microsoft.VCRedist.2015+.x64
winget install -e --id Microsoft.VCRedist.2015+.x86
winget install -e --id Microsoft.WindowsTerminal
winget install -e --id Mozilla.Firefox
winget install -e --id Notion.Notion
winget install -e --id SomePythonThings.WingetUIStore
winget install -e --id WinDirStat.WinDirStat --include-unknown
winget install -e --id WinSCP.WinSCP
winget install -e --id chrisant996.Clink
winget install -e --id gerardog.gsudo
winget install -e --id hluk.CopyQ
winget install -e --id qutebrowser.qutebrowser -l "C:\Program Files\qutebrowser"
winget install -e --id vim.vim

It installs every up to Notion and then install WingetUIStore, but that takes quite a long time (I know this as it starts running when it finally does intstall), but then the next 6 packages are skipped and only vim gets installed after that. Running the script again installs the 6 missing packages.

Why is this happening and what can I do about it?

4
  • Do you get an error message? Have you tried installing the packages without installing WingetUIStore? Commented Jun 13 at 6:35
  • @ReddyLutonadio I'll experiment in virtual machines later..
    – paradroid
    Commented Jun 13 at 6:42
  • 1
    My best guess from what you've posted is that the issue is your UI is opening after install, and therefore preventing the script from continuing until it has been closed. You could try to see if the --custom or --override options can be used for that particular package to prevent it from starting once installed. If that doesn't work, you could try running that particular command using start, so that the next can run whilst that continues separately to the rest; i.e. start winget.exe install --id SomePythonThings.WingetUIStore --exact.
    – Compo
    Commented Jun 14 at 8:11
  • @Compo Thanks, that led me to find the solution.
    – paradroid
    Commented Jun 23 at 21:55

2 Answers 2

1

You can troubleshoot:

  • Add --verbose to the winget commands to increase logging verbosity.
  • Use echo statements to print the current package being installed and the installation status.
  • Use timeout or sleep commands to introduce delays between installations to ensure each package is fully installed before moving to the next one.

By addressing these potential issues, you should be able to resolve the problem and ensure that all packages are installed successfully in a single run.

0

After reading Compo's comment I went on to figure out the solution as this:

winget install -e --id SomePythonThings.WingetUIStore --override "/SP /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /NoAutoStart /ALLUSERS /LANG=english"

/NoAutoStart is what needed to be added to the installer options, with the rest of the options being ones already used by winget before the override.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .