forked from TestRunnerSRL/bizhawk-co-op
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bizhawk-co-op.ps1
62 lines (52 loc) · 2.28 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
#Download and move files for mzm-coop
$shell_app=new-object -com shell.application
mkdir BizHawk-2.3
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
#Download Bizhawk
$url = "https://github.com/TASVideos/BizHawk/releases/download/2.3/BizHawk-2.3.zip"
$filename = "bizHawk-2.3.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-2.3")
$destination.Copyhere($zip_file.items())
Remove-Item $filename
#Download prereq
$url = "https://github.com/TASVideos/BizHawk-Prereqs/releases/download/2.1/bizhawk_prereqs_v2.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 = "http://files.luaforge.net/releases/luasocket/luasocket/luasocket-2.0.2/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 TeamBN's bizhawk-co-op fork
$url = "https://github.com/TeamBattleNet/CooPatch/archive/master.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 .\CooPatch-master\* -Destination .\BizHawk-2.3\
Remove-Item .\CooPatch-master -Recurse
Move-Item -Path .\luasocket\mime -Destination .\BizHawk-2.3\
Move-Item -Path .\luasocket\socket -Destination .\BizHawk-2.3\
Move-Item -Path .\luasocket\lua\* -Destination .\BizHawk-2.3\Lua\
Move-Item -Path .\luasocket\lua5.1.dll -Destination .\BizHawk-2.3\dll\
Remove-Item .\luasocket -Recurse
Start-Process .\bizhawk_prereqs.exe -Wait
Remove-Item .\bizhawk_prereqs.exe
pause