elvissteinjr / DesktopPlus

Advanced desktop access for OpenVR
GNU General Public License v3.0
462 stars 29 forks source link

Desktop+ not starting in elevated #9

Closed JoeMarley closed 3 years ago

JoeMarley commented 3 years ago

Desktop+ won't start in elevated mode even though I ran the elevated bat file. It does open on non-elevated mode but whenever I go into settings and try and hit the "restart in elevated mode" button, nothing actually happens.

elvissteinjr commented 3 years ago

Does anything look odd about the task "DesktopPlus Elevated" in the task scheduler (should be present since the restart button is there)? Does launching the scheduled task manually do anything?

Have you used Desktop+ before, perhaps under a different path, or moved the files after setting up the elevated task for the first time? The bat file for setting up the scheduled task currently does not override anything if the task is already present in some way. That's admittedly something I still wanted to fix on the side before next release but haven't gotten to yet. Edit: It actually does that just fine and always has. Oops.

JoeMarley commented 3 years ago

I'm assuming it would show up in the program "task scheduler" by what you said but nothing seems to be appearing when launching the Desktop+.exe. I have used Desktop+ before but it was an older version so I deleted all those files and replaced them with the new release. Also, I don't know if this should happen but when I launch the bat file it launches the PowerShell script but then a second later closes. From the previous version I had installed, I would get some sort of confirmation that it successfully created the task. This could just be with the previous version but I wouldn't know.

elvissteinjr commented 3 years ago

Sounds a bit like the Powershell execution policy might be getting in the way (odd that it worked last time then, though). This was addressed last month, but there hasn't been a new release yet.

Can you try after replacing the bat file with the newest version and run that?

And what I meant with the Task Scheduler was to check the program launch command for Desktop+'s task in there. I'm guessing it might have an old path set there since replacing it seems to have failed.

JoeMarley commented 3 years ago

That finally fixed it, pretty sure it was an older file path. Thanks for the help. One suggestion that I think could be nice is to have another PowerShell script that could delete the task? this may not even be necessary or even plausible but I think it would be nice to have incase something were to go wrong