Myuuiii / DAWPresence

A Discord Rich Presence app for several DAWs like FL Studio and Ableton
GNU General Public License v3.0
38 stars 2 forks source link

Setting up background service #3

Closed jojo2357 closed 1 year ago

jojo2357 commented 1 year ago

Disclaimers

I noticed that in your readme you want to create a background service (presumably to run the DRP provider). I solved this problem mostly, see this linker which will find the location of the exe to link to (in this case it will ask the user to open it to see where the open came from) and then will use Task Scheduler to run the DRP when the target exe runs, and can also close the DRP when the target exe closes.

Unfortunately I do not have a MWE and it is not very generalized, but hopefully it can at least provide a starting place.

Best of luck, if you have questions feel free to ask

Myuuiii commented 1 year ago

Heyaa,

Thank you for leaving this issue! I took a quick look at the linked item. It does what I'd want it to do but I am not so much a fan of a batch script for installing. I will be looking into creating an actual installer with someone later on but currently am not able to due to a busy schedule.

I could look into adding a script like yours to the repo temporarily and later replace it with an installer.

jojo2357 commented 1 year ago

Well the beauty of it is that it is really small, so your exe could echo the code into a temp bat script, and run it so the user doesnt even have to know, especially since a bat is super small. It does unfortunately require admin permissions and i am unsure how to not need admin so maybe this isnt the solution for you.

Myuuiii commented 1 year ago

Since you are doing an administrative action in your script you can't really get around the UAC prompt. I get what you mean with writing away the script to a temp file and then running it but this seems very unnecessary. The contents for that batch script can be altered and then run from within the code. "... and run it so the user doesnt even have to know" doesn't really sit right with me xD

jojo2357 commented 1 year ago

Just a suggestion, best of luck to ya