-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstall_Disc2.ps1
54 lines (44 loc) · 1.99 KB
/
Install_Disc2.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
# Define extraction and installation paths
$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Definition
$dc5Archive = "$scriptDirectory\DC5_Disc2.7z"
$vocalSongsArchive = "$scriptDirectory\D.C.5_Vocal_Songs.7z"
$installPath = "C:\Program Files\D.C.5 - Da Capo 5"
$vocalSongsInstallPath = "C:\Program Files\D.C.5 - Da Capo 5\D.C.5_Vocal_Songs"
# Check if 7-Zip is installed and determine its path
$7zPath = "$env:ProgramFiles\7-Zip\7z.exe"
# Check if the 7-Zip executable exists
if (-Not (Test-Path $7zPath)) {
Write-Host "7-Zip is not installed. Please install 7-Zip and try again."
exit
}
# Extract DC5_Disc2.7z file
Write-Host "Extracting DC5_Disc2.7z..."
# Use 7z to extract DC5_Disc2.7z
& "$7zPath" x "`"$dc5Archive`"" "-o`"$installPath`"" -y
# Check if extraction was successful
if ($LASTEXITCODE -eq 0) {
Write-Host "DC5_Disc2.7z extraction completed."
} else {
Write-Host "Extraction of DC5_Disc2.7z failed. Please check the archive file."
exit
}
# Ensure the target installation directory exists
if (-Not (Test-Path $vocalSongsInstallPath)) {
New-Item -ItemType Directory -Path $vocalSongsInstallPath -Force | Out-Null
}
# Extract D.C.5 Vocal Songs\CIRCUS.7z file
Write-Host "Extracting D.C.5 Vocal Songs\CIRCUS.7z..."
# Use 7z to extract D.C.5 Vocal Songs\CIRCUS.7z
& "$7zPath" x "`"$vocalSongsArchive`"" "-o`"$vocalSongsInstallPath`"" -y
# Check if extraction was successful
if ($LASTEXITCODE -eq 0) {
Write-Host "D.C.5 Vocal Songs\CIRCUS.7z extraction completed."
} else {
Write-Host "Extraction of D.C.5 Vocal Songs\CIRCUS.7z failed. Please check the archive file."
exit
}
# Load the necessary assembly for Windows Forms
Add-Type -AssemblyName "System.Windows.Forms"
# Display a message box indicating successful installation
[System.Windows.Forms.MessageBox]::Show("Installation successfully completed!", "Installation Status", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Information)
Write-Host "Installation process completed."