wiresock / WireSockUI

GUI to use Wiresock VPN Client in application mode
https://www.wiresock.net/
289 stars 14 forks source link

Run when windows starts option not working #16

Closed mjalq closed 11 months ago

mjalq commented 1 year ago

The app just doesn't start when Windows starts, I suspect that this is caused by the elevated access level (aka Access control prompt) required for the app to run every time.

RileyXX commented 1 year ago

I have the same problem. I was able to solve this using windows task scheduler by setting up a task to run WireSockUI.exe at logon with highest privileges.

I created a guide on reddit which includes the steps I used to set this up in task scheduler. I'll also paste the steps below for future reference.

Setting WireSockUI to Run on Startup using Windows Task Scheduler:

kuitog commented 1 year ago

I found out why: at least in my case updating the settings in the app doesn't modify them in the WireSockUI.exe.config file. So: update them yourself in the config file and let me know.

RileyXX commented 1 year ago

After you run it for the first time I think the config file it uses is generated in %LocalAppData%/WireSockUI. I was curious about this too and ended up finding the config file there.

Did the run on startup setting work for you after making those changes manually?

For me I noticed WireSockUI is in the Windows startup folder. When I go to Task Manager > Startup I see WireSockUI there. So I think op might be right that it is not starting because it needs admin privileges or there may be some other issue.

RileyXX commented 11 months ago

Hi was this issue addressed in the latest release @wiresock?

I am running the latest release WireSockUI-v0.1.9 and wiresock-vpn-client-x64-1.2.32.1 and option for run when windows doesn't appear to be working when ticked.

Only workaround still seems to be setting up a task manually in Windows as stated above.

wiresock commented 11 months ago

@RileyXX, indeed, leveraging the Task Scheduler is currently the only effective method to circumvent UAC restrictions. Integrating this feature directly into the application was quite straightforward. I invite you to review the new build v0.1.10.

mjalq commented 11 months ago

Works perfectly now on v0.1.10. Thanks.

RileyXX commented 11 months ago

Very cool! Thanks for working on this. I can confirm run on startup is working for me on v0.1.10.

However, I did notice one potential issue.

When the task is created the following 2 options are enabled in Task > Conditions:

11-17-2023_498

This would be an issue for anyone running WireSockUI on a laptop. These two options should probably be disabled if possible.

If this setting is not possible to add with the current configuration maybe the following could be useful. Earlier today I was messing with this and I was able to export a task to a .xml file by running schtasks /query /xml /tn "TaskName" > C:\Path\To\ExportedTask.xml in command prompt. Then I was able to import the task using schtasks /create /tn "TaskName" /xml "C:\Path\To\MyTask.xml". So maybe this could be leveraged somehow by having the contents of a default .xml file ready to be imported automatically with the necessary settings. Again, not sure how you have it implemented but just thought this info could be useful in case is not possible to add this setting via the current configuration.

wiresock commented 11 months ago

Thank you for your valuable feedback and for highlighting the issue with power conditions. I'm pleased to inform you that I have addressed this concern in the latest release, WireSockUI v0.1.11. Your insights have been instrumental in improving the application, and I hope the new version enhances your experience with VPN and split tunneling configuration.

RileyXX commented 11 months ago

Can confirm after updating to v0.1.12 and updating/saving the Run when Windows Starts setting the task is created/updated in Windows Task Scheduler with the power settings disabled. All looks good now and functioning perfectly. Nice job! Your hard work is very much appreciated.