Microsoft Deployment Workbench chocolatey problem - windows

I am currently testing Microsoft Deployment Workbench for automated Windows installation.
I have created a workflow with Windows 11 and would like to install the various programs via chocolatey after the Windows 11 installation.
Here you can see my workflow:
chocolatey is installed with a .bat script using:
command line: cmd.exe /c "%SCRIPTROOT%\BTNHD\chocoinstall.bat"
with the following content:
#powershell -noProfile -ExecutionPolicy unrestricted -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
then we restart the computer
then the script is started with the different programs, which looks like this:
command line: cmd.exe /c "%SCRIPTROOT%\BTNHD\installtemplate.bat"
with the following content:
choco install firefox --yes
choco install vlc --yes
Unfortunately it installs only the first software in the list at step 3, in my case Firefox and after that it takes a while and aborts with these error messages:
Now I have already tried the following things:
the reboot removed unfortunately no improvement
for each program a separate script and accordingly a separate installation step
tested other programs
changed the script
unfortunately there is nothing in the chocolatey log that can help me.
If I start the script manually, but everything works fine.
I currently do not know what to do and hope someone can help me, if there is any information missing, please let me know.
Thank you!

Related

tesseract silent installation through powershell

I am trying to install Tesseract-OCR application on a windows server through powershell but I cannot find any switches for silent install. Anyone done this before or know how to do this?
Add /S argument to silently install it.
Command will be like this:
tesseract.exe /S

Powershell cannot be loaded because running scripts is disabled on this system

My question related to yarn. Before when I start create projects I installed with npm.
After a long time when I want to start running with yarn it shows the following error:
yarn : File C:\Users\pc\AppData\Roaming\npm\yarn.ps1 cannot be loaded because running scripts is disabled on this system.
(in Windows machine, Powershell)
Windows: 10
I tried with git bash terminal it worked!
but not in my powershell terminal
I have just fixed it by myself, anyway I am going to post answer here:
//open windows command Power shell as administrator and run command
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
Set-ExecutionPolicy Unrestricted

How to bypass the Elevated prompt error during silent installation

I am trying to download and silently install Anaconda on user's computer by using a batch file. The command that is used in my batch files is according to the original documentation of Anaconda. However, every time I run this batch of code, it gives me an error that says:
Installation for all users requires an elevated prompt.
This however only happens when I set the installation type to AllUsers. If I set the installation type to JustMe, it will be able to download and install Anaconda.
curl "https://repo.continuum.io/archive/Anaconda2-4.3.0.1-Windows-x86.exe" -o "prerequisites\\Anaconda2-4.3.0.1-Windows-x86.exe"
%cd%\prerequisites\Anaconda2-4.3.0.1-Windows-x86.exe /InstallationType=AllUsers /RegisterPython=1 /S /D=C:\Anaconda
Unfortunately, I need to find a way to set the installation type to AllUsers. I had also tried running the batch file using administrator mode but to no avail. Can anyone tell me what I am missing out? I've been on this for days and still could not find the correct solution to this.

Composer setup - "The system cannot find the file specified"

I'm trying to install composer, but it showing an error message. I'm using Windows 8.1, and download composer Windows Installer from https://getcomposer.org/download/.
The command interpreter did not run correctly:
C:\Windows\system32\cmd.exe
The system cannot find the file specified
The cmd file is existing on C:\Windows\System32\cmd.exe. And it run normally
I strongly suggest posting questions regarding the windows installer # https://github.com/composer/windows-setup/issues
The maintainer of our windows installer binary can answer most questions and is very friendly and helpful :-)
1- Open cmd.exe ( administrator mode ).
2- Write this command sfc /scannow (My be take long time for scanning).
2- Re-install composer.

Chocolatey setup on USB drive

I'm trying to set up Chocolatey for the first time. My ultimate goal is to be able to install the packages on a USB drive which shows up in my computer as F: so following the directions in the Chocolatey wiki, I created a folder on the F drive called Chocolatey and set an environmental variable ChocolateyInstall to F:/Chocolatey. I followed the basic directions, by opening up a command prompt and then pasting in the following.
#powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
After installation I went to the PowerShell command prompt as follows and tried to install Notepad++ I got the following:
C:\Windows\system32>cinst notepadplusplus
The filename, directory name, or volume label syntax is incorrect.
How can I fix this problem?
It appears that you went to a custom location with Chocolatey's install. When it finished the install, did it say it was installed on F:/chocolatey? Is it actually installed there? If so, take a look at your path environment variable and see if that is included in the path. Also close and reopen the shell/command line. Does it work now? If the path (user PATH) has the choco location in it and the shell/command line is not proper after reloading, then reboot and see if that fixes the issue.
If all of that is good, type just chocolatey /? and see what you get. Then try cinst again. If it has issues again, try cinst pkgname -debug and see where the error happens.
NOTE: Trying to install Chocolatey to a USB drive is not a supported case. Sure you might be able to get it to work but I'm not sure what you really gain. Say you install Notepad++, now it is installed to the system (not the USB drive). What do you gain by having the choco repository on the USB drive?

Resources