Posted February 14, 20178 yr I made a install script for Dropbox to do a Silent install. UPDATED VERSION 2 With auto detect if Invoke-WebRequest exists Improvements are welcome! Change the version if needed in the Source URL: https://www.dropbox.com/downloading?full=1&os=win # Silent Install Dropbox # Download URL: https://www.dropbox.com/downloading?full=1&os=win # Path for the workdir $workdir = "c:\ictwebsolution\" # Check if work directory exists if not create it If (Test-Path -Path $workdir -PathType Container) { Write-Host "$workdir already exists" -ForegroundColor Red} ELSE { New-Item -Path $workdir -ItemType directory } # Download the installer $source = "https://www.dropbox.com/download?full=1&plat=win" $destination = "$workdir\dropbox.exe" Invoke-WebRequest $source -OutFile $destination # Start the installation Start-Process -FilePath "$workdir\dropbox.exe" -ArgumentList "/S" # Wait XX Seconds for the installation to finish Start-Sleep -s 60 # Remove the installer rm -Force $workdir\dropbox* For Windows 7 please change $source = "https://www.dropbox.com/download?full=1&plat=win" $destination = "$workdir\dropbox.exe" Invoke-WebRequest $source -OutFile $destination To $WebClient = New-Object System.Net.WebClient $WebClient.DownloadFile("https://www.dropbox.com/download?full=1&plat=win","$workdir\dropbox.exe") Since Powershell in Windows 7 does not support the Invoke-WebRequest Please let the user Log Off and On again after the installation of dropbox, then Dropbox wil auto start.
February 14, 20178 yr Author Version 2 This version will check if the Invoke-WebRequest Command exists or not. For legacy Systems like Windows 7 you than only have one Script and don't need to change things in Pulseway # Silent Install Dropbox # Download URL: https://www.dropbox.com/downloading?full=1&os=win # Path for the workdir $workdir = "c:\installer\" # Check if work directory exists if not create it If (Test-Path -Path $workdir -PathType Container) { Write-Host "$workdir already exists" -ForegroundColor Red} ELSE { New-Item -Path $workdir -ItemType directory } # Download the installer $source = "hhttps://www.dropbox.com/download?full=1&plat=win" $destination = "$workdir\dropbox.exe" # Check if Invoke-Webrequest exists otherwise execute WebClient if (Get-Command 'Invoke-Webrequest') { Invoke-WebRequest $source -OutFile $destination } else { $WebClient = New-Object System.Net.WebClient $webclient.DownloadFile($source, $destination) } # Start the installation Start-Process -FilePath "$workdir\dropbox.exe" -ArgumentList "/S" # Wait XX Seconds for the installation to finish Start-Sleep -s 60 # Remove the installer rm -Force $workdir\dropbox* Please let the user Log Off and On again after the installation of dropbox, then Dropbox wil auto start.
August 4, 20204 yr Is there something I can add to the script to also automatically sign in an account?
Create an account or sign in to comment