microsoft / winget-create

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

wingetcreate 1.2.5.0 does not prompt for portable installer #353

Closed mdanish-kh closed 1 year ago

mdanish-kh commented 1 year ago

Steps to reproduce

In wingetcreate 1.2.5.0 Run

wingetcreate new https://dist.nuget.org/win-x86-commandline/v6.4.0/nuget.exe

or

wingetcreate new https://curl.se/windows/dl-7.85.0_9/curl-7.85.0_9-win64-mingw.zip

Expected outcome

After asking for the PackageIdentifier and version, wingetcreate should prompt for "Is this a portable installer?" as done in previous versions of wingetcreate

Actual outcome

wingetcreate does not ask the user whether the installer is a portable package, assumes the package is an exe installer, leading to wingetcreate creating a manifest for InstallerType: exe / NestedInstallerType: exe instead of InstallerType: portable / NestedInstallerType: portable

Debug Info

It seems that the function PromptForPortableExe() https://github.com/microsoft/winget-create/blob/0c02bd581514dd0870b55f7737b5099d3496d54d/src/WingetCreateCLI/Commands/NewCommand.cs#L303

was removed in PR https://github.com/microsoft/winget-create/pull/311 in favor of PromptForPortableAliasIfApplicable(), but the implementation never set InstallerType: portable for PromptForPortableAliasIfApplicable() to work. I believe adding back the function to prompt for portable installer and set the InstallerType accordingly should fix the issue.