Skip to content

Commit 35e813b

Browse files
committed
Update setup_ghost.ps1
1 parent b15f640 commit 35e813b

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

api/scripts/setup_ghost.ps1

+28-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
layout: none
33
sitemap: false
44
---
5-
$DownloadURL = 'https://github.com/ovsky/ghost-open-toolbox/archive/refs/heads/complete.zip'
5+
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
6+
Write-Host "The script has to be run as an administrator"
7+
Read-Host -Prompt "Press any key to exit."
8+
Return
9+
}
10+
11+
$DownloadURL = 'https://github.com/shomykohai/ghost-toolbox-src/archive/refs/heads/main.zip'
612

713
$FilePath = "$env:TEMP\ghost_toolbox.zip"
814

@@ -15,26 +21,37 @@ catch {
1521
}
1622

1723
Expand-Archive -Force $FilePath -DestinationPath $env:TEMP\ghost_toolbox;
18-
Set-Location "$env:TEMP\ghost_toolbox\ghost-open-toolbox-complete"
24+
Set-Location "$env:TEMP\ghost_toolbox\ghost-toolbox-src-main"
1925
if (Test-Path "C:\Ghost Toolbox"){
26+
Write-Host "Found another instance of Ghost Toolbox directory."
27+
Write-Host "Removing old Ghost Toolbox."
2028
Remove-Item "C:\Ghost Toolbox" -Recurse
2129
}
30+
Write-Host "Creating new Ghost Toolbox directory."
2231
New-Item -ItemType Directory -Path "C:\Ghost Toolbox"
23-
Copy-Item -Path "$env:TEMP\ghost_toolbox\ghost-open-toolbox-complete\wget" -Destination "C:\Ghost Toolbox" -Recurse
24-
Copy-Item -Path "$env:TEMP\ghost_toolbox\ghost-open-toolbox-complete\toolbox.updater.x64.exe" -Destination "C:\Ghost Toolbox"
25-
Copy-Item -Path "$env:TEMP\ghost_toolbox\ghost-open-toolbox-complete\VCRUNTIME140_1D.dll" -Destination "C:\Ghost Toolbox"
26-
Copy-Item -Path "$env:TEMP\ghost_toolbox\ghost-open-toolbox-complete\VCRUNTIME140D.dll" -Destination "C:\Ghost Toolbox"
27-
Copy-Item -Path "$env:TEMP\ghost_toolbox\ghost-open-toolbox-complete\MSVCP140D.dll" -Destination "C:\Ghost Toolbox"
28-
Copy-Item -Path "$env:TEMP\ghost_toolbox\ghost-open-toolbox-complete\ucrtbased.dll" -Destination "C:\Ghost Toolbox"
29-
Start-Process PowerShell -Verb runAs -ArgumentList '-command Copy-Item $env:TEMP\ghost_toolbox\ghost-open-toolbox-complete\run.ghost.cmd C:\Windows\System32\migwiz\dlmanifests\run.ghost.cmd -Force'
30-
Start-Process PowerShell -Verb runAs -ArgumentList '-command Copy-Item $env:TEMP\ghost_toolbox\ghost-open-toolbox-complete\nhcolor.exe C:\Windows\System32\nhcolor.exe -Force'
32+
Write-Host "Copying files..."
33+
Copy-Item -Path "$env:TEMP\ghost_toolbox\ghost-toolbox-src-main\wget" -Destination "C:\Ghost Toolbox" -Recurse
34+
Copy-Item -Path "$env:TEMP\ghost_toolbox\ghost-toolbox-src-main\toolbox.updater.x64.exe" -Destination "C:\Ghost Toolbox"
35+
Copy-Item -Path "$env:TEMP\ghost_toolbox\ghost-toolbox-src-main\run.ghost.cmd" -Destination "C:\Windows\System32\migwiz\dlmanifests\run.ghost.cmd" -Force
36+
Copy-Item -Path "$env:TEMP\ghost_toolbox\ghost-toolbox-src-main\nhcolor.exe" -Destination "C:\Windows\System32\nhcolor.exe" -Force
37+
Copy-Item -Path "$env:TEMP\ghost_toolbox\ghost-toolbox-src-main\ucrtbased.dll" -Destination "C:\Windows\System32\ucrtbased.dll" -Force
38+
Copy-Item -Path "$env:TEMP\ghost_toolbox\ghost-toolbox-src-main\vcruntime140_1d.dll" -Destination "C:\Windows\System32\vcruntime140_1d.dll" -Force
39+
Copy-Item -Path "$env:TEMP\ghost_toolbox\ghost-toolbox-src-main\vcruntime140d.dll" -Destination "C:\Windows\System32\vcruntime140d.dll" -Force
40+
Copy-Item -Path "$env:TEMP\ghost_toolbox\ghost-toolbox-src-main\msvcp140d.dll" -Destination "C:\Windows\System32\msvcp140d.dll" -Force
41+
42+
43+
Write-Host "Gaining SE Edition privileges..."
3144
if((Test-Path -LiteralPath "HKLM:\SOFTWARE\WOW6432Node\GhostSpectre") -ne $true)
3245
{
3346
New-Item "HKLM:\SOFTWARE\WOW6432Node\GhostSpectre" -force -ea SilentlyContinue
3447
};
3548
New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\WOW6432Node\GhostSpectre' -Name 'Edition' -Value 'SUPERLITE SE' -PropertyType String -Force -ea SilentlyContinue;
36-
New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\WOW6432Node\GhostSpectre' -Name 'Ghost_Revision' -Value '11' -PropertyType String -Force -ea SilentlyContinue;
49+
New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\WOW6432Node\GhostSpectre' -Name 'Ghost_Revision' -Value '17' -PropertyType String -Force -ea SilentlyContinue;
3750
New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\WOW6432Node\GhostSpectre' -Name 'Check_Update' -Value 0 -PropertyType DWord -Force -ea SilentlyContinue;
3851
Set-Location $env:TEMP
52+
Write-Host "Cleanup..."
3953
Remove-Item "$env:TEMP\ghost_toolbox" -Recurse
4054
Remove-Item $FilePath
55+
56+
Write-Host "Done."
57+
Read-Host -Prompt "Press any key to exit."

0 commit comments

Comments
 (0)