confOS/windows/installers/deceive.bat
2024-07-02 12:15:42 +02:00

26 lines
964 B
Batchfile

@ECHO OFF
:: Start as administrator
fltmc >NUL 2>&1 || (
PowerShell Start -Verb RunAs '%0' 2>NUL || (
EXIT 1
)
EXIT 0
)
ECHO Deceive...
MKDIR "%LOCALAPPDATA%\Deceive" 2>NUL
PowerShell -Command "" ^
"$exe = 'Deceive.exe';" ^
"$link = 'https://github.com/molenzwiebel/Deceive/releases/latest/download/' + $exe;" ^
"$outfile = Join-Path -Path '%LOCALAPPDATA%\Deceive' -ChildPath $exe;" ^
"Invoke-WebRequest -Uri $link -OutFile $outfile;" ^
"$WshShell = New-Object -comObject WScript.Shell;" ^
"$Shortcut = $WshShell.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\Deceive.lnk');" ^
"$Shortcut.TargetPath = $outfile;" ^
"$Shortcut.Save()"
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\Deceive" /f /v DisplayName /t REG_SZ /d "Deceive"
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\Deceive" /f /v InstallLocation /t REG_SZ /d "%LOCALAPPDATA%\Deceive"
IF NOT "%1"=="yes" PAUSE
EXIT /B