-
Notifications
You must be signed in to change notification settings - Fork 41
/
bizhawk-co-op.ps1
63 lines (54 loc) · 2.35 KB
/
bizhawk-co-op.ps1
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#Download and move files for mzm-coop
$shell_app=new-object -com shell.application
$version=2.8
$branch="master"
mkdir BizHawk-$version
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
#Download Bizhawk
$url = "https://github.com/TASVideos/BizHawk/releases/download/$version/BizHawk-$version-win-x64.zip"
$filename = "bizHawk-$version.zip"
Invoke-WebRequest -Uri $url -OutFile $filename
#Unzip
$zip_file = $shell_app.namespace((Get-Location).Path + "\$filename")
$destination = $shell_app.namespace((Get-Location).Path + "\BizHawk-$version")
$destination.Copyhere($zip_file.items())
Remove-Item $filename
#Download prereq
$url = "https://github.com/TASEmulators/BizHawk-Prereqs/releases/download/2.4.8_1/bizhawk_prereqs_v2.4.8_1.zip"
$filename = "bizprereq.zip"
Invoke-WebRequest -Uri $url -OutFile $filename
#unzip prereq
$zip_file = $shell_app.namespace((Get-Location).Path + "\$filename")
$destination = $shell_app.namespace((Get-Location).Path)
$destination.Copyhere($zip_file.items())
Remove-Item $filename
#Download luasocket
$url = "https://www.zeldaspeedruns.com/assets/luasocket-2.0.2-lua-5.1.2-Win32-vc8.zip"
$filename = "luasocket-2.0.2-lua-5.1.2-Win32-vc8.zip"
Invoke-WebRequest -Uri $url -OutFile $filename
#unzip
$zip_file = $shell_app.namespace((Get-Location).Path + "\$filename")
mkdir luasocket
$destination = $shell_app.namespace((Get-Location).Path + "\luasocket")
$destination.Copyhere($zip_file.items())
Remove-Item $filename
#download bizhawk-co-op
$url = "https://github.com/TestRunnerSRL/bizhawk-co-op/archive/$branch.zip"
$filename = "bizhawk-co-op.zip"
Invoke-WebRequest -Uri $url -OutFile $filename
#unzip
$zip_file = $shell_app.namespace((Get-Location).Path + "\$filename")
$destination = $shell_app.namespace((Get-Location).Path)
$destination.Copyhere($zip_file.items())
Remove-Item $filename
#Copy files into Bizhawk
Move-Item -Path .\bizhawk-co-op-$branch\* -Destination .\BizHawk-$version\
Remove-Item .\bizhawk-co-op-$branch -Recurse
Move-Item -Path .\luasocket\mime -Destination .\BizHawk-$version\
Move-Item -Path .\luasocket\socket -Destination .\BizHawk-$version\
Move-Item -Path .\luasocket\lua\* -Destination .\BizHawk-$version\Lua\
Move-Item -Path .\luasocket\lua5.1.dll -Destination .\BizHawk-$version\dll\
Remove-Item .\luasocket -Recurse
Start-Process .\bizhawk_prereqs.exe -Wait
Remove-Item .\bizhawk_prereqs.exe
pause