Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
R ecosystem
WindowsR
Commits
25b8df7b
Commit
25b8df7b
authored
Nov 11, 2020
by
Jean-Francois Rey
☕
Browse files
change miktex install to basic in unattented mode
parent
b2b7972d
Changes
1
Hide whitespace changes
Inline
Side-by-side
ansible_provisioning/files/install-miktex.ps1
View file @
25b8df7b
# Install miktex for latex support
Write-Output
"Installing MiKTeX"
## install from basic ##
Write-Output
"Downloading installer"
## download last relase name
$url
=
"https://miktex.org/download/win/miktexsetup-x64.zip"
$output
=
'c:\Windows\Temp\miktex.zip'
$url
=
"https://miktex.org/download/ctan/systems/win32/miktex/setup/windows-x64/basic-miktex-20.11-x64.exe"
$output
=
"C:\Windows\Temp\miktex.exe"
$wcR
=
New-Object
System.Net.WebClient
Write-Output
"Downloading
$url
"
...
...
@@ -12,18 +12,35 @@ Write-Output "Downloading $url"
$wcR
.
DownloadFile
(
$url
,
$output
)
Write-Output
"Download completed
$url
"
Write-Output
"unzip"
Expand-Archive
-LiteralPath
$output
-DestinationPath
'C:\Windows\Temp\'
-Force
C:\Windows\Temp\miktex.exe
--auto-install
=
yes
--common-install
=
C:\miktex
--shared
--unattended
## Network install with local repository ##
#Write-Output "Downloading installer"
## download last relase name
#$url = "https://miktex.org/download/win/miktexsetup-x64.zip"
#$output = 'c:\Windows\Temp\miktex.zip'
#$wcR = New-Object System.Net.WebClient
#Write-Output "Downloading $url"
##Download the zip
#$wcR.DownloadFile($url, $output)
#Write-Output "Download completed $url"
#Write-Output "unzip"
#Expand-Archive -LiteralPath $output -DestinationPath 'C:\Windows\Temp\' -Force
Write-Output
"Download repository"
C:\Windows\Temp\miktexsetup.exe
--verbose
--local-package-repository
=
C:\Windows\Temp\miktex
--package-set
=
complete
download
Write-Output
"Download repository again in case of trouble"
C:\Windows\Temp\miktexsetup.exe
--verbose
--local-package-repository
=
C:\Windows\Temp\miktex
--package-set
=
complete
download
#
Write-Output "Download repository"
#
C:\Windows\Temp\miktexsetup.exe --verbose --local-package-repository=C:\Windows\Temp\miktex --package-set=complete download
#
Write-Output "Download repository again in case of trouble"
#
C:\Windows\Temp\miktexsetup.exe --verbose --local-package-repository=C:\Windows\Temp\miktex --package-set=complete download
Write-Output
"Install "
C:\Windows\Temp\miktexsetup.exe
--quiet
--local-package-repository
=
C:\Windows\Temp\miktex
--package-set
=
basic
--shared
=
no
--common-install
=
'C:\miktex'
install
#
Write-Output "Install "
#
C:\Windows\Temp\miktexsetup.exe --quiet --local-package-repository=C:\Windows\Temp\miktex --package-set=basic --shared=no --common-install='C:\miktex' install
Write-Output
"MiKTeX installed into C:\miktex"
#Write-Output "MiKTeX installed into C:\miktex"
#Remove-Item 'C:\Windows\Temp\miktexsetup.exe' -Force
# enable auto install
#Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\MiKTeX.org\MiKTeX\2.9\MPM' -Name AutoInstall -Value 1emove-Item 'C:\windows\Temp\miktex' -Recurse
if
(
Test-Path
"HKLM:\Software\MiKTeX.org\MiKTeX"
)
{
Write-Output
"MiKTeX installed"
...
...
@@ -32,10 +49,5 @@ else {
throw
"ERROR: Can't install MiKTeX"
}
Remove-Item
'C:\windows\Temp\miktex'
-Recurse
Remove-Item
$output
-Force
Remove-Item
'C:\Windows\Temp\miktexsetup.exe'
-Force
# Add miktex to PATH <- done at install
#$oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
#$newPath = "$oldpath;C:\miktek\miktex\bin\x64"
#Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment