TortoiseSVN
TortoiseSVN是 Subversion 版本控制系统的一个免费开源客户端,可以超越时间的管理文件和目录。文件保存在中央版本库,除了能记住文件和目录的每次修改以外,版本库非常像普通的文件服务器。你可以将文件恢复到过去的版本,并且可以通过检查历史知道数据做了哪些修改,谁做的修改。这就是为什么许多人将 Subversion 和版本控制系统看作一种“时间机器”。
download TortoiseSVN
TortoiseSVN | Language packs | 文档 |
download | download | 参考 |
前提条件
- 开启wmi,配置网卡,参考
创建一键部署 TortoiseSVN
- 最终实现在线下载TortoiseSVN ,安装,环境变量,中文语言包安装,删除安装包
- 依赖VisualC++ ,所有包含历史版下载
- TortoiseSVN 安装位置包含语言包位置C:\Program Files\TortoiseSVN
- Start-Process # 安装,等待安装完成在执行下一个
- Rename-Item #重命名文件夹参考
- 更改脚本段信息$webhook = #企业微信机器人地址,用法参考
- Remove-Item #删除单一文件,删除批量文件参考
powershell-install-TortoiseSVN.ps1
<# Powershell Install TortoiseSVN
+++++++++++++++++++++++++++++++++++++++++++++++++++++
+ _____ _____ _ _ _ +
+ | __ \ / ____| | | | |+
+ | |__) |____ _____ _ _| (___ | |__ ___| | |+
+ | ___/ _ \ \ /\ / / _ \ '__\___ \| '_ \ / _ \ | |+
+ | | | (_) \ V V / __/ | ____) | | | | __/ | |+
+ |_| \___/ \_/\_/ \___|_| |_____/|_| |_|\___|_|_|+
+ +++++++++++++++++++++++++++++++++++++++++++++++++++
# Powershell Install TortoiseSVN
# .\powershell-install-TortoiseSVN.ps1
#>
$drive="c:\"
$packageName = "TortoiseSVN"
$TortoiseSVN_url = "https://free.nchc.org.tw/osdn//storage/g/t/to/tortoisesvn/1.14.5/Application/"
$TortoiseSVN_msi = "TortoiseSVN-1.14.5.29465-x64-svn-1.14.2.msi"
$installPath = "C:\Program Files\TortoiseSVN"
$LanguagePack_zh_url="https://free.nchc.org.tw/osdn//storage/g/t/to/tortoisesvn/1.14.5/Language%20Packs/"
$LanguagePack_zh_msi="LanguagePack_1.14.5.29465-x64-zh_CN.msi"
Write-Host "download vc_redist.x64.exe" -ForegroundColor Green
Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vc_redist.x64.exe -UseBasicParsing -OutFile "c:\vc_redist.x64.exe"
Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vc_redist.x86.exe -UseBasicParsing -OutFile "c:\vc_redist.x86.exe"
Write-Host "install vc_redist" -ForegroundColor Green
Start-Process -FilePath "c:\vc_redist.x64.exe" -ArgumentList {/q /install} -Wait
Start-Process -FilePath "c:\vc_redist.x86.exe" -ArgumentList {/q /install} -Wait
Write-Host "download TortoiseSVN LanguagePack" -ForegroundColor Green
Invoke-WebRequest -Uri $LanguagePack_zh_url\$LanguagePack_zh_msi -UseBasicParsing -OutFile $drive\$LanguagePack_zh_msi
Write-Host "download TortoiseSVN" -ForegroundColor Green
Invoke-WebRequest -Uri $TortoiseSVN_url\$TortoiseSVN_msi -UseBasicParsing -OutFile $drive\$TortoiseSVN_msi
Write-Host "install TortoiseSVN" -ForegroundColor Green
Start-Process -FilePath msiexec.exe -ArgumentList "/i `"$drive$TortoiseSVN_msi`" /quiet /norestart INSTALLDIR=`"$installPath`"" -Wait
Write-Host "install TortoiseSVN LanguagePack zh" -ForegroundColor Green
Start-Process -FilePath msiexec.exe -ArgumentList "/i `"$drive$LanguagePack_zh_msi`" /qn" -Wait
Write-Host "TortoiseSVN system path" -ForegroundColor Green
$env:path += ";C:\Program Files\TortoiseSVN"
setx PATH $env:path /M
Write-Host "delete TortoiseSVN package" -ForegroundColor Green
Remove-Item $drive$TortoiseSVN_msi -Recurse -Force -Verbose
Remove-Item $drive$LanguagePack_zh_msi -Recurse -Force -Verbose
Remove-Item $drive\*.exe -Recurse -Force -Verbose
#Enterprise wechat robot address
$webhook = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=XXXX"
#Obtain the Windows host system version
$Win_version = Get-WmiObject -Class Win32_OperatingSystem | Select-Object -ExpandProperty Caption
$Win_version_Names = echo $Win_version
#mysql version
$TortoiseSVN = (Get-Item "C:\Program Files\TortoiseSVN\bin\TortoiseBlame.exe").VersionInfo.FileVersion
$content = Write-Output ""Win_version: $Win_version_Names" `n "TortoiseSVN: $TortoiseSVN""
$body = "{
`"msgtype`":`"text`",
`"text`":{
`"content`":`"$content`",
`"mentioned_list`":[`"jason`"]
}
}"
#The variable value obtained is transferred to the enterprise wechat robot
Invoke-RestMethod $webhook -ContentType "application/json;charset=utf-8" -Method Post -Body $body
执行安装
.\powershell-install-TortoiseSVN.ps1
输出结果展示
企业微信通知
鼠标右击打开TortoiseSVN
语言切换,自动化安装了语言插件才可以配置哦