$Display = Get-PrimaryDisplay
$AppData = [Environment]::GetFolderPath('ApplicationData')
New-Item -ItemType Directory -Force -Path "$AppData\GOG\WormsForts"
Copy-Item -Path "$InstallDirectory\config.ini" -Destination "$AppData\GOG\WormsForts"
New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\AlexBond"
New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\AlexBond\WFLauncher"
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\AlexBond\WFLauncher" -Name "FScreen" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\AlexBond\WFLauncher" -Name "NoVid" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\AlexBond\WFLauncher" -Name "NoMusic" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\AlexBond\WFLauncher" -Name "Cmdline" -Value "" -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\AlexBond\WFLauncher" -Name "WRes" -Value $Display.Bounds.Width -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\AlexBond\WFLauncher" -Name "HRes" -Value $Display.Bounds.Height -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\AlexBond\WFLauncher" -Name "Fre" -Value 60 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\AlexBond\WFLauncher" -Name "Aspect" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\AlexBond\WFLauncher" -Name "Tweak" -Value ",IconsFix" -Force
$AppData = [Environment]::GetFolderPath('ApplicationData')
Remove-Item "$AppData\GOG\WormsForts" -Recurse -ErrorAction Ignore
Remove-Item -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\AlexBond" -Recurse
$bytes = ConvertTo-StringBytes -Input $NewPlayerAlias -MinLength 15 -MaxLength 15
Edit-PatchBinary -FilePath "$InstallDirectory\data\SaveGame.xom" -Offset 0x114A -Data $bytes