dignifiedweb / OculusHomeIconChanger

Edit Icons for Third Party apps listed in Oculus Home - time saving 1-click button to grab steam banners
9 stars 1 forks source link

json Generator #1

Closed BzowK closed 4 years ago

BzowK commented 5 years ago

Hey -

Wasn't sure how to reach you other than this so sorry for opening an Issue, but wanted to run something by you. I still use OculusHomeIconChanger to this day (and appreciate it very much). I mostly use it to customize many 3rd party titles for Oculus. Prior to being able to do this, though; one must launch the title with Oculus open so that it writes the pair of jsons and creates the assets folder.

I'm considering creating scripting which would allow adding titles without having to launch in Oculus first. Here's the overview of the process:

  1. Select / designate file used to launch title
  2. Script creates the json, assets.json, & assets folder in the appropriate paths on C:\ whose filesnames and contents are populated based on the referenced file
  3. Launch IconChanger then customize images and such (More detail below)

Thought I'd send you a note to see if first, you may…

I'm no programmer, but do my fair share of PowerShell so up to you if interested. Below is the full detail of what the script should do in more detail if interested. Hopefully, there isn't anything missing I do not know about. Let me know what you think. Thanks

Script Example Input:

Scripted Example Actions:

  1. Convert path of selection replacing backslashes with underscores

  2. Create json file with the filename in format: E_Games_Portable_GameName_StartGame.json

  3. Populate json contents in single line matching below with following notes: {"canonicalName":"E_Games_Portable_GameName_StartGame","displayName":"Game Name","files":{"E:\\Games\\Portable\\GameName\\StartGame.exe":""},"firewallExceptionsRequired":false,"isCore":false,"launchFile":"E:\\Games\\Portable\\GameName\\StartGame.exe"","launchParameters":" ","manifestVersion":0,"packageType":"APP","thirdParty":true,"version":"1","versionCode":1}

  1. Create assets.json in format: E_Games_Portable_GameName_StartGame_assets.json

  2. Populate json contents matching content at end with following notes:

{ "dominantColor": "#2B2A20", "files": { "original.jpg": "18cad52c01fcb6af3fb52118b104559c10870566a56e91b0d6b3d25a1be327ed", "cover_square_image.jpg": "67a393f120bbaa2b2f63059cbca70e799c98157956242de82311b4eb156bfa01", "icon_image.jpg": "9fc14fb1a40e3f67a46c59bc73dd9eb2d1f34f7e0bf5c33d512366831715764b", "cover_landscape_image.jpg": "0673affdf7533917554c7eaa4400ffe094fa5a06e9fcaf80ae639e5e6c0a129d", "cover_landscape_image_large.png": "5c8f113cd464015095d407681340abec6f1511e80c283e1a4ba0f2774efa170f", "small_landscape_image.jpg": "3e31855aebdd0b21b0dda30c6f962cd7db33cfffed41e2e05212f04229ff38ed", "logo_transparent_image.png": "7f9bbea0e9512699ac852794ec430108597554c8e74d01558b12a5dc5c72ab3b" }, "packageType": "ASSET_BUNDLE", "isCore": false, "appId": null, "canonicalName": "E_Games_Portable_GameName_StartGame_assets", "launchFile": null, "launchParameters": null, "launchFile2D": null, "launchParameters2D": null, "version": "1562695348", "versionCode": 1562695348, "redistributables": null, "firewallExceptionsRequired": false, "thirdParty": true, "manifestVersion": 0 }

  1. Create StoreAssets Folder

Any thoughts? Thanks

dignifiedweb commented 5 years ago

Hi, that's a cool idea! Glad to know you still use this tool, I still use from time to time bit haven't been using my rift much since buying quest.

So, I think that oculus trat tool has a feature to add apps? I could be wrong on that.

However, is creating a custom app as "easy" as you describe? In the past, the scripts I had seen needed a sacrifice app, but it sounds like that's no longer the case?

I'd be willing to add the changes possibility, if it's that easy, I could add that this weekend most likely. I'd have to get my oculus all setup again so it would depend if I can do that since I had to reconfigure my room for Reno's and had to take the sensors down from the wall. So, pending I get free time I'll do some playing around. I dont mind this being submitted as an issue, its nice knowing you still use the app. I think I remember talking with you on reddit.

BzowK commented 5 years ago

Hey! Yeah, I use it almost daily. You're lucky to have a quest. We are adopting a 2nd child, so have almost no budget for new toys nowadays...

Anyways, I just wrote & successfully tested a PowerShell script which basically allows one to select an installed EXE then using included template files creates a custom json, assets.json, and assets folder with sample images, configures them based on variables set from the selected file, then moves them into the correct folders. Besides browsing for the file, you are also prompted with the following questions during the script:

You are more than welcome to integrate any/all of it if desired, give suggestions, or do nothing - just thought you'd be interested.

Attached is a zip which includes the following:

AddtoOculus.zip

Let me know your thoughts - Thanks!

dignifiedweb commented 5 years ago

Hey,

That's super cool! Sorry I've been not working on this at all for you. I am definitely fortunate to be able to have an Oculus Quest, but any kind of luxury gadget isn't everything int he world. family is always first. I respect that. I also respect the hard work you put into this. I had a look at your code, it looks very solid. Unfortunately, I wasn't able to get it working as of yet. I will have to make a couple tweaks to ensure relative paths work running as administrator (that's what seems to be problem), but would it be ok to include this powershell on my Github and leave your comments in tact stating you're the author, etc? I'd obviously mention you wherever else you'd like. I figure, I can just put an add new button and call it from OHIC, then if you want to tinker with your powershell, you can just change that without re-compiling my EXE?

BzowK commented 5 years ago

Hey -

No worries - Sorry it hasn't worked for you yet. I've used it 2-3 times successfully so far but sure you can figure it out. You are more than welcome to tweak it, post it, or do whatever you want with it. The next time i work on it, I'll edit the posted copy if you add it.

Thanks!

BzowK commented 5 years ago

Hey -

Got a new version of the script if you want to give it a shot. Didn't see anything posted yet, so noting here. Below is a changelog plus the link...

Changelog

AddtoOculus(0.2).ps1.txt (Had to rename to *.txt to post so just rename and remove it once downloaded obviously)

Let me know what you think - Thanks

P.S.: Missed your comment about adding it in OHIC as button until now which is a great idea. Not sure how I'd do so without recompiling as never really worked with C# before. You using Visual Studio or something? Once I find out, I'll install and give it a shot. Thanks

dignifiedweb commented 5 years ago

Hi, I did a lot of work this weekend on integrating your powershell into OHIC. I had to add a few things to make sure it can integrate. AddtoOculus0.3.txt

I am hoping that tomorrow night I can finish the integration on the app. Lots is done already, just need to have it refresh the app list without having to re-launch OHIC.

BzowK commented 4 years ago

Awesome - looks great!

To note, I found that after using the script (via IDE), rerunning it to add a 2nd would result in the file browser not being displayed. I added the line: $FileBrowser = "" at the beginning to have it clear out the $FileBrowser variable before starting which seemed to rectify the issue. If you are integrating it where each execution is within its own session, it shouldn't be an issue, though.

Other than that, it's worked great for me except for one smaller thing where the dialogs prompting Yes/No don't always appear on top of all other windows. You're integration may not require them, but wanted to bring up anyways. I can fix that if needed.

Let me know if you need anything - Thanks

dignifiedweb commented 4 years ago

Hi there, finished my changes and added a release. I hope it's ok I put your name in the releae notes. Do you want me to make you a contributor for this app? Welcome to be a contributor if you like. Also, can I close this issue you think? Let me know what you think.

One Note: I had to keep the powershell window open when the script was executing, otherwise the popup messages all hid behind OHIC, which was not ideal. I suppose we could do some fancy toggling behind the scenes, but it would have to be from powershell, which I didn't think would be ideal and potentially error prone. The U.I. elements need a child U.I. to fallback to, so when the Powershell window is still up, it keeps them all in focus. Frankly, I am used to it now and it doesn't bother me i the slightest. Your powershell is called direct, so this way you can still tinker without re-compile. Hope that's to your liking!

There's also a bug if you re-add an app, it adds 2 listings in OHIC durng runtime. I dunno if there's an easy way to fix this other than to put in some checks in my code to replace rather than duplicate.

BzowK commented 4 years ago

Morning -

Great! I'll give it a shot later today. That would be great to be a contributor if ok with you. How would you prefer I send you messages if closing the issue? Happy to send you my email if you want. Finally, thought of a few ideas to implement that I wanted to get your opinions on...

  1. title-Win64-Shipping.exe - Some titles should not have the EXE in their root selected, but the title-Win64-Shipping.exe within "._title_\Binaries\Win64\" if it exists. Haven't tested to see if still works using root EXE, so if it works can probably disregard. If not, may add scripting to look for that path and select that EXE if found or at very least some kind of message to look for and select it

  2. Revive - I use Revive only for a couple of titles. Thinking of adding scripting which prompts user if they wish to use Revive with it

  3. Custom Launch Parameters - Although rare, some titles require or can use alternate EXE parameters. Considering changing "Is this a Steam Game" question to something like "Add Custom Parameters?" providing the following choices

    • No
    • Yes (Steam Default of '-vrmode oculus')
    • Yes (Custom) If the last one is selected, they would be prompted to type the desired parameters
  4. UI Consolidation - Instead of having multiple pop-ups (one per question), I played around with PowerShell Studio last night in an attempt to make a single dialog / form window appear upon execution which includes the Browse button plus each question which can be answered using radio buttons or dropdown lists.

What do you think? Let you know how testing goes later on. Thanks!

dignifiedweb commented 4 years ago

Hey,

I love all of your ideas you mentioned. Especially the UI Consolidation, I could maybe help you with that, I think it would allow me to hide the powershell window because it would only be 1 UI popup.

For contact, do you want to e-mail me jon [ at ] dignifiedweb [d o t ] com?

I'll try to add you as a contributor and resolve this issue. Thanks for all the hard work! Hope you like my additions.

Jon

dignifiedweb commented 4 years ago

Hi Ben,

I tried replying to your e-mail, I got a bounce back though.

Jon

BzowK commented 4 years ago

Hey - Sorry - Let domain expire. Should be good to go now, though.