Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: WAUv2 installer not creating scheduled tasks if installed under SYSTEM user #734

Open
newmrac opened this issue Oct 10, 2024 · 10 comments
Labels
bug Something isn't working stale

Comments

@newmrac
Copy link

newmrac commented Oct 10, 2024

The problem

Hi.
To mass deploy WAU on user's computer I use a remote management tool that executes cmd commands under NT Authority\SYSTEM account on remote computers (ESET Agent cmd command).
No issues with deploying WAUv1.
After changing the installer to MSI-based, I found an issue: the installer doesn't create Scheduled tasks (and without them, WAU don't start even with a manual start).
My simple script to install (and uninstall v1):

powershell.exe -noprofile -executionpolicy bypass -file "C:\ProgramData\Winget-AutoUpdate\WAU-Uninstall.ps1"
cd c:\windows\temp
del WAU.msi /F
c:\windows\system32\taskkill.exe /im curl* /f
C:\windows\System32\curl.exe https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v2.0.0/WAU.msi -o WAU.msi -H "Connection: close" -L 
if not exist WAU.msi goto End
msiexec /i WAU.msi /qn LISTPATH=GPO USERCONTEXT=1 DESKTOPSHORTCUT=0 STARTMENUSHORTCUT=1 UPDATESINTERVAL=Weekly UPDATESATTIME='06:00:00'
:End
del c:\windows\temp\WAU.msi /F

If command
msiexec /i WAU.msi /qn
started under regular users, scheduled tasks are created normally.
If started under SYSTEM account, installation finishing without creating of scheduled tasks.

What version of WAU has the issue?

WAU 2.0.0

What version of Windows are you using (ex. Windows 11 22H2)?

Windows 11 24H2

What version of winget are you using?

1.8.1911

Log information

No response

Additional information

How to reproduce easily:

  1. Download Sysinternals Pstools, unpack.
  2. run psexec to switch to SYSTEM user: in terminal use: .\PsExec64.exe /s /i cmd
  3. In the new terminal window check current user by command: whoami. It should be nt authority\system
  4. From this terminal start silent installation of WAUv2: msiexec /i WAU.msi /qn
  5. As a result: WAUv2 was installed, scheduled tasks are absent, WAUv2 is completely broken.
@newmrac newmrac added the bug Something isn't working label Oct 10, 2024
@Romanitho
Copy link
Owner

Strange. WAU self-update updates WAU under the system context. No issues so far. I also use SCCM and Intune to push the MSI version with system context. No issues either.

@KnifMelti
Copy link
Contributor

KnifMelti commented Oct 11, 2024

The culprit here is UPDATESATTIME='06:00:00'
Either without single qoutes or with double qoutes will make it work as intended.

Tested as SYSTEM, no problem here.

EDIT: When testing your original single qoutes string as SYSTEM the tasks failed in creation it's a CMD thing

@newmrac
Copy link
Author

newmrac commented Oct 11, 2024

Yes, you are right. Double quotes/removing parameters fixes installation. I tested without any parameters and with them, but it didn't work. And now it is working. It's really strange. Thank you for fast help!

@Romanitho
Copy link
Owner

Romanitho commented Oct 11, 2024

You can even remove it since "6am" is the default value.
Thanks, @KnifMelti, for spotting that.

@newmrac
Copy link
Author

newmrac commented Oct 11, 2024

You can even remove it since "6am" is the default value. Thanks, @KnifMelti, for spotting that.

I used exactly setting of 06:00:00 instead of 6am, because of the bug with time format in version 1. It was ignored: #583

@Romanitho
Copy link
Owner

Oh I see. Still not fixed? I'll have to check that.

@ITistheworst
Copy link

Seem to be getting the same issue here, deployed via intune from a win32app with the following install command

msiexec /i "WAU.msi" /qn RUN_WAU=NO DISABLEWAUAUTOUPDATE=0 USEWHITELIST=1 USERCONTEXT=1 BYPASSLISTFORUSERS=0 DESKTOPSHORTCUT=0 STARTMENUSHORTCUT=0 NOTIFICATIONLEVEL=Full UPDATESATLOGON=1 UPDATESINTERVAL=Never DONOTRUNONMETERED=0

No scheduled tasks seem to get configured on the deployed machines.

@AndrewDemski-ad-gmail-com
Copy link
Contributor

AndrewDemski-ad-gmail-com commented Oct 16, 2024

Hi,
I managed to recreate the problem if WAU_UpdatesAtTime value in HKEY_LOCAL_MACHINE\SOFTWARE\Romanitho\Winget-AutoUpdate was left from previous attempt to install from WAU.msi with UPDATESATTIME='06:00:00' commandline argument.

In such condition, playing rounds with commandline (changing to double quotes etc) did not help at all.
Shouldn't wrapper/MSI be dropping the reg key in HKLM during installation?
Just to be sure that we start from clean slate?

@Romanitho
Copy link
Owner

Romanitho commented Oct 16, 2024

We wanted to migrate the settings how much as possible.

Should be ok for next releases: #740

Copy link
Contributor

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

5 participants