Skip to content

Instantly share code, notes, and snippets.

@XMB5
Last active December 19, 2019 20:56
Show Gist options
  • Save XMB5/5acf96b62491164d1cb355cf037f1777 to your computer and use it in GitHub Desktop.
Save XMB5/5acf96b62491164d1cb355cf037f1777 to your computer and use it in GitHub Desktop.
Jetbrains Product Installer without admin
$ideCode = Read-Host 'CL - Clion
PC - Pycharm
IIU - IntelliJ
WS - WebStorm
Enter an IDE code'
cd ~\Desktop
$WshShell = New-Object -comObject WScript.Shell
echo "Downloading 7-zip..."
Invoke-WebRequest -Uri 'https://drive.google.com/uc?export=download&id=1I8V3qqBq6R0jkrNaDrk4nxYKHdQgWaep' -OutFile 7za.exe -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox
echo "Fetching product info..."
$releaseJson = ((New-Object System.Net.WebClient).DownloadString("https://data.services.jetbrains.com/products/releases?code=$ideCode&latest=true&type=release"))
$releaseInfo = ConvertFrom-Json -InputObject $releaseJson
$downloadUrl = $releaseInfo."$ideCode".downloads.windowsZip.link
echo "Downloading IDE..."
Start-BitsTransfer -Source "$downloadUrl" -Destination "$ideCode.zip"
echo "Extracting IDE..."
.\7za.exe x "$ideCode.zip" "-o$ideCode-Data" -bso0 -y
echo "Deleting zip file..."
Remove-Item -Path "$ideCode.zip"
Start-BitsTransfer -Source "https://cygwin.com/setup-x86_64.exe" -Destination cyg.exe
.\cyg.exe --no-admin -P gcc-core,gcc-g++,gdb,make,cmake -q -s http://cygwin.mirror.constant.com -O -R "$Home\Desktop\cygwin"
echo "Creating IDE desktop shortcut..."
$batFile = (Get-ChildItem "$ideCode-Data\bin" -Exclude @('inspect.bat','append.bat','format.bat') | Where-Object { $_ -match '\.bat$' } | Select-Object -First 1).Name
$icoFile = $batFile.Replace('.bat','.ico')
$TermShortcut = $WshShell.CreateShortcut("$Home\Desktop\$ideCode.lnk")
$TermShortcut.IconLocation = "$Home\Desktop\$ideCode-Data\bin\$icoFile"
$TermShortcut.TargetPath = "$Home\Desktop\$ideCode-Data\bin\$batFile"
$TermShortcut.Arguments = "-"
$TermShortcut.Save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment