-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
48 lines (36 loc) · 1.66 KB
/
Copy pathinstall.ps1
File metadata and controls
48 lines (36 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Silence Output
$ProgressPreference = 'SilentlyContinue'
# Variables
$installer = 'https://buildbot.libretro.com/stable/1.15.0/windows/x86_64/RetroArch-Win64-setup.exe'
#$7zip = 'https://www.7-zip.org/a/7z2201-x64.exe'
$destination = 'C:\RA\'
$SNES = "<%= archives.link('ROMs', 'SNES Roms.rar', 1200) %>"
$NES = "<%= archives.link('ROMs', 'NESMerge201.rar', 1200) %>"
# Create Directories
New-Item -Path $destination -ItemType Directory
# Install RetroArch
Start-BitsTransfer -Source $installer -Destination ($destination + "retroarch.exe")
& ($destination + "retroarch.exe") /S
Start-Sleep 15
# Grab ROMs
Start-BitsTransfer -Source $SNES -Destination ($destination + 'snes.rar') -Dynamic
Start-BitsTransfer -Source $NES -Destination ($destination + 'nes.rar') -Dynamic
# Install 7-Zip
# if (!(get-package 7-zip*)) {
# Start-BitsTransfer -Source $7zip -Destination ($destination + "\7zip.msi")
# msiexec /i ($destination + "\7zip.msi") /qb
# }
if (!(get-module 7Zip4PowerShell)) {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force;
Set-PSRepository -Name 'PSGallery' -SourceLocation "https://www.powershellgallery.com/api/v2" -InstallationPolicy Trusted;
Install-Module -Name 7Zip4PowerShell -Force;
}
# Extract ROMs
$archives = Get-ChildItem -Path $destination -Recurse -Include "*.zip", "*.rar", "*.7z"
foreach ($archive in $archives) {
New-Item -Path ("c:\ROMs\" + $archive.BaseName) -ItemType Directory
Expand-7Zip -ArchiveFileName $archive -TargetPath ("c:\ROMs\" + $archive.BaseName)
}
# Cleanup
Remove-Item -LiteralPath $destination -Force -Recurse