@echo off rem AirWallet's installer for Windows. Paste into a Command Prompt, PowerShell or the Run box (Win+R): rem rem cmd /c "cd /d %TEMP% && curl -fsSLo aw.cmd https://airwallet.tech/install.cmd && aw.cmd" rem rem (AirWallet Offline, the hardened build: install-offline.cmd.) It uses only what Windows 10 and 11 come with -- rem curl, tar, certutil and ssh-keygen (OpenSSH Client) -- and installs the plain folder build: no PowerShell rem download-and-run and no self-unpacking program, the two things antivirus tools flag. It takes the newest release rem from airwallet.tech/download, checks the release's checksum list against AirWallet's release key (written into rem this script below, the key VERIFY.txt names), checks the download against that list and puts the app in place: rem %LOCALAPPDATA%\Programs\AirWallet (an earlier copy is moved aside beside it, never deleted; your wallets live in rem %APPDATA%\AirWallet and stay as they are), a Start menu entry, then starts it. Nothing it downloads is marked as rem "from the internet", so SmartScreen has nothing to stop. The checks catch a damaged or swapped file on the rem download server; they can't vouch for this script, which comes from the same place: read it first if you like rem (curl https://airwallet.tech/install.cmd). Its messages never use > < & or |: cmd would take them as commands rem (and a folder's name is always shown in quotes). Windows' own programs by their full paths, and never one from rem the folder it runs in (Temp): a program left there can't stand in for curl or ssh-keygen and fake the checks. setlocal EnableExtensions DisableDelayedExpansion set "NoDefaultCurrentDirectoryInExePath=1" set "SYS=%SystemRoot%\System32" set "CURL=%SYS%\curl.exe" set "TAR=%SYS%\tar.exe" set "CERTUTIL=%SYS%\certutil.exe" set "FINDSTR=%SYS%\findstr.exe" set "ROBOCOPY=%SYS%\Robocopy.exe" set "SSHKG=%SYS%\OpenSSH\ssh-keygen.exe" set "PS=%SYS%\WindowsPowerShell\v1.0\powershell.exe" set "BASE=https://airwallet.tech/download" if defined AIRWALLET_BASE set "BASE=%AIRWALLET_BASE%" set "OFFLINE=0" set "KEY=airwallet-release namespaces="airwallet-release" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIusKIKFk8gLDQgFNpxjjo7BRsy05sG11P42Dl0UGP8Y" set "FPR=SHA256:SV031wxY3OKk8aYTY4a6b7UYa80onuXiDi0tFobgOFE" set "APP=AirWallet" set "PAT=AirWallet-Windows-" set "TOP=AirWallet-Windows" set "OPEN=Open AirWallet.cmd" if "%OFFLINE%"=="1" set "APP=AirWallet Offline" if "%OFFLINE%"=="1" set "PAT=AirWallet-Offline-Windows-" if "%OFFLINE%"=="1" set "TOP=AirWallet-Offline-Windows" if "%OFFLINE%"=="1" set "OPEN=Open AirWallet-Offline.cmd" set "TMPD=" set "WHY=" for %%T in ("%CURL%" "%TAR%" "%CERTUTIL%" "%FINDSTR%") do ( if not exist %%T (set "WHY=%%~nxT is missing: this needs Windows 10, version 1803 or later, or Windows 11." & goto fail) ) if not exist "%SSHKG%" (set "WHY=it needs ssh-keygen to check the release's signature: Settings, System, Optional features, Add a feature, OpenSSH Client." & goto fail) set "TMPD=%TEMP%\airwallet-%RANDOM%%RANDOM%" mkdir "%TMPD%" >nul 2>nul || (set "WHY=couldn't make a folder in your Temp folder." & goto fail) rem the release's list, signed with the key above: anything else stops here, nothing installed echo Checking the newest %APP% release... "%CURL%" -fsSL -o "%TMPD%\SHA256SUMS.txt" "%BASE%/SHA256SUMS.txt" || (set "WHY=couldn't reach airwallet.tech: check the connection and try again." & goto fail) "%CURL%" -fsSL -o "%TMPD%\SHA256SUMS.txt.sig" "%BASE%/SHA256SUMS.txt.sig" || (set "WHY=couldn't reach airwallet.tech: check the connection and try again." & goto fail) >"%TMPD%\key" echo %KEY% "%SSHKG%" -Y verify -f "%TMPD%\key" -I airwallet-release -n airwallet-release -s "%TMPD%\SHA256SUMS.txt.sig" <"%TMPD%\SHA256SUMS.txt" >nul 2>nul || (set "WHY=the release's checksum list isn't signed with AirWallet's release key, %FPR%. Stopped: nothing was installed." & goto fail) rem the newest zip of this kind on the list (sorted by name: the newest date last) and its checksum (each command in rem a for /f wrapped in one more pair of quotes: cmd /c takes the outer pair off) set "FILE=" set "WANT=" for /f "usebackq tokens=1,2" %%A in (`""%FINDSTR%" /c:" %PAT%" "%TMPD%\SHA256SUMS.txt""`) do if /i "%%~xB"==".zip" (set "WANT=%%A" & set "FILE=%%B") if not defined FILE (set "WHY=this release has no %PAT% zip." & goto fail) echo Downloading %FILE%... "%CURL%" -fSL --progress-bar -o "%TMPD%\%FILE%" "%BASE%/%FILE%" || (set "WHY=the download stopped: try again." & goto fail) set "GOT=" for /f "skip=1 delims=" %%H in ('""%CERTUTIL%" -hashfile "%TMPD%\%FILE%" SHA256"') do if not defined GOT set "GOT=%%H" if defined GOT set "GOT=%GOT: =%" if /i not "%GOT%"=="%WANT%" (set "WHY=%FILE% doesn't match the signed list: a damaged or swapped download. Stopped: nothing was installed." & goto fail) echo Checked: it's the signed release. echo Unpacking... "%TAR%" -xf "%TMPD%\%FILE%" -C "%TMPD%" || (set "WHY=couldn't unpack %FILE%." & goto fail) if not exist "%TMPD%\%TOP%\python\pythonw.exe" (set "WHY=%FILE% isn't laid out as expected. Stopped: nothing was installed." & goto fail) if not exist "%TMPD%\%TOP%\%OPEN%" (set "WHY=%FILE% isn't laid out as expected. Stopped: nothing was installed." & goto fail) rem in place: an earlier copy moved aside first -- it can't be while it runs -- and back if the new one won't go in if defined AIRWALLET_DEST (set "DEST=%AIRWALLET_DEST%") else (set "DEST=%LOCALAPPDATA%\Programs\%APP%") if not exist "%LOCALAPPDATA%\Programs" mkdir "%LOCALAPPDATA%\Programs" >nul 2>nul set "PREV=" if exist "%DEST%" set "PREV=%DEST% before %RANDOM%%RANDOM%" if defined PREV move "%DEST%" "%PREV%" >nul 2>nul || (set "WHY=%APP% is open, or a window shows its folder: close it, then run this again. Your wallets stay where they are." & set "PREV=" & goto fail) move "%TMPD%\%TOP%" "%DEST%" >nul 2>nul && goto placed rem (a Temp folder on another drive: a folder can't be moved across drives -- copied, then) "%ROBOCOPY%" "%TMPD%\%TOP%" "%DEST%" /E /MOVE /R:1 /W:1 /NFL /NDL /NJH /NJS /NP >nul 2>nul if errorlevel 8 (set "WHY=couldn't put %APP% in its folder." & goto undo) :placed rem the Start menu entry (a shortcut to its own launcher, started minimized) -- PowerShell only for that, nothing downloaded set "AW_LNK=%APPDATA%\Microsoft\Windows\Start Menu\Programs\%APP%.lnk" set "AW_TARGET=%DEST%\%OPEN%" set "AW_DIR=%DEST%" set "AW_ICON=%DEST%\AirWallet.ico" if not exist "%AW_ICON%" set "AW_ICON=%DEST%\python\pythonw.exe" "%PS%" -NoProfile -NonInteractive -Command "$s = (New-Object -ComObject WScript.Shell).CreateShortcut($env:AW_LNK); $s.TargetPath = $env:AW_TARGET; $s.WorkingDirectory = $env:AW_DIR; $s.IconLocation = $env:AW_ICON + ',0'; $s.WindowStyle = 7; $s.Description = 'Wallet for Bitcoin, Ethereum, Solana, Monero and Zcash'; $s.Save()" >nul 2>nul || echo No Start menu entry: open it with "%DEST%\%OPEN%". rd /s /q "%TMPD%" >nul 2>nul echo. echo Done: %APP% is in "%DEST%", and in the Start menu. if defined PREV echo The copy it replaced is in "%PREV%": delete it once the new one works. rem (the offline signer: not started -- its network block first, as an administrator, once) if "%OFFLINE%"=="1" echo Before its first use: right-click "%DEST%\Block network (admin).cmd", Run as administrator. Then open it from the Start menu. if "%OFFLINE%"=="1" goto opened if not defined AIRWALLET_NO_OPEN start "" /min "%DEST%\%OPEN%" :opened rem (a few seconds to read it: started from Win+R, this window closes when it ends) if not defined AIRWALLET_NO_PAUSE timeout /t 6 >nul 2>nul endlocal exit /b 0 :undo rem (a copy that stopped partway: set aside, never deleted, and the earlier one put back) set "PART=%DEST% unfinished %RANDOM%%RANDOM%" if exist "%DEST%" move "%DEST%" "%PART%" >nul 2>nul if defined PREV if not exist "%DEST%" move "%PREV%" "%DEST%" >nul 2>nul if defined PREV if exist "%PREV%" set "WHY=%WHY% The earlier copy couldn't be put back: it's in its folder beside it, ending before." if defined PREV if not exist "%PREV%" set "WHY=%WHY% The earlier copy is back in place." :fail echo. echo AirWallet installer: %WHY% if defined TMPD if exist "%TMPD%" rd /s /q "%TMPD%" >nul 2>nul echo. if not defined AIRWALLET_NO_PAUSE pause endlocal exit /b 1