Choco: [BUG] if the ChocolatelyInstall.ps1 name is mispelled, false successful installs result

Created on 5 Oct 2016  路  7Comments  路  Source: chocolatey/choco

chocolatey version: You have chocolatey v0.9.10.3 installed. Version 0.10.1 is available based on your source(s).

platform: windows 10 x64


if the ChocolatelyInstall.ps1 script's title name is misspelled in any way, then any attempts to install the resulting package results in immediate successful install message (output at very bottom)

Requesting you add logic to cpack to determine if the name of the file is valid. Currently, if no file exists in the 'tools' directory of the package, the error "Cannot create a package that has no dependencies nor content." comes up. Awesome. But attempts to cpack if you create ANY dummy file in the tools directory (even "New Text Document.txt') renders no such errors and allows cpacks; and worse, the result being a package that results in immediate false successful installs:

CPACK without the existence of any file in the 'tools' directory:

C:\choco\my_awesome_app>cpack
Attempting to build package from 'my_awesome_app.nuspec'.

Cannot create a package that has no dependencies nor content.

OUTPUT OF PACKAGE INSTALL WITH A PACKAGE THAT WAS MADE WITH MISSPELLED chocolateyinstall.ps1:

C:\choco\vs>choco install my_awesome_app -yfv
Installing the following packages:
my_awesome_app
By installing you accept licenses for the packages.

my_awesome_app v1.1.1.1.1 (forced)
The install of my_awesome_app was successful.
Software install location not explicitly set, could be in package or
default install location if installer.

Chocolatey installed 1/1 packages. 0 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

0 - _Triaging

Most helpful comment

How about we look to see if there are PowerShell files in the package, and if they are not named appropriately we provide a warning?

All 7 comments

choco new prior to doing anything additional and look through the output/documentation that is produced.

Chocolatey does not require a chocolateyInstall.ps1 file. The best packages just contain the runtime binaries with no further additional items added.

You can additionally remove the attempt to pack files in the tools folder from the nuspec to make the package just a metapackage.

Let me know what you would additionally like after you've read through that documentation.

@idontgitit ping. Have you had a chance to review?

hi. we need custom chocolatelyinstall and sometimes custom chocolatelyuninstall scripts for advanced instructions in our apps; including things like available disk space, checksum, OS version et al checks, and other stuff depending on the package. but i can understand the work involved in adding the check isn't worth it, would just make it less idiot/fat-finger prone

How about we look to see if there are PowerShell files in the package, and if they are not named appropriately we provide a warning?

yea seems like it would be great to have cpack verify the anticipated folder/file structure, and error if they're misspelled or empty

We are bringing the validator local. Hoping for by 0.10.5 for that.

Was this page helpful?
0 / 5 - 0 ratings