Home > Net >  Why do I get privileges errors even though I run windows Powershell as administrator?
Why do I get privileges errors even though I run windows Powershell as administrator?

Time:02-02

I want to install miktex.install package in my machine by chocolatey. I executed this command

choco install miktex.install --admin

but error occured like below.

ERROR: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: initexmf: security risk: running with elevated privileges

Surely, I've run Powershell as administrator and try install command again and again. but privileges error keep going on. If anyone knows a solution to this error, please help. Thanks.

CodePudding user response:

This works fine here, running the commands under the local Administrator account (note that --admin is not a Chocolatey option so I have not added it):

PS C:\Users\WDAGUtilityAccount> choco install miktex.install
Chocolatey v1.2.1
Installing the following packages:
miktex.install
By installing, you accept licenses for the packages.
Progress: Downloading miktex.install 22.10... 100%

miktex.install v22.10 [Approved]
miktex.install package files install completed. Performing other installation steps.
Extracting 64-bit C:\ProgramData\chocolatey\lib\miktex.install\tools\miktexsetup-5.2.0 b8f430f-x64.zip to C:\ProgramData\chocolatey\lib\miktex.install\tools...
Downloading a "Basic" package set to install.
WARNING: No registry key found based on  'miktex*'
Creating a temporary repository at 'C:\Users\WDAGUtilityAccount\AppData\Local\Temp\chocolatey\MiKTeX-repository'.
Installing from temporary MiKTeX repository for all users.
  miktex.install may be able to be automatically uninstalled.
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
 The install of miktex.install was successful.
  Software installed to 'C:\Program Files\MiKTeX'

Chocolatey installed 1/1 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

This error is a package error. The installer seesm to be failing when running from the chocolateyInstall.ps1 script, and the script is reporting back the failure.

ERROR: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: initexmf: security risk: running with elevated privileges

If you are trying to install the latest version, and you are running in an elevated session, my advice would be to contact the package maintainer by clicking 'Contact Package Maintainer' on the Chocolatey package page.

  • Related