-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Feature request: provide .ps1
install script for Windows
#381
Comments
.ps1
install script for windows.ps1
install script for Windows
Hi, For reference, know that there are several ways to install TinyTeX on Windows:
Making a powershell script for installation would mean doing the 4th solution. If you already have done such script for powershell, please do share. Thank you ! |
Thanks, I have the following script based on https://deno.land/x/install@v0.1.6/install.ps1?code= #!/usr/bin/env pwsh
$ErrorActionPreference = 'Stop'
if (Get-Command "tlmgr" -ErrorAction SilentlyContinue) {
$InstalledPkgs = tlmgr info --list --only-installed --data name
if ($InstalledPkgs) {
$InstalledPkgs = $InstalledPkgs -replace ("`n", " ")
Write-Output "If you want to reinstall currently installed packages, use this command after the TinyTeX installation is done:"
Write-Output ""
Write-Output "tlmgr install ${InstalledPkgs}`n"
}
}
$Version = $env:TINYTEX_VERSION
$Installer = if ($env:TINYTEX_INSTALLER) {
$env:TINYTEX_INSTALLER
} else {
"TinyTeX-1"
}
$DestDir = $env:APPDATA
$TinyTeXZip = "$env:TEMP\TinyTeX.zip"
# GitHub requires TLS 1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$TinyTeXUri = if (!$Version) {
"https://github.com/rstudio/tinytex-releases/releases/download/daily/${Installer}.zip"
} else {
"https://github.com/rstudio/tinytex-releases/releases/download/v${Version}/${Installer}-v${Version}.zip"
}
curl.exe -Lo $TinyTeXZip $TinyTeXUri
Expand-Archive -Force -Path $TinyTeXZip -DestinationPath $DestDir
Remove-Item $TinyTeXZip
Write-Output "add tlmgr to PATH"
$Tlmgr = "${DestDir}\TinyTeX\bin\win32\tlmgr.bat"
Invoke-Expression "${Tlmgr} path add"
if (!$env:CI) {
Invoke-Expression "${Tlmgr} option repository ctan"
}
# GH issue #313
Invoke-Expression "${Tlmgr} postaction install script xetex" |
Awesome thank you ! |
TinyTeX currently provides the Windows installer as a batch file which requires more steps to use than its Linux/macOS counterpart. It would be nice if there was a powershell version that could be downloaded and executed in a single command, e.g
iwr -useb https://deno.land/install.ps1 | iex
.For context, I would like to add one-liner instructions for how to install TinyTeX in https://github.com/saadq/resumake.io
By filing an issue to this repo, I promise that
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')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: