Advanced Launcher - Add PC Games Automation
#11
The script copies the first PC game it can find, then clears all of the fields out and uses this as a template.
powershell:
$NewNode = $xml.advanced_launcher.launchers.launcher.CloneNode($true)

The problem with this
- assumes you have an existing PC Games library (you might not)
- assumes you have at least 1 game in the library to copy/clone (you might have the library created without any games added to it)
- if you have more than 1 game the above command will return an array, preventing the command from working

powershell:
if(more than 1 game){
     #select the first game in the array
     $NewNode = $xml.advanced_launcher.launchers.launcher[0].CloneNode($true)
}else{
     $NewNode = $xml.advanced_launcher.launchers.launcher.CloneNode($true)
}

I think the better way to go is NOT to clone the first game because actually having a game becomes a requirement (not a huge deal tho). Using powershell to create the tree structure from scratch removes this pre-requisite, but I do not know how to do it. Anyone using this script will have to have 1 single game manually added to the PC Games section in order for the script to work as shown.

when I figure this out I will update the script.
Reply


Messages In This Thread
RE: Advanced Launcher - Add PC Games Automation - by smaka510 - 2019-10-30, 20:49
Logout Mark Read Team Forum Stats Members Help
Advanced Launcher - Add PC Games Automation0