I'm trying to install VirtualBox from an electron app to the host machine.
Currently I do the following:
(virtualbox installer is packaged in the electron app)
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
`)
The above code is working 70%. In some cases I got an error message ie.:
'C:\Users\Username\AppData\Local\Temp\pkg.exe' is not recognized as an internal or external command,
operable program or batch file.
I'm not sure this is the best way to install VB.