Post-Setup: Download and install multiple choco apps (seems to miss a few apps)

kreemerz

Member
I was using Chocolatey to install my apps needed on this laptop. But lately it seems to only install 4 of 10 of them. Not sure why,
I want to try winget or winstall but not how to write the code to make it work. Those sites will create the script but they don't include the commands in the script to make it work.

I use the following script:

@echo off
powershell -NoProfile -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"
set PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

choco install office365business -y
choco install adobereader -y
choco install obs-studio.install -y
choco install googlechrome -y
choco install firefox -y
choco install notepadplusplus.install -y
choco install office365business -y
choco install adblockplus-firefox -y
choco install 7zip -y
choco install nordvpn -y
choco install roboform -y
choco install steam-client -y
choco install googleearthpro -y
choco install telegram.install -y

choco install ocenaudio.install -y
 
If it works for some packages, it should work for all unless they have unfulfilled dependencies. For example: OBS Studio and NordVPN.

I would redirect output from script into a log file, and see what's going on. I've tested the above script myself, but haven't tried a wide range of packages. The other possibility is Post-Setup runs as SYSTEM, and not as yourself.
 
If it works for some packages, it should work for all unless they have unfulfilled dependencies. For example: OBS Studio and NordVPN.

I would redirect output from script into a log file, and see what's going on. I've tested the above script myself, but haven't tried a wide range of packages. The other possibility is Post-Setup runs as SYSTEM, and not as yourself.
runs as system?
not sure what you mean.
I generally just drag the file into NTLITE. I don't really change anything. Maybe I should?
I added a winget powershell file. but it wont install.
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    127.6 KB
Post-Setup tasks are run by the SYSTEM account (which has the same rights as Administrator). Some apps don't install correctly, because they make assumptions on who is running setup.

winget in Post-Setup:
https://www.ntlite.com/community/in...image-for-post-setup-installs.2916/post-27586
Any reason why Ninite works and installs the apps without any issue? I would continue using that except it doesn't have all the apps I want. I don't know much about scripts, powershell commands, etc... was just trying to have Ntlite include some apps of my choice in the installation.
 
Ninite Pro is required for unattended installs.

Again, you don't list which apps don't install correctly. Instead of bouncing from one installer to another, why not figure out why specific apps don't work. I've only got so much holiday spirit to entertain questions...

The most likely answer is some apps expect to install as you, instead of running under the SYSTEM user. SYSTEM is already privileged, so any detection they do to elevate permissions will be broken. I've seen a number of random installers break this way.
 
Ninite Pro is required for unattended installs.

Again, you don't list which apps don't install correctly. Instead of bouncing from one installer to another, why not figure out why specific apps don't work. I've only got so much holiday spirit to entertain questions...

The most likely answer is some apps expect to install as you, instead of running under the SYSTEM user. SYSTEM is already privileged, so any detection they do to elevate permissions will be broken. I've seen a number of random installers break this way.
I appreciate your holiday spirit. I really do. I've been working on this for months and months.

The problem with Ninite Pro, is that it only has a library of about 143 apps. So it doesn't have the apps I need.

I know Chrome, Firefox, OBS, Office365, notepad++, install without issue. But all the rest do not install (including a couple of third party apps that are not included in Chocolatey.) My full list is in the original post. I also have an app called Amaseis.exe which is used for recording earthquakes. There are some items that it asks for during the installation - although they're not required in order for installation to complete.
 
Last edited:
I tried installing from this package list:
choco install netfx-4.8.1 -y
choco install vcredist2017 -y
choco install vcredist140 -y
choco install office365business -y​
choco install adobereader -y​
choco install obs-studio.install -y​
choco install googlechrome -y​
choco install firefox -y​
choco install notepadplusplus.install -y​
choco install adblockplus-firefox -y​
choco install 7zip -y​
choco install nordvpn -y​
choco install roboform -y​
choco install steam-client -y​
choco install googleearthpro -y​
choco install telegram.install -y​
choco install ocenaudio.install -y​

The only packages skipped:
nordvpn​
roboform​
steam-client​

If you followed my advice to redirect the batch file's output to a log file.
nordvpn v6.40.5 [Approved]
nordvpn package files install completed. Performing other installation steps.
Importing necessary certificates...
ERROR: Running ["C:\Windows\system32\certutil.exe" -addstore TrustedPublisher C:\ProgramData\chocolatey\lib\nordvpn\tools\tefincom-old.cer] was not successful. Exit code was '-2147024894'. See log for possible error messages.
The install of nordvpn was NOT successful.

Download of RoboForm-v9-Enterprise.msi (26.86 MB) completed.
Error - hashes do not match. Actual value was '4E3CED9DFB8A615ADFC6F673CCB63BAA22F13D71AFB5EC2F16CD475E36BA9307'.
ERROR: Checksum for 'C:\Windows\TEMP\chocolatey\RoboForm\9.2.1\RoboForm-v9-Enterprise.msi' did not meet '1753b25cd8452466e5e0c95dbc13da98a8f125e7a9d30f5b834a85ade1644cb2' for checksum type 'sha256'.
Consider passing the actual checksums through with --checksum --checksum64 once you validate the checksums are appropriate. A less secure option is to pass --ignore-checksums if necessary.
The install of roboform was NOT successful.

Download of SteamSetup.exe (2.19 MB) completed.
Error - hashes do not match. Actual value was '3B616CB0BEAACFFB53884B5BA0453312D2577DB598D2A877A3B251125FB281A1'.
ERROR: Checksum for 'C:\Windows\TEMP\chocolatey\steam-client\2.10.91.91\SteamSetup.exe' did not meet '874788B45DFC043289BA05387E83F27B4A046004A88A4C5EE7C073187FF65B9D' for checksum type 'sha256'
. Consider passing the actual checksums through with --checksum --checksum64 once you validate the checksums are appropriate. A less secure option is to pass --ignore-checksums if necessary.
The install of steam-client was NOT successful.

RoboForm is now 9.3.6
Steam Client is 2.10.91.91 /shrug

Santa wasn't sure if you were naughty or nice, so leave some cookies under the tree.
 

Attachments

  • Windows 10 x64-2022-12-24-16-45-10.png
    Windows 10 x64-2022-12-24-16-45-10.png
    192.8 KB
Chocolatey works fine with the example script.

When the script is run from Machine Execution, it's hidden behind the "spinning dots" screen. But you don't get any error logging, unless you redirect the script's output into a file.

When the script is run from User Execution, its opens a CMD windows and you can see it working. But if you have too many packages, then output scrolls off the the screen and is lost without a redirect to file.
 
Chocolatey works fine with the example script.

When the script is run from Machine Execution, it's hidden behind the "spinning dots" screen. But you don't get any error logging, unless you redirect the script's output into a file.

When the script is run from User Execution, its opens a CMD windows and you can see it working. But if you have too many packages, then output scrolls off the the screen and is lost without a redirect to file.
damn, this tool does wonders sir, only people like can never take it to full use...gonna use this features right away :D
 
Voice speech is usually Narrator and/or SpeechTTS packages. You can do a host refresh on licensed NTLite to restore individual components.
 
When using this script I get the "choco is not found"

I'm using a .ps1 script during machine post-setup. I noticed that setting the path is different in PowerShell than CMD which seems to be what this script is made for, maybe as a .bat, I was getting %ALLUSERSPROFILE% is invalid errors.

But even after the adjustments to using Env:ALLUSERSPROFILE instead of %ALLUSERSPROFILE% I still get "choco is not found"

When attempting to troubleshoot after post in the user environment when logged in Choco seems to work from any path just fine, just not while running the script.

Any thoughts?
Can attach logs later when I'm home if necessary as I'm outputting a transcript to file.
 
If you're converting it to a PS-only script, update the Path environment variable while it's running:
Code:
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")

choco install office365business -y
choco install adobereader -y
 
Back
Top