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

System.InvalidOperationException after making changes to manifest #438

Closed
ave9858 opened this issue Aug 21, 2023 · 0 comments · Fixed by #439
Closed

System.InvalidOperationException after making changes to manifest #438

ave9858 opened this issue Aug 21, 2023 · 0 comments · Fixed by #439

Comments

@ave9858
Copy link

ave9858 commented Aug 21, 2023

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
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.

1 participant