cderv / r-bucket

Personal scoop bucket I use as an R user and software engineer
49 stars 3 forks source link

tinytex doesn't work #10

Open ghost opened 3 years ago

ghost commented 3 years ago
PS C:\Users\phg> scoop install tinytex
WARN  Scoop uses 'aria2c' for multi-connection downloads.
WARN  Should it cause issues, run 'scoop config aria2-enabled false' to disable it.
Installing 'tinytex' (2021.03) [64bit]
Loading TinyTeX-1-v2021.03.zip from cache.
Checking hash of TinyTeX-1-v2021.03.zip ... ok.
Extracting TinyTeX-1-v2021.03.zip ... done.
Running pre-install script...
Linking ~\scoop\apps\tinytex\current => ~\scoop\apps\tinytex\2021.03
Running post-install script...
--> Running tlmgr path add
--> Updating tlmgr itself
tlmgr.pl: package repository http://ctan.mirrors.hoobly.com/systems/texlive/tlnet (not verified: gpg unavailable)
tlmgr.pl: no self-updates for tlmgr available
'tinytex' (2021.03) was installed successfully!
Notes
-----
For full documentation, see https://yihui.org/tinytex/
PS C:\Users\phg> tlmgr
tlmgr : The term 'tlmgr' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:1
+ tlmgr
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (tlmgr:String) [], CommandNotFou
   ndException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\phg> scoop which tlmgr
'tlmgr' not found
PS C:\Users\phg>
cderv commented 3 years ago

Unfortunately this happens because it is the first installation and it will modify the PATH variable. In a terminal window for powershell, environment variable can be updated on the system but it will not be seen in the terminal unless you restart or manually refresh.

This is a known limitation in scoop: https://github.com/lukesampson/scoop/issues/2980 and even in new Windows Terminal https://github.com/microsoft/terminal/issues/1125

So the installation is ok on your system, you just can't use it in the same Terminal process that you make the first install in.

You can do a manual refresh with this I think

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

I am not so sure about it so I did not add it in the post installation step but maybe I could. I was waiting for https://github.com/lukesampson/scoop/issues/2980 because it would be better to have that in scoop directly.

Can you confirm that after a restart you get tlmgr found ?

ghost commented 3 years ago

Yes, after a restart it works. Maybe it would be useful to display a message telling the user to restart?