Автоматическая установка «КриптоПро ЭЦП Browser plug-in»
13 Sep 2018
local_offer
Windows
Распаковать архив cadesplugin.exe с помощью 7-zip, например в C:\Temp.
Устанавливаем:
msiexec /i "C:\Temp\cadesplugin\cadescom\cadescom-x64.msi" /qn /L*v "C:\Temp\cadesplugin\cades.log"
Скрипт для автоматической установки:
<#
.SYNOPSIS
Скрипт автоматической установки «КриптоПро ЭЦП Browser plug-in»
.LINK
https://webnote.satin-pl.ru/2018/09/13/cryptopro_plugin/
.NOTES
Version: 0.1
Author: Pavel Satin
Email: plsatin@yandex.ru
Creation Date: 13.09.2018
Purpose/Change: Первый вариант
#>
param (
[Parameter(Mandatory = $False)]
[string]$tempDir = "c:\Temp"
)
# $ErrorActionPreference = "SilentlyContinue"
$url7zipExe = 'https://webnote.satin-pl.ru/public/soft/cryptopro/7za.exe'
$urlCadespluginExe = 'https://webnote.satin-pl.ru/public/soft/cryptopro/cadesplugin.exe'
# $tempDir = "c:\Temp"
$cadespluginExe = "$tempDir\cadesplugin.exe"
$7zaExe = "$tempDir\7za.exe"
function Download-File {
param (
[string]$url,
[string]$file
)
Write-Verbose "Downloading $url to $file"
$downloader = new-object System.Net.WebClient
# $downloader.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials;
$downloader.DownloadFile($url, $file)
}
Write-Verbose "Скачиваем «КриптоПро ЭЦП Browser plug-in»"
Download-File $urlCadespluginExe "$cadespluginExe"
Write-Verbose "Скачиваем консольный 7-zip"
Download-File $url7zipExe "$7zaExe"
Write-Verbose "Распаковываем плагин"
Start-Process "$7zaExe" -ArgumentList "x -o`"$tempDir`" -y `"$cadespluginExe`"" -Wait -NoNewWindow
$cadespluginMSI = Get-Item "$tempDir\cadescom\cadescom-x64.msi"
$DataStamp = get-date -Format yyyyMMddTHHmmss
$logFile = '{0}-{1}.log' -f $cadespluginMSI.name,$DataStamp
Write-Verbose "Запускаем установку плагина"
Start-Process msiexec -ArgumentList "/i $cadespluginMSI /qn /norestart /L*v $tempDir\cadescom\$logFile" -Wait -NoNewWindow