[英]TASK Names for Visual Studio Code for Windows System Installer script in Powershell
Looking for some help on writing a PowerShell script to install Visual Studio Code.寻找有关编写 PowerShell 脚本以安装 Visual Studio Code 的帮助。 I have downloaded the Windows 64 System installer: VSCodeSetup-x64-1.56.2
我已经下载了 Windows 64 位系统安装程序:VSCodeSetup-x64-1.56.2
My script so far:到目前为止我的脚本:
$fullPath = <<Installer location>>
$vscApp = "VSCodeSetup-x64-1.56.2"
$appPath = join-path $fullPath $vscApp
Write-Host "App Path" $appPath
$arguments = '/SILENT /ALLUSERS /mergetasks="!runcode,????, ????, ???? ,????"'
Start-Process $appPath $arguments -Verb RunAs -Wait
I need the list of internal names for all of the check box items on the "Select Additional Tasks" Select Additional Tasks GUI Screenshot我需要“选择附加任务” Select 附加任务 GUI 屏幕截图上所有复选框项目的内部名称列表
I want to turn on all four other tasks, both Add Open, Register code, and Add to Path.我想打开所有其他四个任务,包括添加打开、注册代码和添加到路径。 Only 1 of which seems to be default.
其中只有 1 个似乎是默认的。 While I do not need the desktop icon, from the Inno Setup docs, https://jrsoftware.org/ishelp/index.php?topic=setupcmdline , I can see the desktop Icon name is
desktopicon
.虽然我不需要桌面图标,但从 Inno Setup 文档https://jrsoftware.org/ishelp/index.php?topic=setupcmdline中,我可以看到桌面图标名称是
desktopicon
。 How and where would I find this list?我如何以及在哪里可以找到这份清单?
Thanks for any and all help!感谢您的任何帮助!
Continuing from my comment.继续我的评论。 There are several pre-built scripts, in several GitHub Repos for silent installs:
有几个预构建的脚本,在几个 GitHub 存储库中用于静默安装:
#Install-VSCode
# Download URL, you may need to update this if it changes
$downloadUrl = "https://go.microsoft.com/fwlink/?LinkID=623230"
# What to name the file and where to put it
$installerFile = "vscode-install.exe"
$installerPath = (Join-Path $env:TEMP $installerFile)
# Install Options
# Reference:
# http://stackoverflow.com/questions/42582230/how-to-install-visual-studio-code-silently-without-auto-open-when-installation
# http://www.jrsoftware.org/ishelp/
# I'm using /silent, use /verysilent for no UI
# Install with the context menu, file association, and add to path options (and don't run code after install:
$installerArguments = "/silent /mergetasks='!runcode,addcontextmenufiles,addcontextmenufolders,associatewithfiles,addtopath'"
#Install with default options, and don't run code after install.
#$installerArguments = "/silent /mergetasks='!runcode'"
Write-Verbose "Downloading $installerFile..."
Invoke-Webrequest $downloadUrl -UseBasicParsing -OutFile $installerPath
Write-Verbose "Installing $installerPath..."
Start-Process $installerPath -ArgumentList $installerArguments -Wait
Write-Verbose "Cleanup the downloaded file."
Remove-Item $installerPath -Force
You can also automate installing VSCode extensions.您还可以自动安装 VSCode 扩展。
Visual Studio Code: Getting Started with PowerShell https://social.technet.microsoft.com/wiki/contents/articles/35780.visual-studio-code-getting-started-with-powershell.aspx
Visual Studio 代码:PowerShell https://social.technet.microsoft.com/wiki/contents/articles/35780.visual-studio-code-getting-started-with-powershell.aspx 入门
code --install-extension ms-vscode.powershell
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.