Skip to content

Use all your internet connections at once on Windows, macOS, Linux and Android: per-connection load balancing over Wi-Fi, Ethernet, mobile data and phone tethers

install.ps1: install in plain sight so antivirus does not stop it (#37)

Rohit Mahto266c9992aa0b
diff --git a/README.md b/README.md
index 06cd3d2..472076c 100644
--- a/README.md
+++ b/README.md
@@ -82,6 +82,9 @@ curl -fsSL https://raw.githubusercontent.com/rohit267/net-merge/main/install.sh
irm https://raw.githubusercontent.com/rohit267/net-merge/main/install.ps1 | iex
```
+Antivirus blocked it? Download [net-merge-setup.exe](https://github.com/rohit267/net-merge/releases/latest/download/net-merge-setup.exe)
+and double-click it instead.
+
That's it: net-merge is installed and its icon appears in the menu bar or tray. On Linux the script
uses your package manager (apt, dnf, zypper, apk or pacman) and on macOS Homebrew when you have it, so
net-merge updates with the rest of your system. To start it at sign-in, tick *Start at sign-in* in its menu.
diff --git a/install.ps1 b/install.ps1
index e23a58b..97e69e6 100644
--- a/install.ps1
+++ b/install.ps1
@@ -2,19 +2,20 @@
#
# irm https://raw.githubusercontent.com/rohit267/net-merge/main/install.ps1 | iex
#
-# Downloads the newest installer, runs it silently (Windows asks once for admin rights), then starts
-# the tray. Set $env:NET_MERGE_NO_START = '1' first to leave the tray off.
+# Downloads the newest installer into your Downloads folder and runs it with its progress window
+# showing; it asks for admin rights itself. Then starts the tray. Set $env:NET_MERGE_NO_START = '1'
+# first to leave the tray off. It does what you would do by hand, in plain sight: antivirus such as
+# Kaspersky stops scripts that drop a program in Temp, run it hidden and elevated, then delete it.
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue' # the progress bar makes downloads very slow in Windows PowerShell
-[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
$url = 'https://github.com/rohit267/net-merge/releases/latest/download/net-merge-setup.exe'
-$setup = Join-Path $env:TEMP 'net-merge-setup.exe'
-Write-Host '==> Downloading net-merge'
+$setup = Join-Path $env:USERPROFILE 'Downloads\net-merge-setup.exe'
+Write-Host "==> Downloading net-merge to $setup"
+New-Item -ItemType Directory -Force (Split-Path $setup) | Out-Null
Invoke-WebRequest $url -OutFile $setup -UseBasicParsing
-Write-Host '==> Installing'
-$p = Start-Process $setup -ArgumentList '/SILENT', '/SUPPRESSMSGBOXES', '/NORESTART' -Verb RunAs -Wait -PassThru
-Remove-Item $setup -ErrorAction SilentlyContinue
+Write-Host '==> Installing (approve the admin prompt)'
+$p = Start-Process $setup -ArgumentList '/SILENT', '/NORESTART' -Wait -PassThru
if ($p.ExitCode -ne 0) { throw "the installer failed (exit code $($p.ExitCode))" }
$dir = Join-Path $env:ProgramFiles 'net-merge'