ScoopInstaller / Extras

📦 The Extras bucket for Scoop.
https://scoop.sh
The Unlicense
1.78k stars 1.33k forks source link

[Request] Add virtualbox app #578

Open omar-selo opened 6 years ago

omar-selo commented 6 years ago

I was wondering how difficult would it be to add a virtualbox manifest. If it is an easy task that a beginner can do then I am read to help with this if needed.

brandon93s commented 6 years ago

It may be possible but I'm not sure you'd want to. VirtualBox needs several drivers to work correctly, add unless they're already installed I imagine elevated privileges or UAC prompts would be required. The installation wouldn't be self contained in this scenario.

There is a few portable solutions out there, but they're not without bugs and have the same driver limitations.

omar-selo commented 6 years ago

I see. I prefer to install it manually then.

r15ch13 commented 6 years ago

This was already attempted: https://github.com/lukesampson/scoop/issues/229

You might create your own bucket for it. We could add it to the extras bucket because there are already a couple of other programs which need elevated privileges. If I recall correctly.

Here is a way I tried it:

{
    "homepage": "https://www.virtualbox.org/",
    "version": "5.1.28",
    "url": "http://download.virtualbox.org/virtualbox/5.1.28/VirtualBox-5.1.28-117968-Win.exe#/VirtualBoxSetup.7z",
    "hash": "5415db62fae9332cc06bc6c445d5f1338c7d0efa0842175658b272dff1e49c03",
    "pre_install": "
        move-item \"$dir\\BIN_00\" \"$dir\\VirtualBox_x86.msi\"
        move-item \"$dir\\BIN_01\" \"$dir\\VirtualBox_amd64.msi\"
        move-item \"$dir\\BIN_02\" \"$dir\\common.cab\"
        remove-item \"$dir\\HDR_*\"
        remove-item \"$dir\\MANIFEST\"
    ",
    "extract_dir": ".rsrc\\RCDATA",
    "architecture": {
        "64bit": {
            "installer": {
                "file": "VirtualBox_amd64.msi"
            }
        },
        "32bit": {

        }
    },
    "checkver": {
        "url": "https://update.virtualbox.org/query.php?platform=WINDOWS_64BITS_GENERIC&version=0.0.0",
        "re": "VirtualBox-(?<version>[\\d.]+)-(?<revision>[\\d]+)-Win.exe"
    },
    "autoupdate": {
        "url": "http://download.virtualbox.org/virtualbox/$version/VirtualBox-$version-$matchRevision-Win.exe#/VirtualBoxSetup.7z",
        "hash": {
            "url": "https://www.virtualbox.org/download/hashes/$version/SHA256SUMS"
        }
    }
}
omar-selo commented 6 years ago

This manifest looks good. But I have two questions:

  1. Why does "https://update.virtualbox.org/query.php?platform=WINDOWS_64BITS_GENERIC&version=0.0.0" show 5.1.30 when the current version is 5.2.0
  2. How can we make scoop uninstall virtualbox actually call the uninstaller of virtualbox
r15ch13 commented 6 years ago
  1. Version 5.2.0 was released two days ago, maybe there is a delay so not everyone updates directly (more time for emergency bugfixes?)
  2. Didn't try the uninstaller yet. This was a quick hack 😄
omar-selo commented 6 years ago

I updated the installer so that it only asks for privilege escalation.

"installer": {
    "file": "VirtualBox_amd64.msi",
    "args": ["/qb", "ADDLOCAL=VBoxApplication,VBoxUSB,VBoxNetwork,VBoxNetworkFlt,VBoxNetworkAdp,VBoxPython", "VBOX_INSTALLDESKTOPSHORTCUT=1", "VBOX_INSTALLQUICKLAUNCHSHORTCUT=0", "VBOX_START=0", "VBOX_REGISTERFILEEXTENSIONS=1"],
    "keep": "true"
}

I could uninstall using msiexec /x VirtualBox_amd64.msi /qb but I am not sure how can I go about adding this command to the manifest because it starts with msiexec.

r15ch13 commented 6 years ago

Does one of these work?

"uninstaller": {
    "file": "msiexec",
    "args": ["/x", "VirtualBox_amd64.msi", "/qb"]
}
"uninstaller": {
    "script": "& msiexec /x \"$dir\\VirtualBox_amd64.msi\" /qb"
}
omar-selo commented 6 years ago

The first one tries to call $dir\\msiexec and so it fails.

The second one deletes the virtualbox app folder including VirtualBox_amd64.msi then tries to run msiexec /x VirtualBox_amd64.msi /qb but that file no longer exists.

pakonda commented 6 years ago

Check this out. virtualbox.json

rasa commented 6 years ago

@pakonda submit a PR?

pakonda commented 6 years ago

@rasa I submitted a PR on nonportable bucket. https://github.com/oltolm/scoop-nonportable/pull/3 Which bucket should I submit?

r15ch13 commented 6 years ago

Running wmic product where "name like 'Oracle VM VirtualBox%'" call uninstall from an elevated powershell/cmd requires even fewer steps 😁

silverkorn commented 5 years ago

Should we promote to add scoop-nonportable as a workaround?

scoop bucket add nonportable

Will it ever happen in here since the software installation requires UAC?