-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstall_Disc1.ps1
34 lines (27 loc) · 1.17 KB
/
Install_Disc1.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
# Define the extraction path and target installation path
$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Definition
$dc5Archive = "$scriptDirectory\DC5_Disc1.7z"
$installPath = "C:\Program Files\D.C.5 - Da Capo 5"
# 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.7z file
Write-Host "Extracting..."
# Use 7z to extract DC5.7z
& $7zPath x $dc5Archive "-o$installPath" -y
# Check if extraction was successful
if ($?) {
Write-Host "Extraction completed successfully."
} else {
Write-Host "Extraction failed. Please check the archive file."
exit
}
# Load the necessary assembly for Windows Forms
Add-Type -AssemblyName "System.Windows.Forms"
# Display a message box asking the user to insert DC5_Disc2
[System.Windows.Forms.MessageBox]::Show("Please insert DC5_Disc2 and click OK to continue.", "Notice", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Information)
Write-Host "Installation process completed."