Jump to content
kavaa

Install Dropbox with PowerShell

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

  • Similar Content

    • By John @ Maven
      I am having issues with pulsewaycredentialprovider.dll stopping the Windows login screen from loading on Windows 10 1809.
      I have submitted a ticket to support at support@pulseway.com as well.
      The issue is that with Pulseway software installed and the credential provider loading the system boots to the displayed screen but will go no further.  I am able to run terminal and PowerShell commands from the web interface (prior to software uninstall) but can never log in.  Pulseway remote does not work either.
      This is happening on two Windows 10 1809 DELL Optiplex computers with fresh Windows 10 PRO installations.
      RIght now our only solution is to leave Pulseway uninstalled.
      Any information or solution helpful.
      Thanks.
      John


    • By flydev
      Hi,
      On the Windows Dashboard 6.1 (build 1113) the up-time display is quite strange - I love precision but 
       

    • By dpbklyn
      Is there a way to monitor the temperature on a machine on an on-going (or logged) basis?  I would like to set a notification to be sent when the Core Temp reached xx degrees. I see that it is monitored in the hardware section, but i can't find a place to trigger an event.
      Thakn you,
    • By Comissha
      Our technical support AD credentials have changed passwords and now we are getting hundreds of machines trying to login with the configured AD account PowerShell User Impersonation credentials…locking the technician accounts. These machines are spread out at 19 separate locations and over 600 miles, at remote locations. How do we remotely modify the Runtime PowerShell user credentials on those machines?
      I have tried uninstalling and then  reinstalling, but it absorbs the previous configuration…including the former PowerShell User credentials….I also tried calling tech support but was sent to voicemail. Help!
      Local Setings where credentials were entered:

      Remote Settings, no ability to enter or modify PowerShell User:

    • By dpbklyn
      It would be awesome if the email parser went a little deeper.  Sometimes a client emails us directly and we forward that email to Pulseway to open a ticket.  The problem with this is that it opens the ticket using our company as the client. 
      It would be great if we could get the parser to look in the email headers to find the address that the email originated from and use THAT to assign and client and user to the ticket.  There are other ticket systems that do this.
       
      Alternatively (though not as elegant), It would also work to put a flag in the subject line like "@CLIENTNAME" to get the email assigned to the client.  Is there a way to do this with workflows?
×