• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FI 2.5.1 windows problem
#1
H_i 
,
I've one problem on a client running FI 2.5.1 on windows 10 1809.

I'm able to install the client but the agent dont sent any data to the server. 

If I manually run fusinintentory-agent.bat --dubug in a command prompt in admin mode I got:

C:\Program Files\FusionInventory-Agent\perl\bin>perl fusioninventory-agent --debug

Invalid string: [\xEF\xBF\xBD\xEF\xBF\xBD] before < ? x m l   v e r s i o n = " 1 . 0 "   e n c o d i n g = " u t f - 1 6 "   s t a n d a l o n e = " y e s " ? > at C:\Program Files\FusionInventory-Agent/perl/agent/FusionInventory/Agent/Task/Inventory/Win32/Softwares.pm line 478.

I've already reinstalled the sagent several tima and lowered the uac to the minimum level.

L.
  Reply
#2
Hi Lupick,

this seems to be a bug in our _getAppxPackages API which retrieves UWP/windows Store installed packages.

We apparently tries to read an appxmanifest.xml file encoded in UTF-16 and this fails while we tries to parse it on a stange first line.

We need this file to find how to by-pass this issue.

You should run the same Powershell script than the one run by the agent in an administrative shell:
Code:
[Windows.Management.Deployment.PackageManager,Windows.Management.Deployment,ContentType=WindowsRuntime] >$null

$packages = New-Object Windows.Management.Deployment.PackageManager

foreach ( $package in $packages.FindPackages() )
{
    # Check install state for each user and break if an installation is found
    $state = "Installed"
    foreach ( $user in $packages.FindUsers($package.Id.FullName) )
    {
        $state = $user.InstallState
        if ($user.InstallState -Like "Installed") {
            break
            $p = $packages.FindPackageForUser($user.UserSecurityId, $package.Id.FullName)
            if ($p.InstalledLocation.DateCreated -NotLike "") {
                $installedDate = $p.InstalledLocation.DateCreated
                break
            }
        }
    }
    if ($state -NotLike "Installed") { continue }

    # Use installeddate if found otherwise use installation folder creation date
    $installedDate = ""
    if ($package.InstalledDate -NotLike "") {
        $installedDate = $package.InstalledDate
    } elseif ($package.InstalledLocation.DateCreated -NotLike "") {
        $installedDate = $package.InstalledLocation.DateCreated
    }

    Write-host "NAME: $($package.Id.Name)"
    Write-host "PACKAGE: $($package.Id.FullName)"
    Write-host "ARCH: $($package.Id.Architecture.ToString().ToLowerInvariant())"
    Write-host "VERSION: $($package.Id.Version.Major).$($package.Id.Version.Minor).$($package.Id.Version.Build).$($package.Id.Version.Revision)"
    Write-host "FOLDER: $($package.InstalledLocation.Path)"
    if ($installedDate -NotLike "") {
        Write-host "INSTALLDATE: $($installedDate)"
    }
    Write-host "PUBLISHER: $($package.Id.Publisher)"
    Write-host "PUBLISHERID: $($package.Id.PublisherId)"
    Write-host "SYSTEM_CATEGORY: $($package.SignatureKind.ToString().ToLowerInvariant())"
    Write-Host
}

This will give you an output with some "Folder: xxx" entries. You need then to check any "appxmanifest.xml" file found on these paths. And then you should attach here the one starting with the text shown by the reported error.

If the related package is not used, you can firstly remove it to fix your problem. But we definitively need it to fix the issue in our code.
  Reply
#3
(2019-09-26, 12:41:08)gbougard Wrote: Hi Lupick,

this seems to be a bug in our _getAppxPackages API which retrieves UWP/windows Store installed packages....
 The client is a windows 10 LTSB and it doesnt have the UWP/store. I'll try to run the powershell and reprot the result.
  Reply
#4
I was able to run the script in powershell - admin mode and I got all installed app:

E.g

NAME: Microsoft.Todos
PACKAGE: Microsoft.Todos_2.1.22622.0_x64__8wekyb3d8bbwe
ARCH: x64
VERSION: 2.1.22622.0
FOLDER: C:\Program Files\WindowsApps\Microsoft.Todos_2.1.22622.0_x64__8wekyb3d8bbwe
INSTALLDATE: 09/26/2019 14:38:37 +02:00
PUBLISHER: CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
PUBLISHERID: 8wekyb3d8bbwe
SYSTEM_CATEGORY: store

NAME: Microsoft.Windows.Photos
PACKAGE: Microsoft.Windows.Photos_2019.19071.17920.0_x64__8wekyb3d8bbwe
ARCH: x64
VERSION: 2019.19071.17920.0
FOLDER: C:\Program Files\WindowsApps\Microsoft.Windows.Photos_2019.19071.17920.0_x64__8wekyb3d8bbwe
INSTALLDATE: 09/27/2019 07:52:44 +02:00
PUBLISHER: CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
PUBLISHERID: 8wekyb3d8bbwe
SYSTEM_CATEGORY: store

How I can redirect the output to a file?
  Reply
#5
Did you try to add the ">appx-list.txt" syntax at the end of the command launching the script ?

Btw, you should check for all appxmanifest.xml files in "C:\Program Files\WindowsApps" sub-folders which start by "<?xml version="1.0" encoding="utf-16" standalone="yes"?>". If you can attach one here, I'll be able to analyse how to handle it nicely in the code.
  Reply
#6
(2019-10-01, 07:47:11)gbougard Wrote: Did you try to add the ">appx-list.txt" syntax at the end of the command launching the script ?

Btw, you should check for all appxmanifest.xml files in "C:\Program Files\WindowsApps" sub-folders which start by "<?xml version="1.0" encoding="utf-16" standalone="yes"?>". If you can attach one here, I'll be able to analyse how to handle it nicely in the code.

I've already tried to run .\test.ps1 > test.txt 

the file is created empty (and the output is on the screen).

I've also trried 
.\test.ps1 2>&1> test.txt with the same problem
  Reply
#7
Then try:
Code:
.\test.ps1 > test.txt 2>&1
The redirections order is important.
  Reply
#8
(2019-10-03, 08:01:17)gbougard Wrote: Then try:
Code:
.\test.ps1 > test.txt 2>&1
The redirections order is important.
Unfortunally I got the same result:

 .\test.ps1 > test.txt 2>&1


but test.txt is still empty
  Reply
#9
Re-try after reading this powershell doc about redirection.
  Reply
#10
(2019-10-07, 13:25:20)gbougard Wrote: Re-try after reading this powershell doc about redirection.

Redirection problem solved 
test.ps1 *> test.txt 

did the trick

please take a look to the attached file.


Attached Files
.txt   test.txt (Size: 116.97 KB / Downloads: 2)
  Reply
#11
Your file is in UTF-16, this is not a problem as I manage to read it. But this suggests me maybe your computer has some language configuration involving some system files are encoded in UTF-16. What is your language configuration on the system ?

Can you check for "appxmanifest.xml" files under the FOLDERs reported in test.txt file ? Are they mostly in UTF-16 ? Can you attach one here so I can use it as test ?
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)