Jump to content

Recommended Posts

Posted

Sur, i just use foozoor code's

 

Spoiler

#RequireAdmin
#include <Array.au3> ; Uniquement pour le débogage

virtualboxInstall()

Func virtualboxInstall()

    ; Traitements
    $html = BinaryToString(InetRead("https://www.virtualbox.org/wiki/Downloads"))
    $setup_result = StringRegExp($html, "(http://download.virtualbox.org/virtualbox/.*/(.*-Win.exe))", 2)
    $pack_result = StringRegExp($html, "(http://download.virtualbox.org/virtualbox/.*/(.*.vbox-extpack))", 2)

    ; Récupérer les bonnes urls
    $setup_url = $setup_result[0]
    $pack_url = $pack_result[0]

    ; Récupérer les bons noms de fichier
    ; Initialiser les destinations
    $setup = @TempDir & "\" & $setup_result[2]
    $pack  = @TempDir & "\" & $pack_result[2]

    ; Téléchargements
    InetGet($setup_url, $setup)
    InetGet($pack_url, $pack)

    ; Extraction des fichiers dans %temp%\VirtualBox_Files
    RunWait($setup & ' -extract -path "' & @TempDir & '\VirtualBox_Files" -silent')

    ; Recherche du fichier en fonction de l'architecture (par exemple)
    $arch = "x86"
    IF @OSArch = "X64" OR @OSArch = "IA64" Then $arch = "amd64"
    $search = FileFindFirstFile( @TempDir & "\VirtualBox_Files\*" & $arch & ".msi")
    If $search = -1 Then Exit MsgBox(16, "VirtualBox Installation", "Impossible de trouver le programme d'installation")

    $msiFile = FileFindNextFile($search)
    If @error Then  Exit MsgBox(16, "VirtualBox Installation", "Impossible de trouver le programme d'installation")

    ; On ajoute l'étiteur en tant qu'éditeur de confiance (pour l'installation du driver)
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SystemCertificates\TrustedPublisher\Certificates\A88FD9BDAA06BC0F3C491BA51E231BE35F8D1AD5", "Blob", "REG_BINARY", "0x030000000100000014000000A88FD9BDAA06BC0F3C491BA51E231BE35F8D1AD5040000000100000010000000BDAA0134CEF0AF91604A9014FF48B068190000000100000010000000513E24DD5BC926AF480BCD8AE4D6CD23140000000100000014000000D80230929A26F7AD478E6B607892707936D45A390F000000010000001400000097F0B1288E1EFBA68E4A88F6B09F2F0E93C3D3DB200000000100000076050000308205723082045AA0030201020210519BD967F908015521A20C0E9316F489300D06092A864886F70D01010505003081B4310B300906035504061302555331173015060355040A130E566572695369676E2C20496E632E311F301D060355040B1316566572695369676E205472757374204E6574776F726B313B3039060355040B13325465726D73206F66207573652061742068747470733A2F2F7777772E766572697369676E2E636F6D2F727061202863293130312E302C06035504031325566572695369676E20436C617373203320436F6465205369676E696E672032303130204341301E170D3131303230383030303030305A170D3134303230373233353935395A3081B5310B3009060355040613025553311330110603550408130A43616C69666F726E6961311730150603550407130E526564776F6F642053686F726573311B3019060355040A14124F7261636C6520436F72706F726174696F6E313E303C060355040B13354469676974616C20494420436C6173732033202D204D6963726F736F667420536F6674776172652056616C69646174696F6E207632311B3019060355040314124F7261636C6520436F72706F726174696F6E30820122300D06092A864886F70D01010105000382010F003082010A02820101008992EF11F1F037241CE997AE3C4A7EBAD5D603F947220D0D1352C3479EF92B61581D9CF198B1A1A48C573A9968F76BBFE23974E7C2BB24E4A01AEFF38EC2B40B0A7F0E57CF665DB87194FF76608D59D84FFC2D492A21FFD8C7CDEAD4C51903818E42C1CFF08BFB5629714C7DBA946301429F30C795B9DD31FE634427BBFF7B82BFDF7198199E838D168101B861F05F62EBCE4085A22A1CC9A010D8A985FB4CDA093BA7D702A9CFF8CB6F5FEF0A1AAD5DE7CAD7F3CA771E0FB8A91DB30D3DAC575FEE753DFA3C48C86CBF5EB5FE7C9CC6758829FE919FEF070148BEE894409EABDC9DE31F4EDC149120CBEC8F0D00419D007CF19DF4211C5622739556A93A4B930203010001A382017B3082017730090603551D1304023000300E0603551D0F0101FF04040302078030400603551D1F043930373035A033A031862F687474703A2F2F637363332D323031302D63726C2E766572697369676E2E636F6D2F435343332D323031302E63726C30440603551D20043D303B3039060B6086480186F84501071703302A302806082B06010505070201161C68747470733A2F2F7777772E766572697369676E2E636F6D2F72706130130603551D25040C300A06082B06010505070303307106082B0601050507010104653063302406082B060105050730018618687474703A2F2F6F6373702E766572697369676E2E636F6D303B06082B06010505073002862F687474703A2F2F637363332D323031302D6169612E766572697369676E2E636F6D2F435343332D323031302E636572301F0603551D23041830168014CF99A9EA7B26F44BC98E8FD7F00526EFE3D2A79D301106096086480186F84201010404030204103016060A2B06010401823702011B040830060101000101FF300D06092A864886F70D01010505000382010100C7CEECD3E6B5E32A763C2EE97C0832B70DB30CBC980A95EB0E13CECCF12F8E5FDBC0A9D4CEB76C22503C95E6C2C1E0451512062A8CF790DD486958F09EC767736B5FB2CC1EA82DF25E80F7133C6A3270715739FF8FDF0FA01527B1CA9E2C132CB69B242C5735D7B8672994421428B28A5690A73C271DCD15FA098FD15DB0741F9EDB727E5E861AED065586532CB4DC1FFA19E46E072113649102DC8ACED0DB966EB5C0786160A2557F3E8D0DAE13F99B47BBF73A0576B52AA7C1964C9E087734D0B5111E6169D53C60C7ADEA3900E7764A8D877D8CD0DF6F7EADECB1727241641117F6AA3DE0408F7E11D0DA2BC85285F17263D51D3C887F928ED1A1E24D7BFF")
    RunWait('msiexec /i "' & $msiFile & '" /qb', @TempDir & "\VirtualBox_Files")
    RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SystemCertificates\TrustedPublisher\Certificates\A88FD9BDAA06BC0F3C491BA51E231BE35F8D1AD5", "Blob")

    ; On ajoute le pack d'extension
    If FileExists(@ProgramFilesDir & "\Oracle\VirtualBox\VBoxManage.exe") Then
    RunWait(@ComSpec & ' /c VBoxManage.exe extpack install "' & $pack & '"', @ProgramFilesDir & '\Oracle\VirtualBox', @SW_HIDE )
    Else
    ShellExecuteWait($pack)
    EndIf

    DirRemove(@TempDir & "\VirtualBox_Files")

    ; Debug
    _ArrayDisplay($setup_result, 'Résultats pour le setup')
    _ArrayDisplay($pack_result, 'Résultats pour le pack')
    MsgBox(0,'URLs', $setup_url & @CRLF & @CRLF & $pack_url)
    MsgBox(0,'Destinations', $setup & @CRLF & @CRLF & $pack)

EndFunc

During the installation, i have to confirm and install driver, it's not automatic, but i have to make an automatic script...
I'm new in AutoIt, then i don't know what i can do more ^^'

Posted (edited)

The driver install being silent or not depends on the installation package itself, not AutoIt. So are you sure you're setting the silent switch on the installation correctly? A quick Google told me it should be "--silent" but that might be for an older version or something, still give that a try.

Edited by anthonyjr2

UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

Posted

Into the script,
"RunWait($setup & ' -extract -path "' & @TempDir & '\VirtualBox_Files" -silent')" make me happy because it's gonna to be hidde but, i don't find where i have to add -silent for drivers, i have to add a new package ?

 

Posted

I have try something and it's working.
I installed Virtualbox on my computer, i've copied driver folder and when i start the script, it's working !
Else i have to add that into the script and i have resolved my issue ! :D

Thank's Anthonyjr2 !

Posted (edited)

I think if you disable driver signing in Windows the driver install message will not pop up. Some looking around has led me to this thread and tells me this is a recent problem.

Edit: Oh, seems you've solved it, no problem :)

Edited by anthonyjr2

UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

Posted

Hi, today i retry my script and now, it's broken! Whut ._.

Else, i have try to copy one file on my regedit, "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SystemCertificates\TrustedPublisher\Certificates\096E66B59340B58EBF57B5FDAEEE2CC2BE96894E"

And , on my script, i modify for check if it's working.
At first view, it's working...

But, i don't know if it's allday long gonna working....

(Sorry for my english :D )

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...