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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Similar Content

    • By GlobalIT
      I have created a Windows cmd file to copy files nightly on one of my servers. If there is an error, the cmd file outputs the error to an error.txt file, thus updated the "Last Write" date on the file. My command file is working great, and outputs the errors to the error.txt, and the date stamp on the error.txt file is updated each time this happens.
      I configured the Pulseway Computer Settings via Notifications -> Storage -> Files. I added the error.txt and checked for notifications to be sent when the file last write date has changed. (see image)
      This works the first time, but the second, no notification is sent. Am I doing something wrong? Any pointers on how I can make this work consistently?
      Thanks!

    • By BigEz
      Hi Everyone!
      How is possible assign automatically an hardware asset to a customer in PSA when a ticket is created trough a support request ? What kind of configuration i've to do in RMM side to match a customer in PSA?
    • By Ian G
      Hello,
      We are long-term Pulseway customers but lately the Pulseway client has developed a bug and continuously uses up to 20%+ CPU utilisation.
      We logged this with Pulseway on the 4th of July this year but they have been completely ignoring the ticket. I regularly reply to the email thread for an update (at least once a week) but I am ignored. The only time I had a meaningful response was when I threatened to cancel our subscription. This was short lived and now I am back to being ignored with no status updates on my ticket.
      We like the product but we have a handful of servers with this bug and I am simply installing other monitoring products on them. Today I have sent my usual email to Pulseway support asking for a status update on my ticket but I'm certain I'll get nothing back...
      The next step will then be to install a better monitoring product like Infradog and to write the same post on Spiceworks so people know that Pulseway doesn't offer good technical support.
       
    • By patrickjung
      I hope I am in the right Subforum to ask this question.
      I recently started to use Pulseway and am impressed what I am able to do with it but I noticed one feature missing that I need.
      Is it possible with Pulseway to check Servers/Clients with log files for backups if they have been successful or failed? For example if there is a NAS connected to a network and someone is doing a USB Backup on it I want to check if it has failed so I will get a notification when it fails. I want to use it on Windows and Linux machines so my best guess is to use a script of somekind right?
       
    • By istvankolkert
      I have enabled lost of notifications on my pc but none of the show up, the did once or twice but not anymore, has anyone a idea why?
×
×
  • Create New...