Nox: Difference between revisions

From LANCommander
(Created new page for Nox)
 
No edit summary
 
Line 21: Line 21:
|Name = Install Script
|Name = Install Script
|Description =  
|Description =  
|RequiresAdmin = True
|RequiresAdmin = False
|Contents =
|Contents =
<syntaxhighlight lang="powershell" line>
<syntaxhighlight lang="powershell" line>
New-Item -Path "registry::\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Westwood\Nox"
$Display = Get-PrimaryDisplay
New-ItemProperty -Path "registry::\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Westwood\Nox" -Name "Name" -Value "Nox" -Force
$VirtualStore = "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE"
New-ItemProperty -Path "registry::\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Westwood\Nox" -Name "InstallPath" -Value "$InstallDirectory\Nox.EXE" -Force
 
New-ItemProperty -Path "registry::\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Westwood\Nox" -Name "SKU" -Value 9472 -Force
New-Item -Path "$VirtualStore\WOW6432Node\Westwood\Nox"
New-ItemProperty -Path "registry::\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Westwood\Nox" -Name "Version" -Value 65538 -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Westwood\Nox" -Name "Name" -Value "Nox" -Force
New-ItemProperty -Path "registry::\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Westwood\Nox" -Name "Serial" -Value "664633-703436-227220-5728" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Westwood\Nox" -Name "InstallPath" -Value "$InstallDirectory\Nox.EXE" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Westwood\Nox" -Name "SKU" -Value 9472 -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Westwood\Nox" -Name "Version" -Value 65538 -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Westwood\Nox" -Name "Serial" -Value "664633-703436-227220-5728" -Force


Rename-Item -Path "$InstallDirectory\MOVIES\INTRO.VQA" -NewName "$InstallDirectory\MOVIES\INTRO.VQA.bak"
Rename-Item -Path "$InstallDirectory\MOVIES\INTRO.VQA" -NewName "$InstallDirectory\MOVIES\INTRO.VQA.bak"
Rename-Item -Path "$InstallDirectory\MOVIES\NOXLOGO.VQA" -NewName "$InstallDirectory\MOVIES\NOXLOGO.VQA.bak"
Rename-Item -Path "$InstallDirectory\MOVIES\NOXLOGO.VQA" -NewName "$InstallDirectory\MOVIES\NOXLOGO.VQA.bak"
Rename-Item -Path "$InstallDirectory\MOVIES\WWLOGO.VQA" -NewName "$InstallDirectory\MOVIES\WWLOGO.VQA.bak"
Rename-Item -Path "$InstallDirectory\MOVIES\WWLOGO.VQA" -NewName "$InstallDirectory\MOVIES\WWLOGO.VQA.bak"
$X = $Display.Bounds.Width
$Y = $Display.Bounds.Height
$NoxX = 1024
$NoxY = 768
if (($X / $Y) -eq (16 / 9)) {
    $NoxX = 1024
    $NoxY = 576
} elseif (($X / $Y) -eq (16 / 10)) {
    $NoxX = 1024
    $NoxY = 640
}
Write-ReplaceContentInFile -Pattern '^VideoMode = (.+)' -Substitution "VideoMode = $NoxX $NoxY 16" -FilePath "$InstallDirectory\nox.cfg"
Write-ReplaceContentInFile -Pattern '^VideoMode = (.+)' -Substitution "VideoMode = $NoxX $NoxY 16" -FilePath "$InstallDirectory\default.cfg"
</syntaxhighlight>
</syntaxhighlight>
}}
}}
Line 40: Line 60:
|Name = Uninstall Script
|Name = Uninstall Script
|Description =  
|Description =  
|RequiresAdmin = True
|RequiresAdmin = False
|Contents =
|Contents =
<syntaxhighlight lang="powershell" line>
<syntaxhighlight lang="powershell" line>
Remove-Item -Path "registry::\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Westwood\Nox" -recurse -Force
$VirtualStore = "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE"
Remove-Item -Path "$VirtualStore\WOW6432Node\Westwood\Nox" -Recurse -Force
</syntaxhighlight>
</syntaxhighlight>
}}
}}

Latest revision as of 00:47, 22 February 2024

Release Date
Windows: January 1, 0001
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play {InstallDir}\OpenNox\opennox-hd.exe True

Install Script

$Display = Get-PrimaryDisplay
$VirtualStore = "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE"

New-Item -Path "$VirtualStore\WOW6432Node\Westwood\Nox"
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Westwood\Nox" -Name "Name" -Value "Nox" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Westwood\Nox" -Name "InstallPath" -Value "$InstallDirectory\Nox.EXE" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Westwood\Nox" -Name "SKU" -Value 9472 -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Westwood\Nox" -Name "Version" -Value 65538 -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Westwood\Nox" -Name "Serial" -Value "664633-703436-227220-5728" -Force

Rename-Item -Path "$InstallDirectory\MOVIES\INTRO.VQA" -NewName "$InstallDirectory\MOVIES\INTRO.VQA.bak"
Rename-Item -Path "$InstallDirectory\MOVIES\NOXLOGO.VQA" -NewName "$InstallDirectory\MOVIES\NOXLOGO.VQA.bak"
Rename-Item -Path "$InstallDirectory\MOVIES\WWLOGO.VQA" -NewName "$InstallDirectory\MOVIES\WWLOGO.VQA.bak"

$X = $Display.Bounds.Width
$Y = $Display.Bounds.Height

$NoxX = 1024
$NoxY = 768

if (($X / $Y) -eq (16 / 9)) {
    $NoxX = 1024
    $NoxY = 576
} elseif (($X / $Y) -eq (16 / 10)) {
    $NoxX = 1024
    $NoxY = 640
}

Write-ReplaceContentInFile -Pattern '^VideoMode = (.+)' -Substitution "VideoMode = $NoxX $NoxY 16" -FilePath "$InstallDirectory\nox.cfg"
Write-ReplaceContentInFile -Pattern '^VideoMode = (.+)' -Substitution "VideoMode = $NoxX $NoxY 16" -FilePath "$InstallDirectory\default.cfg"

Uninstall Script

$VirtualStore = "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE"
Remove-Item -Path "$VirtualStore\WOW6432Node\Westwood\Nox" -Recurse -Force