Nonportable icon indicating copy to clipboard operation
Nonportable copied to clipboard

[email protected] fails to install/update

Open trentonyo opened this issue 1 year ago • 2 comments

Bug Report

Package Name: virtualbox-np

Current Behaviour

VirtualBox cannot be installed or updated due to an unexpected missing executable during installation. Example below reflects an attempt to install after attempting to uninstall, failing to do so, and manually removing the apps/ directory and the associated shims/

  • ✅ downloading the package
  • 🟨 the installer script runs (though it does fail slightly, trying to delete a desktop shortcut that doesn't exist)
  • ✅ several shims are created
  • â›” the 'VBoxTestOGL' shim fails to create as there is no such executable

Expected Behaviour

Expect VirtualBox to install/update

Additional context/output

image

Possible Solution

Per the changelog for VirtualBox 7.1, this is a major update. I imagine it is possible the executables shipped have changed and so the install scripts may need updating, the version change was handled automatically per commit c27deec73c9f3b87337161b5ca92e6de567fea05 and perhaps was not able to capture a change in expected files.

System details

Windows version: 10

OS architecture: 64bit

PowerShell version: 5.1.19041.4894

Additional software: none (that I expect to be relevant)

Scoop Configuration

    "last_update":  "2024-09-11T17:16:35.1449083-07:00",
    "scoop_branch":  "master",
    "scoop_repo":  "https://github.com/ScoopInstaller/Scoop"

trentonyo avatar Sep 12 '24 00:09 trentonyo

Additional information:

I've installed VirtualBox via the 7.1.0 installer to see what an active installation looks like, top-level directory below

    Directory: C:\Program Files\Oracle\VirtualBox


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         9/11/2024   9:15 PM                doc
d-----         9/11/2024   9:15 PM                drivers
d-----         9/11/2024   9:15 PM                dtrace
d-----         9/11/2024   9:15 PM                nls
d-----         9/11/2024   9:15 PM                platforms
d-----         9/11/2024   9:15 PM                sdk
d-----         9/11/2024   9:15 PM                sqldrivers
d-----         9/11/2024   9:15 PM                styles
d-----         9/11/2024   9:15 PM                UnattendedTemplates
d-----         9/11/2024   9:15 PM                x86
-a----          9/6/2024   4:46 PM         408256 DbgPlugInDiggers.dll
-a----         7/20/2023  12:16 PM          89845 License_en_US.rtf
-a----          9/6/2024   4:45 PM        5824760 Qt6CoreVBox.dll
-a----          9/6/2024   4:45 PM        7812272 Qt6GuiVBox.dll
-a----          9/6/2024   4:45 PM         566264 Qt6HelpVBox.dll
-a----          9/6/2024   4:45 PM         395280 Qt6PrintSupportVBox.dll
-a----          9/6/2024   4:45 PM         280168 Qt6SqlVBox.dll
-a----          9/6/2024   4:45 PM         324520 Qt6StateMachineVBox.dll
-a----          9/6/2024   4:45 PM        6077328 Qt6WidgetsVBox.dll
-a----          9/6/2024   4:48 PM       28808496 UICommon.dll
-a----          9/6/2024   4:48 PM        1900544 UserManual.qch
-a----          9/6/2024   4:48 PM         299008 UserManual.qhc
-a----          9/6/2024   4:47 PM         405664 vbox-img.exe
-a----          9/6/2024   4:47 PM         353520 VBoxAudioTest.exe
-a----          9/6/2024   4:45 PM          21896 VBoxAuth.dll
-a----          9/6/2024   4:46 PM          28624 VBoxAuthSimple.dll
-a----          9/6/2024   4:47 PM          91592 VBoxAutostartSvc.exe
-a----          9/6/2024   4:48 PM         130320 VBoxBalloonCtrl.exe
-a----          9/6/2024   4:47 PM          80256 VBoxBugReport.exe
-a----          9/6/2024   4:47 PM        4178656 VBoxC.dll
-a----          9/6/2024   4:46 PM          35352 VBoxCAPI.dll
-a----          9/6/2024   4:46 PM         203672 VBoxDbg.dll
-a----          9/6/2024   4:48 PM        3841400 VBoxDD.dll
-a----          9/6/2024   4:48 PM        8839600 VBoxDD2.dll
-a----          9/6/2024   9:54 AM         289640 VBoxDDR0.r0
-a----          9/6/2024   4:46 PM         464496 VBoxDDU.dll
-a----          9/6/2024   4:46 PM          46688 VBoxDragAndDropSvc.dll
-a----          9/6/2024   4:48 PM          24528 VBoxDTrace.exe
-a----          9/6/2024   4:47 PM          62704 VBoxExtPackHelperApp.exe
-a----          9/6/2024   6:34 PM       58832896 VBoxGuestAdditions.iso
-a----          9/6/2024   4:46 PM          44096 VBoxGuestControlSvc.dll
-a----          9/6/2024   4:46 PM          45664 VBoxGuestPropSvc.dll
-a----          9/6/2024   4:46 PM         287880 VBoxHeadless.dll
-a----          9/6/2024   4:46 PM         964472 VBoxHeadless.exe
-a----          9/6/2024   4:46 PM          29688 VBoxHostChannel.dll
-a----          9/6/2024   4:46 PM         498064 VBoxLibSsh.dll
-a----          9/6/2024   4:48 PM        2556352 VBoxManage.exe
-a----          9/6/2024   4:46 PM         381344 VBoxNetDHCP.dll
-a----          9/6/2024   4:46 PM         964472 VBoxNetDHCP.exe
-a----          9/6/2024   4:46 PM         414912 VBoxNetNAT.dll
-a----          9/6/2024   4:46 PM         964472 VBoxNetNAT.exe
-a----          9/6/2024   4:46 PM         940224 VBoxProxyStub.dll
-a----          9/6/2024   4:45 PM         846688 VBoxRes.dll
-a----          9/6/2024   4:46 PM        7191432 VBoxRT.dll
-a----          9/6/2024   4:47 PM         763024 VBoxSDS.exe
-a----          9/6/2024   4:46 PM         130864 VBoxSharedClipboard.dll
-a----          9/6/2024   4:46 PM          72504 VBoxSharedFolders.dll
-a----          9/6/2024   4:45 PM          14656 VBoxSupLib.dll
-a----          9/6/2024   4:48 PM        5544848 VBoxSVC.exe
-a----          9/6/2024   4:47 PM        5773096 VBoxVMM.dll
-a----          9/6/2024   4:48 PM       23311400 VBoxWebSrv.exe
-a----          9/6/2024   4:48 PM        2872432 VirtualBox.exe
-a----         7/20/2023  12:28 PM            325 VirtualBox.VisualElementsManifest.xml
-a----          9/6/2024   4:48 PM        1401440 VirtualBoxVM.dll
-a----          9/6/2024   4:46 PM         965568 VirtualBoxVM.exe
-a----         7/18/2024   5:54 PM           1459 VirtualBox_150px.png
-a----         7/18/2024   5:54 PM            903 VirtualBox_70px.png
-a----          9/6/2024   9:54 AM        2608688 VMMR0.r0

trentonyo avatar Sep 12 '24 04:09 trentonyo

If any one still cares here are the changes required to fix this issue which seem to be working for me:

@@ -17,20 +17,22 @@
             "Start-Process msiexec -ArgumentList @('/i', \"`\"$dir\\setup.msi`\"\", '/qn', '/norestart', \"INSTALLDIR=`\"$dir`\"\") -Wait -Verb RunAs | Out-Null",
             "Start-Process icacls -ArgumentList @(\"`\"$dir`\"\", '/grant', 'Everyone:F', '/T') -Wait -Verb RunAs | Out-Null",
             "Remove-Item \"$dir\\setup.exe\", \"$dir\\setup.msi\"",
-            "Remove-Item \"$env:PUBLIC\\Desktop\\Oracle VM VirtualBox.lnk\"",
-            "Remove-Item -Recurse \"$([Environment]::GetFolderPath('commonstartmenu'))\\Programs\\Oracle VM VirtualBox\""
+            "Remove-Item -Recurse \"$([Environment]::GetFolderPath('commonstartmenu'))\\Programs\\Oracle VirtualBox\""
         ]
     },
     "uninstaller": {
         "script": [
             "if (!(is_admin)) { error \"$app requires admin rights to $cmd\"; break }",
-            "$id_array = wmic product where \"name like 'Oracle VM VirtualBox%'\" get IdentifyingNumber",
-            "if (!($id_array[2] -match '({[0-9A-F-]+})')) { error 'Could not find product ID'; break }",
-            "$id = $matches[1]",
-            "Invoke-ExternalCommand msiexec -ArgumentList @('/x', \"$id\", '/qn', '/norestart') -RunAs | Out-Null"
+            "$id_array = Get-WmiObject -Query \"SELECT IdentifyingNumber FROM Win32_Product WHERE Name LIKE 'Oracle VirtualBox%'\"",
+            "if (-not $id_array) { Write-Error 'Could not find product ID'; break }",
+            "$id = $id_array.IdentifyingNumber",
+            "if (-not ($id -match '({[0-9A-F-]+})')) { Write-Error 'Could not find valid product ID'; break }",
+            "Start-Process msiexec.exe -ArgumentList \"/x\", \"$id\", \"/quiet\", \"/norestart\" -Wait -NoNewWindow"
         ]
     },
     "bin": [
+        "VBoxAudioTest.exe",
+        "VBoxAutostartSvc.exe",
         "VBoxBalloonCtrl.exe",
         "VBoxBugReport.exe",
         "VBoxDTrace.exe",
@@ -42,7 +44,6 @@
         "VBoxNetNAT.exe",
         "VBoxSDS.exe",
         "VBoxSVC.exe",
-        "VBoxTestOGL.exe",
         "VBoxWebSrv.exe",
         "VirtualBox.exe",
         "VirtualBoxVM.exe"

tree-s avatar Dec 26 '24 21:12 tree-s

I confirm that the fix by @tree-s works with VirtualBox 7.1.8. I wonder why the original bucket has not been fixed yet.

dertuxmalwieder avatar May 20 '25 12:05 dertuxmalwieder

Need to be fixed.

jdjxk avatar Jun 13 '25 09:06 jdjxk

I confirm, @tree-s fix works wth 7.1.12 Thanks!

Ruslan0Dev avatar Jul 17 '25 01:07 Ruslan0Dev

If any one still cares here are the changes required to fix this issue which seem to be working for me:

@@ -17,20 +17,22 @@
             "Start-Process msiexec -ArgumentList @('/i', \"`\"$dir\\setup.msi`\"\", '/qn', '/norestart', \"INSTALLDIR=`\"$dir`\"\") -Wait -Verb RunAs | Out-Null",
             "Start-Process icacls -ArgumentList @(\"`\"$dir`\"\", '/grant', 'Everyone:F', '/T') -Wait -Verb RunAs | Out-Null",
             "Remove-Item \"$dir\\setup.exe\", \"$dir\\setup.msi\"",
-            "Remove-Item \"$env:PUBLIC\\Desktop\\Oracle VM VirtualBox.lnk\"",
-            "Remove-Item -Recurse \"$([Environment]::GetFolderPath('commonstartmenu'))\\Programs\\Oracle VM VirtualBox\""
+            "Remove-Item -Recurse \"$([Environment]::GetFolderPath('commonstartmenu'))\\Programs\\Oracle VirtualBox\""
         ]
     },
     "uninstaller": {
         "script": [
             "if (!(is_admin)) { error \"$app requires admin rights to $cmd\"; break }",
-            "$id_array = wmic product where \"name like 'Oracle VM VirtualBox%'\" get IdentifyingNumber",
-            "if (!($id_array[2] -match '({[0-9A-F-]+})')) { error 'Could not find product ID'; break }",
-            "$id = $matches[1]",
-            "Invoke-ExternalCommand msiexec -ArgumentList @('/x', \"$id\", '/qn', '/norestart') -RunAs | Out-Null"
+            "$id_array = Get-WmiObject -Query \"SELECT IdentifyingNumber FROM Win32_Product WHERE Name LIKE 'Oracle VirtualBox%'\"",
+            "if (-not $id_array) { Write-Error 'Could not find product ID'; break }",
+            "$id = $id_array.IdentifyingNumber",
+            "if (-not ($id -match '({[0-9A-F-]+})')) { Write-Error 'Could not find valid product ID'; break }",
+            "Start-Process msiexec.exe -ArgumentList \"/x\", \"$id\", \"/quiet\", \"/norestart\" -Wait -NoNewWindow"
         ]
     },
     "bin": [
+        "VBoxAudioTest.exe",
+        "VBoxAutostartSvc.exe",
         "VBoxBalloonCtrl.exe",
         "VBoxBugReport.exe",
         "VBoxDTrace.exe",
@@ -42,7 +44,6 @@
         "VBoxNetNAT.exe",
         "VBoxSDS.exe",
         "VBoxSVC.exe",
-        "VBoxTestOGL.exe",
         "VBoxWebSrv.exe",
         "VirtualBox.exe",
         "VirtualBoxVM.exe"

/btw this will no longer work as of 7.2 but if any one still cares I maintain my own version here

tree-s avatar Aug 29 '25 23:08 tree-s

I maintain my own version here

How can I tell scoop to use that?

dertuxmalwieder avatar Aug 30 '25 00:08 dertuxmalwieder

I maintain my own version here

How can I tell scoop to use that?

Just the same way you add any other buckets and apps

scoop bucket add virtualbox https://github.com/tree-s/virtualbox
sudo scoop install virtualbox/virtualbox-np

But the instructions are also in the readme.md. I'll try to keep it update to date as I use it a lot with my work. I just get tired of these giant app buckets not being up to date so I just make my own buckets to keep the tools that I use up to date. Any way hope this helps.

tree-s avatar Aug 30 '25 13:08 tree-s