如何解决在Windows上通过电子应用程序安装VirtualBox的正确方法
我正在尝试将VirtualBox从电子应用程序安装到主机。
目前,我正在执行以下操作:
(virtualbox安装程序打包在电子应用程序中)
await util.sudoExec(`
copy ${app.getAppPath()}\\..\\resources\\installers\\VirtualBox-6.1.8-137981-Win.exe ${temp}\\pkg.exe &
${temp}\\pkg.exe /extract --silent &
msiexec /i ${temp}\\VirtualBox\\VirtualBox-6.1.8-r137981.msi /quiet /norestart ALLUSERS=2 VBOX_INSTALLDESKTOPSHORTCUT=0 VBOX_INSTALLQUICKLAUCHSHORTCUT=0
`)
上面的代码工作70%。在某些情况下,我会收到一条错误消息,即:
'C:\Users\Username\AppData\Local\Temp\pkg.exe' is not recognized as an internal or external command,operable program or batch file.
我不确定这是安装VB的最佳方法。
解决方法
您可以尝试使用Chocolatey:
这将安装它:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
此命令将安装Virtualbox:
choco install virtualbox -y
这也使您可以在需要时轻松更新软件。这是一个选择,因此您不需要为每个版本的VB维护软件包安装程序。
,有一个答案,我认为它可以帮助您
'' is not recognized as an internal or external command,operable program or batch file
查看格哈德(Gerhard)关于这个问题的答案
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。