dlebansais/Kill-Update

Failed to auto start after reboot

dapovoa opened this issue · 8 comments

Although the application creates the rule in task manager, fails to start after reboot. So, the issue described here persists.

Your task manager values
<?xml version="1.0" encoding="UTF-16"?> <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> <RegistrationInfo> <Date>2021-06-20T23:37:06.289+01:00</Date> <URI>\Kill-Update</URI> </RegistrationInfo> <Triggers> <LogonTrigger> <Enabled>true</Enabled> </LogonTrigger> </Triggers> <Principals> <Principal id="Author"> <UserId>S-1-5-21-664287892-1491684111-3455746848-1001</UserId> <LogonType>InteractiveToken</LogonType> <RunLevel>HighestAvailable</RunLevel> </Principal> </Principals> <Settings> <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> <AllowHardTerminate>true</AllowHardTerminate> <StartWhenAvailable>false</StartWhenAvailable> <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> <IdleSettings> <Duration>PT10M</Duration> <WaitTimeout>PT1H</WaitTimeout> <StopOnIdleEnd>true</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <AllowStartOnDemand>true</AllowStartOnDemand> <Enabled>true</Enabled> <Hidden>false</Hidden> <RunOnlyIfIdle>false</RunOnlyIfIdle> <WakeToRun>false</WakeToRun> <ExecutionTimeLimit>PT72H</ExecutionTimeLimit> <Priority>7</Priority> </Settings> <Actions Context="Author"> <Exec> <Command>C:\Users\%username%\Desktop\Kill-Update.exe</Command> </Exec> </Actions> </Task>

I have removed your task and add my own. After, the problem was solved!

schtasks /create /f /tn RunKillUpdate /tr "C:\Users\%username%\Desktop\Kill-Update.exe" /ru %username% /sc onlogon

I think I've reproduced your problem, so I'll try to find a fix.

But really this is a minor issue. The program should be started as administrator (it will be, upon reboot, anyway), and then this problem doesn't happen (I think).

My UAC is disable, and I didn't test your aplication to see if it requests or not the admin privileges.
My Windows (version 21H1) is on 24/7 and it can't be reboot in any way. So, in case of maintenance or power issue that's really necessary.

Anyway, thanks for the amazing application!

Just adding a comment to the issue: the application has to be run with administrator privileges, otherwise it just doesn't work. This can be done either with "Run as administrator", or by adding the task and logging out then in, like you probably did. In my case, typically with a restart.

Normally you should add a request for administrator privileges in the app, but I'm not an expert...

Correct, that's the recommended way of doing it. But if I did that, people would have to click on that Yes button all the time. With my approach, they know exactly what's going on, and add the task themselves. It's a bit sneaky, because in the end the app gets admin privileges. But don't get me started on Windows security.

With UAC enabled (for most users) you have to select YES

So I don't see your point there...