Skip to content

Commit

Permalink
Create Optimize-Epicgames.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
MR-PIxelzen committed Aug 8, 2024
1 parent 3422af0 commit 0a52617
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions modules/Game & Program tuners/Optimize-Epicgames.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Path to the .ini file
$iniFilePath = "$env:LocalAppData\EpicGamesLauncher\Saved\Config\Windows\GameUserSettings.ini"


Stop-Process -Name "Epic*" -Force
# Define the replacements
$replacements = @{
"DisableGameTabs=\w+" = "DisableGameTabs=False"
"NotificationsEnabled_Adverts=\w+" = "NotificationsEnabled_Adverts=False"
"NotificationsEnabled_FreeGame=\w+" = "NotificationsEnabled_FreeGame=False"
"MinimiseToSystemTray=\w+" = "MinimiseToSystemTray=False"
"OfflineMode=\w+" = "OfflineMode=False"
"Allow_InstallsWhileEditorsRunning=\w+" = "Allow_InstallsWhileEditorsRunning=False"
"LastActiveTab=\w+" = "LastActiveTab="
"DownloadRateLimitEnabled=\w+" = "DownloadRateLimitEnabled=False"
"CloudSaveEnabled=\w+" = "CloudSaveEnabled=False"
#CloudSaveEnabled=True
#DownloadRateLimitEnabled=False



#MinimiseToSystemTray=True
#Allow_InstallsWhileEditorsRunning=False

#OfflineMode=False
}

# Read the content of the .ini file
$iniContent = Get-Content -Path $iniFilePath -Raw

# Perform the replacements
foreach ($pattern in $replacements.Keys) {
$replacement = $replacements[$pattern]
$iniContent = $iniContent -replace $pattern, $replacement
}

# Write the updated content back to the .ini file
$iniContent | Out-File -Encoding Default -FilePath $iniFilePath

# Echo the changes
$updatedContent = Get-Content -Path $iniFilePath
foreach ($key in $replacements.Keys) {
$replacement = $replacements[$key]
$updatedLine = $updatedContent | Select-String -Pattern $replacement
if ($updatedLine) {
Write-Host $updatedLine
}
}

Write-Host "The specified keys have been updated to 'True' in '$iniFilePath'."

0 comments on commit 0a52617

Please sign in to comment.