microsoft / winget-create

The Windows Package Manager Manifest Creator command-line tool (aka wingetcreate)
MIT License
498 stars 85 forks source link

System.InvalidOperationException after making changes to manifest #438

Closed ave9858 closed 1 year ago

ave9858 commented 1 year ago

Brief description of your issue

wingetcreate crashed while I was creating a new winget manifest using wingetcreate new. A log of my choices and the crash log is below.

Steps to reproduce

I ran wingetcreate new and put https://github.com/solemnwarning/rehex/releases/download/0.60.1/rehex-0.60.1-win-x86_64.zip for InstallerUrls.

Downloading and parsing: https://github.com/solemnwarning/rehex/releases/download/0.60.1/rehex-0.60.1-win-x86_64.zip...

This tool will walk you through a series of questions to help you create your package manifest.

For information about the restrictions for each field, visit https://aka.ms/winget-manifest-schema

Press ENTER to submit the value for each question including accepting the (default) value.

Please enter values for the following fields:
The package unique identifier |e.g. Microsoft.VisualStudio|
 [PackageIdentifier] value is: test.test
The package version |e.g. 1.2.3.4|
 [PackageVersion] value is: test
The package meta-data default locale |e.g. en-US|
 [DefaultLocale] value is: en-US

Parsing nested installer 'rehex-0.60.1\rehex.exe' from https://github.com/solemnwarning/rehex/releases/download/0.60.1/rehex-0.60.1-win-x86_64.zip
 Is this a portable package?: Yes
 What is the command alias of the portable package |e.g. nuget|:

Additional metadata needed for installer from https://github.com/solemnwarning/rehex/releases/download/0.60.1/rehex-0.60.1-win-x86_64.zip
The installer target architecture
 [Architecture] value is: X64
The publisher name |e.g. Microsoft|
 [Publisher] value is: test
The package name |e.g. Visual Studio|
 [PackageName] value is: test
The package license |e.g. MIT License|
 [License] value is: test
The short package description
 [ShortDescription] value is: test

 Would you like to modify the optional default locale fields?: No
 Would you like to modify the optional installer fields?: No

Generating a preview of your manifests...
Version manifest preview:
# Created using wingetcreate 1.5.2.0
# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.5.0.schema.json

PackageIdentifier: test.test
PackageVersion: test
DefaultLocale: en-US
ManifestType: version
ManifestVersion: 1.5.0

Installer manifest preview:
# Created using wingetcreate 1.5.2.0
# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.5.0.schema.json

PackageIdentifier: test.test
PackageVersion: test
InstallerType: zip
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: rehex-0.60.1\rehex.exe
Installers:
- InstallerUrl: https://github.com/solemnwarning/rehex/releases/download/0.60.1/rehex-0.60.1-win-x86_64.zip
  Architecture: x64
  InstallerSha256: 70C14EB25050AD592D7C4C079CD5CD376E49B99890CB36BA9B273CC760C38CF7
ManifestType: installer
ManifestVersion: 1.5.0

Default locale manifest preview:
# Created using wingetcreate 1.5.2.0
# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.5.0.schema.json

PackageIdentifier: test.test
PackageVersion: test
PackageLocale: en-US
Publisher: test
PackageName: test
License: test
ShortDescription: test
ManifestType: defaultLocale
ManifestVersion: 1.5.0

Manifest validation succeeded: True

 Would you like to make changes to this manifest?: Yes
# I just pressed enter after this
The package unique identifier |e.g. Microsoft.VisualStudio|
 [PackageIdentifier] value is: test.test
The package version |e.g. 1.2.3.4|
 [PackageVersion] value is: test
The package meta-data default locale |e.g. en-US|
 [DefaultLocale] value is: en-US

System.InvalidOperationException: Nullable object must have a value.
   at Microsoft.WingetCreateCLI.Commands.NewCommand.PromptInstallerProperties[T](T manifest, PropertyInfo property)
   at Microsoft.WingetCreateCLI.Commands.NewCommand.PromptRequiredProperties[T](T manifest, VersionManifest versionManifest)
   at Microsoft.WingetCreateCLI.Commands.NewCommand.PromptManifestProperties(Manifests manifests)
   at Microsoft.WingetCreateCLI.Commands.NewCommand.Execute()
   at Microsoft.WingetCreateCLI.Program.Main(String[] args)

Expected behavior

wingetcreate should have continued asking questions or returned a user-friendly error.

Actual behavior

System.InvalidOperationException: Nullable object must have a value.
   at Microsoft.WingetCreateCLI.Commands.NewCommand.PromptInstallerProperties[T](T manifest, PropertyInfo property)
   at Microsoft.WingetCreateCLI.Commands.NewCommand.PromptRequiredProperties[T](T manifest, VersionManifest versionManifest)
   at Microsoft.WingetCreateCLI.Commands.NewCommand.PromptManifestProperties(Manifests manifests)
   at Microsoft.WingetCreateCLI.Commands.NewCommand.Execute()
   at Microsoft.WingetCreateCLI.Program.Main(String[] args)

Environment

Windows Package Manager Manifest Creator v1.5.2.0

Windows Package Manager v1.5.1881
Windows: Windows.Desktop v10.0.19044.3324
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.20.1881.0