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]: Symlink to logfile no longer gets created #556

Closed
s016aq opened this issue Jan 29, 2024 · 6 comments
Closed

[Bug]: Symlink to logfile no longer gets created #556

s016aq opened this issue Jan 29, 2024 · 6 comments
Labels
bug Something isn't working stale

Comments

@s016aq
Copy link

s016aq commented Jan 29, 2024

The problem

I noticed that the symlink to the logfile is not being created during install any more (from version 1.18.0?)
Instead it's being created when the scheduled task is triggered (Winget-Upgrade.ps1)
But it is not created!
If I run Winget-Upgrade.ps1 from Powershell_ise (as SYSTEM) it works. But not with the Scheduled task.
If I remove ServiceUI.exe it works. So it has something to do with the script is spawned again with ServiceUI

What version of WAU has the issue?

from 1.18.0

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

Windows 11 23H2

What version of winget are you using?

1.6.3482

Log information

No response

Additional information

No response

@s016aq s016aq added the bug Something isn't working label Jan 29, 2024
@AndrewDemski-ad-gmail-com
Copy link
Contributor

The existing logic expects to have full folder tree up to \Logs\WAU-update.log
if that folder structure is missing, then symlink is not created.
Was the folder present before WAU got installed?

# Check if Intune Management Extension Logs folder and WAU-install.log exists, make symlink
if ((Test-Path -Path "${env:ProgramData}\Microsoft\IntuneManagementExtension\Logs" -ErrorAction SilentlyContinue) -and (Test-Path -Path ('{0}\logs\install.log' -f $WorkingDir) -ErrorAction SilentlyContinue) -and !(Test-Path -Path "${env:ProgramData}\Microsoft\IntuneManagementExtension\Logs\WAU-install.log" -ErrorAction SilentlyContinue)) {
Write-ToLog "-> Creating SymLink for log file (WAU-install) in Intune Management Extension log folder" "yellow"
$null = (New-Item -Path "${env:ProgramData}\Microsoft\IntuneManagementExtension\Logs\WAU-install.log" -ItemType SymbolicLink -Value ('{0}\logs\install.log' -f $WorkingDir) -Force -Confirm:$False -ErrorAction SilentlyContinue)
}

#Adds SymLink if Intune managed
$IntuneLogPath = "${env:ProgramData}\Microsoft\IntuneManagementExtension\Logs"
if ((Test-Path "$IntuneLogPath") -and !(Test-Path "$IntuneLogPath\WAU-updates.log")) {
Write-ToLog "Creating SymLink for log file (WAU-updates) in Intune Management Extension log folder" "Yellow"
New-Item -Path "$IntuneLogPath\WAU-updates.log" -ItemType SymbolicLink -Value $LogFile -Force -ErrorAction SilentlyContinue | Out-Null
}

@KnifMelti
Copy link
Contributor

Yes, full path present.
It's exactly as @s016aq describes it.

@Romanitho
Copy link
Owner

Maybe we should change the way we create the Symlink?
During the installation of WAU? Let's create an empty WAU-updates.log if it doesn't exist, and create the symlink at this moment. This way, context should be admin account OR system (without serviceui.exe) and should success.

@AndrewDemski-ad-gmail-com
Copy link
Contributor

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 Mar 30, 2024
Copy link
Contributor

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 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

4 participants