Jump to content
View in the app

A better way to browse. Learn more.

Pulseway

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I made a install script for Winrar to do a Silent install.

UPDATED VERSION 2 With auto detect if Invoke-WebRequest exists

Improvements are welcome!

When a new version of Winrar comes out, just change the winrar-x64-540.exe to the new value.

# Silent Install Winrar
# http://www.winrar.com

# 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 = "http://rarlab.com/rar/winrar-x64-540.exe"
$destination = "$workdir\winrar.exe"
Invoke-WebRequest $source -OutFile $destination

# Start the installation

Start-Process -FilePath "$workdir\winrar.exe" -ArgumentList "/S"

# Wait XX Seconds for the installation to finish

Start-Sleep -s 35

# Remove the installer

rm -Force $workdir\w*

For Windows 7 please change 

$source = "http://rarlab.com/rar/winrar-x64-540.exe"
$destination = "$workdir\winrar.exe"
Invoke-WebRequest $source -OutFile $destination

To

$WebClient = New-Object System.Net.WebClient
$WebClient.DownloadFile("http://rarlab.com/rar/winrar-x64-540.exe","$workdir\winrar.exe")

Since Powershell in Windows 7 does not support the Invoke-WebRequest

I tried this script.

It did not install.

I opened the directory c:\installer and watched it while I ran the script a second time.

I never saw a file appear in this directory.

I tested this on Windows 7 

  • Author
7 minutes ago, ComputerConsulting said:

I tried this script.

It did not install.

I opened the directory c:\installer and watched it while I ran the script a second time.

I never saw a file appear in this directory.

I tested this on Windows 7 

Since I only have Windows 8 and up Machines at the moment I cannot test it.

I'm going to install a Windows 7 VM now to test it on there as well.

p.s. the files gets downloaded via PowerShell and it could be slow.

  • Author
40 minutes ago, Paul said:

Thank you for your scripts. BTW: You can use -Wait on the Start-Process to wait for the process to exit. An alternative would be Wait-Process which also supports -Timeout. Great job.

-Paul

I did try it with that, but sometimes it failed. So that's why I went back to a old fashion Wait...

  • Author
3 minutes ago, ComputerConsulting said:

I watched the script finish in less than a minute.  

If you have a Fast Connection that's normal then ;) 

But if its not installed then something is Wrong.

I need to test it on Windows 7 only tested it on Windows 10

  • Author
2 minutes ago, ComputerConsulting said:

 


$destination = "$workdir\winrar.exe"

 

I know next to nothing about PowerShell scripting, but why did you end the line with winrar.exe ?  That's not a directory, that's a file.

$source = "http://rarlab.com/rar/winrar-x64-540.exe" -> Download Location
$destination = "$workdir\winrar.exe" -> Location where the file needs to be saved
Invoke-WebRequest $source -OutFile $destination -> Command that executes the download

So the download should be saved in the $workdir and the workdir = C:\installer 

That's where the Destination is for.

1 minute ago, ComputerConsulting said:

You have a 35 second sleep in the script.  

The script runs for 35 seconds.  

True, that is so that the script waits 35sec. before removing the Installer.

  • 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 Winrar
# http://www.winrar.com

# 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 = "http://rarlab.com/rar/winrar-x64-540.exe"
$destination = "$workdir\winrar.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\winrar.exe" -ArgumentList "/S"

# Wait XX Seconds for the installation to finish

Start-Sleep -s 35

# Remove the installer

rm -Force $workdir\w*

 

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.