Skip to content

Instantly share code, notes, and snippets.

@arinoki
Created September 6, 2020 15:59
Show Gist options
  • Save arinoki/3c00ac0f62ade1f54d75f57c4f73c9cb to your computer and use it in GitHub Desktop.
Save arinoki/3c00ac0f62ade1f54d75f57c4f73c9cb to your computer and use it in GitHub Desktop.
Just inctruction how to make shortcut to any app (but for example i will use King's Raid game).
First - create text file with extension "ps1" - so for example "KingsRaid.ps1" with this text. Make sure to change path on first line
so it will point to the folder where ur LDPlayer installed. And, if for some reason u wanna use it for second, third, etc copy of LDPlayer u just need to change "index" to correct one. In coding first number is 0, so second - 1, and so on - keep it in mind.
cd 'C:\Games\LDPlayer_v3'
.\ldconsole.exe launch --index 0
while(!((.\ldconsole.exe isrunning --index 0) | Select-String "running")) {start-sleep 2}
.\ldconsole.exe runapp --index 0 --packagename com.vespainteractive.KingsRaid
Next one - make shortcut for this ps1 file to ur desktop - its needed to set up icon file for it ( https://i.imgur.com/1vbR35e.png ).
And here icon file i use for it - https://github.com/arinoki/MiscFiles/blob/master/kingsraid.ico
Next one to make things easier - we wanna make ps1 files be runned by double-click, as usual software. To make this - we need to make some
changes to windows registry.
U can make it by ur own, i will show how, or download and apply reg-file (ez way).
So first option - manual. Open regedit (start menu - type regedit - and open it). Now we need this section - "HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command" (u can copy to address bar there - https://i.imgur.com/Db0OpR7.png )
And now we need to change key value of key here to this - "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -noLogo -ExecutionPolicy unrestricted -file "%1"
So it will looks like this - https://i.imgur.com/IuiHHNW.png
And second option - auto. Just download reg file and apply - https://github.com/arinoki/MiscFiles/blob/master/ps1_doubleclick.reg
Thats all, folks. With this script LDPlayer will launch specified app just after start. Quite useful.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment