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

Copyright is placed into License Field #248

Closed
Trenly opened this issue Apr 2, 2022 · 0 comments · Fixed by #258
Closed

Copyright is placed into License Field #248

Trenly opened this issue Apr 2, 2022 · 0 comments · Fixed by #258

Comments

@Trenly
Copy link
Contributor

Trenly commented Apr 2, 2022

Brief description of your issue

When metadata for a package is being added, the information from the 'Copyright' field is being populated into the license. However, a copyright is not a license for use, and this information should be put into the Copyright key of the manifest instead. Many users submitting packages to the community repository have simply accepted the suggested value by wingetcreate rather than modifying it to be the actual license.

Unless the license can be definitively determined, it should be left for the user to populate.

Steps to reproduce

Run wingetcreate new http://anywhere.webrootcloudav.com/zerol/wsasme.exe and enter all the way through to the "License" metadata section; Note - this package already exists in the community repo, but I'm using it for the purposes of recreating the issue.

See File Metadata
PS D:\Git\winget-pkgs> Get-ItemMetadata D:\Users\Trenly\Downloads\Temp\wsasme.exe

Name                           Value
----                           -----
Name                           wsasme.exe
Size                           5.25 MB
ItemType                       Application
DateModified                   4/1/2022 10:52 PM
DateCreated                    4/1/2022 10:52 PM
DateAccessed                   4/1/2022 10:52 PM
PerceivedType                  Application
Owner                          <COMPUTERNAME>\Trenly
Kind                           Program
Rating                         Unrated
Copyright                      (c) Webroot 2006-2021
Company                        Webroot
FileDescription                Webroot SecureAnywhere
Computer                       <COMPUTERNAME> (this PC)
FileExtension                  .exe
Filename                       wsasme.exe
FileVersion                    9.0.31.86
Shared                         No
FolderName                     Temp
FolderPath                     D:\Users\Trenly\Downloads\Temp
Path                           D:\Users\Trenly\Downloads\Temp\wsasme.exe
Language                       English (United States)
LinkStatus                     Unresolved
SharingStatus                  Not shared
ProductName                    Webroot SecureAnywhere
ProductVersion                 9.0.31.86
See Function used to get file metadata
    Function Get-ItemMetadata {
        <#
        Inputs: Path to a file
        Outputs: A hashtable containting all of the file's populated metadata properties
        Usage: Get-ItemMetadata -FilePath <Path>
        #>
        Param (
            [Parameter(Mandatory = $true)] [string] $FilePath
        )
        try {
            $_MetaDataObject = [ordered] @{}
            $_FileInformation = (Get-Item $FilePath)
            $_ShellApplication = New-Object -ComObject Shell.Application
            $_ShellFolder = $_ShellApplication.Namespace($_FileInformation.Directory.FullName)
            $_ShellFile = $_ShellFolder.ParseName($_FileInformation.Name)
            $_MetaDataProperties = [ordered] @{}
            0..400 | ForEach-Object -Process {
                $_DataValue = $_ShellFolder.GetDetailsOf($null, $_)
                $_PropertyValue = (Get-Culture).TextInfo.ToTitleCase($_DataValue.Trim()).Replace(' ', '')
                if ($_PropertyValue -ne '') {
                    $_MetaDataProperties["$_"] = $_PropertyValue
                }
            }
            foreach ($_Key in $_MetaDataProperties.Keys) {
                $_Property = $_MetaDataProperties[$_Key]
                $_Value = $_ShellFolder.GetDetailsOf($_ShellFile, [int] $_Key)
                if ($_Property -in 'Attributes', 'Folder', 'Type', 'SpaceFree', 'TotalSize', 'SpaceUsed') {
                    continue
                }
                If (($null -ne $_Value) -and ($_Value -ne '')) {
                    $_MetaDataObject["$_Property"] = $_Value
                }
            }
            [void][System.Runtime.InteropServices.Marshal]::FinalReleaseComObject($_ShellFile)
            [void][System.Runtime.InteropServices.Marshal]::FinalReleaseComObject($_ShellFolder)
            [void][System.Runtime.InteropServices.Marshal]::FinalReleaseComObject($_ShellApplication)
            [void][System.GC]::Collect()
            [void][System.GC]::WaitForPendingFinalizers()
            return $_MetaDataObject
        } catch {
            Write-Error -Message $_.ToString()
            break
        }
    }

Expected behavior

Additional metadata needed for installer from http://anywhere.webrootcloudav.com/zerol/wsasme.exe
[...]
 [PackageName] value is: Webroot SecureAnywhere
The package license |e.g. MIT License|
 [License] value is: 

Actual behavior

Additional metadata needed for installer from http://anywhere.webrootcloudav.com/zerol/wsasme.exe
[...]
The package name |e.g. Visual Studio|
 [PackageName] value is: Webroot SecureAnywhere
The package license |e.g. MIT License|
 [License] value is: ((c) Webroot 2006-2021)

Environment

Windows Package Manager (Preview) v1.3.431-preview       
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19043.1586
Package: Microsoft.DesktopAppInstaller v1.18.431.0       

Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants