Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TinyTex installation doesn't succeed: "This program is blocked by a group policy. For more information, contact your system administrator."" #443

Open
3 tasks
skyburz opened this issue May 15, 2024 · 2 comments
Labels

Comments

@skyburz
Copy link

skyburz commented May 15, 2024

I am trying to install the TinyTeX distribution (TinyTeX-1) for a client with restricted admin rights in a Windows environment. When trying to install TinyTeX (tinytex::install_tinytex), I always get this message: "This program was blocked by a group policy. For more information, contact your system administrator". The download from https://yihui.org/tinytex/TinyTeX-1 works fine. I have also tried to install TinyTex on a local folder, where I know I have admin rights, and that has not worked. I get the same error message. So my question is:

  • Is this error message because tlmgr wants to download from a CTAN mirror that is blocked by the firewall,
  • or is it that the installation wants to execute an application that is blocked?

I have tried to add all the necessary paths correctly before the installation.
Sys.setenv((PATH = paste("C:/Users/[user]/AppData/Roaming/TinyTeX/bin", Sys.getenv("PATH"), sep = ";"))
options(tinytex.tlmgr.path = "C:/Users/[user]/AppData/Roaming/TinyTeX/bin/windows/tlmgr.bat")

Unfortunately, I can't give more specifics about the PC, because I currently don't have access to it. I am trying to solve the issue remotely.

I have been trying to resolve this issue for weeks now. I have check all the resolved issues available. Thanks a lot for your help!


By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.org/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('tinytex'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('rstudio/tinytex').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@cderv
Copy link
Contributor

cderv commented May 15, 2024

I always get this message: "This program was blocked by a group policy. For more information, contact your system administrator"

What is the complete log message you get ? This would know which step is failling.

"blocked by a group policy" means that your environment does not allow to run some programs, or execute some scripts. So our auto installation may not work and you need to install differently.

Though possibly those policy restriction will prevent to run TeX Live maybe - so they should solve that.

Prebuilt bundle are download from there: https://github.com/rstudio/tinytex-releases/#releases
and in case of Windows, this is a zip file to TinyTeX-1 so we unzip

tinytex/R/install.R

Lines 499 to 500 in 27672c8

extract = if (grepl('[.]zip$', pkg)) unzip else untar
extract(pkg, exdir = path.expand(target))

this calls unzip R function

and then it call a post install step

post_install_config(add_path, extra_packages, repo, hash)

tinytex/R/install.R

Lines 513 to 532 in 27672c8

post_install_config = function(add_path = TRUE, extra_packages = NULL, repo = 'ctan', hash = FALSE) {
if (os_index == 2) {
if (!dir_exists(bin_dir <- '~/.local/bin')) dir.create(bin_dir <- '~/bin', FALSE, TRUE)
tlmgr(c('option', 'sys_bin', bin_dir))
}
# fix fonts.conf: https://github.com/rstudio/tinytex/issues/313
tlmgr(c('postaction', 'install', 'script', 'xetex'), .quiet = TRUE)
# do not wrap lines in latex log (#322)
tlmgr_conf(c('texmf', 'max_print_line', '10000'), .quiet = TRUE, stdout = FALSE)
if (add_path) tlmgr_path()
r_texmf(.quiet = TRUE)
# don't use the default random ctan mirror when installing on CI servers
if (repo != 'ctan' || tolower(Sys.getenv('CI')) != 'true')
tlmgr_repo(repo, stdout = FALSE, .quiet = TRUE)
tlmgr_install(setdiff(extra_packages, tl_pkgs()))
if (hash) {
texhash(); fmtutil(stdout = FALSE); updmap(); fc_cache()
}
}

which calls tlmgr.bat (though R with tinytex::tlmgr())

If your windows environment does not allow to execute BAT file (which is possible in some restricted environment), then unfortunately TinyTeX cannot be used. Nor TeX Live which relies on tlmgr.bat script to run on Windows.

You need to use another distribution (MikTeX maybe ?) or ask the IT admins to overcome this restriction for your use case.

@cderv cderv added the question label May 15, 2024
@skyburz
Copy link
Author

skyburz commented May 15, 2024

Thanks a lot! That is very helpful. I suspect that it could be the BAT-files that are blocked, because I receive this message "blocked by group policy" several times in the installing process.

Attached I send you two print screens that my client sent me. They are in German, but I think you get the content.

Case 1: Error that I got when installing TinyTex-1 in a specific directory. The message of the group policy appears several times.

Case1

Case 2: In this case the TinyTex seems to have been installed, but then when I call tinytex::tlmgr_version(), I get the same error message.

Case2

Do you think it is more likely that the BAT-File is creating these errors, rather than tlmgr trying to access CTAN mirrors?

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants