-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstallGameband.ps1
46 lines (37 loc) · 1.6 KB
/
InstallGameband.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
$GB_files_URL = "https://files.valtek.uk/Gameband-Files/gameband_sw.zip"
$GB_launcher_URL = "https://files.valtek.uk/Gameband-Files/GamebandLauncher.exe"
$JAVA_DOWNLOAD_URL = "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u322-b06/OpenJDK8U-jre_x86-32_windows_hotspot_8u322b06.zip"
$GB_EXE_hash = "E2D62CEF222A6B35FC71EB87972752D324E51C6C3C451069FD8473C50728AAED"
$Linux_launch_script = @"
#!/bin/bash
if which java
then
else
./.javalin/
fi
"@
$files_to_hide = @(".lib","._.VolumeIcon.icns", "Gameband.app", "Gameband_linux.bat", ".javawin")
Add-Type -AssemblyName PresentationCore,PresentationFramework
Add-Type -AssemblyName System.IO;
if (-Not (Test-Path -Path "$PWD\.lib")) {
[System.Windows.MessageBox]::Show('Gameband files not found, downloading', 'Gameband Error')
Invoke-WebRequest -Uri "$GB_files_URL" -OutFile "$PWD\gameband_sw.zip"
Expand-Archive "$PWD\gameband_sw.zip" -DestinationPath $PWD
Remove-Item "$PWD\gameband_sw.zip"
Remove-Item -LiteralPath "$PWD\Gameband.app" -Force -Recurse
}
if ((Get-FileHash "$PWD\Gameband.exe").Hash -eq $GB_EXE_hash) {
Remove-Item -LiteralPath "$PWD\Gameband.exe" -Force
Invoke-WebRequest -Uri "$GB_launcher_URL" -OutFile "$PWD\Gameband.exe"
}
if (-Not (Test-Path -Path "$PWD\.javawin")) {
Invoke-WebRequest -Uri "$JAVA_DOWNLOAD_URL" -OutFile "$PWD\java.zip"
Expand-Archive "$PWD\java.zip" -DestinationPath "$PWD"
Remove-Item "$PWD\java.zip"
Move-Item "$PWD\jdk8u322-b06-jre" "$PWD\.javawin"
}
foreach ($file in $files_to_hide) {
$fileobj = Get-Item $file -Force
$fileobj.Attributes += 'Hidden'
}
Pause