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

Cancelling an install within the chocolateyinstall.ps1 script will show that package installed #3102

Closed
4 tasks done
richarddziennmi opened this issue Apr 5, 2023 · 4 comments

Comments

@richarddziennmi
Copy link

Checklist

  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.

What You Are Seeing?

If you cancel an install during the running of the chocolateyinstall.ps1 (e.g. when asking for input via Read-Host) script then chocolatey will still show that package as installed.

What is Expected?

Package is not shown as installed.

How Did You Get This To Happen?

  1. Create a new package
  2. Replace contents of chocolateyinstall.ps1 with something asking for input (e.g. Read-Host "Enter something")
  3. Set version
  4. Build package
  5. Install Package, and cancel out when you get to the read host.
  6. choco list -l will show package installed.

System Details

  • Operating System: 10.0.17763.0
  • Windows PowerShell version:
    Name Value

PSVersion 5.1.17763.3770
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.3770
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

  • Chocolatey CLI Version: 1.3.1
  • Chocolatey Licensed Extension version: 5.0.1
  • Chocolatey License type: Business
  • Terminal/Emulator: Default PS

Installed Packages

N/A

Output Log

PS C:\temp\chocotest> choco new bob
Chocolatey v1.3.1 Business
Creating a new package specification at C:\temp\chocotest\bob
Generating template to a file
 at 'C:\temp\chocotest\bob\bob.nuspec'
Generating template to a file
 at 'C:\temp\chocotest\bob\tools\chocolateyinstall.ps1'
Generating template to a file
 at 'C:\temp\chocotest\bob\tools\chocolateybeforemodify.ps1'
Generating template to a file
 at 'C:\temp\chocotest\bob\tools\chocolateyuninstall.ps1'
Generating template to a file
 at 'C:\temp\chocotest\bob\tools\LICENSE.txt'
Generating template to a file
 at 'C:\temp\chocotest\bob\tools\VERIFICATION.txt'
Generating template to a file
 at 'C:\temp\chocotest\bob\ReadMe.md'
Generating template to a file
 at 'C:\temp\chocotest\bob\_TODO.txt'
Successfully generated bob package specification files
 at 'C:\temp\chocotest\bob'

PS C:\temp\chocotest> get-content .\bob\tools\chocolateyinstall.ps1
$foo = read-host "Enter Something"
new-item -type file -path c:\temp\chocotest\installed.txt

PS C:\temp\chocotest> choco pack bob
Chocolatey v1.3.1 Business
File specified is either not found or not a .nuspec file. 'bob'
PS C:\temp\chocotest> choco pack .\bob\bob.nuspec
Chocolatey v1.3.1 Business
Attempting to build package from 'bob.nuspec'.
Successfully created package 'C:\temp\chocotest\bob.0.1.nupkg'

PS C:\temp\chocotest> gci installed.txt
gci : Cannot find path 'C:\temp\chocotest\installed.txt' because it does not exist.
At line:1 char:1
+ gci installed.txt
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\temp\chocotest\installed.txt:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand


PS C:\temp\chocotest> choco list bob -l
Chocolatey v1.3.1 Business
0 packages installed.

PS C:\temp\chocotest> choco upgrade bob -s . -y --debug --verbose
Chocolatey v1.3.1 Business
Chocolatey is running on Windows v 10.0.17763.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" upgrade bob -s . -y --debug --verbose
Received arguments: upgrade bob -s . -y --debug --verbose
RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
CountdownTask is now ready and waiting for PostRunMessage.
Terminal services setup not necessary for this session.
SynchronizeTask is now ready and waiting for PreRunMessage.
PackagesInProgramsAndFeaturesTask is now ready and waiting for PostRunMessage.
Sending message 'PreRunMessage' out if there are subscribers...
[Pending] Removing all pending packages that should not be considered installed...
[Synchronize] Updating packages with Programs and Features
[Synchronize] Currently only supports removals. Soon will handle updates.
< SNIP List of already installed apps>
Performing validation checks.
Global Configuration Validation Checks:
 - Package Exit Code / Exit On Reboot = Checked
System State Validation Checks:
 Reboot Requirement Checks:
 - Pending Computer Rename = Checked
 - Pending Component Based Servicing = Checked
 - Pending Windows Auto Update = Checked
 - Pending File Rename Operations = Ignored
 - Pending Windows Package Installer = Checked
 - Pending Windows Package Installer SysWow64 = Checked
The source '.' evaluated to a 'normal' source type

NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.
Configuration: MaximumDownloadRateBitsPerSecond='0'|
MaximumDownloadRateBitsPerSecondAutoSet='False'|
LicensedInformation.LicenseType='Business'|
LicensedInformation.LicenseIsValid='True'|
LicensedInformation.LicenseIsTrial='False'|
LicensedInformation.PauseInTrial='False'|
LicensedInformation.LicenseUserName='Network Merchants Limited [100] ([REDACTED])'|

LicensedInformation.LicenseExpirationDate='23/11/2023 00:00:00'|
LicensedInformation.LicenseNodeCount='100'|
LicensedInformation.LicensedVersion='5.0.1.0'|
ChocolateyVersion.Version='1.3.1.0'|
ChocolateyVersion.PackageReleaseVersion='0'|
LicensedFeatures.UseDownloadCache='True'|
LicensedFeatures.AllowSynchronization='True'|
LicensedFeatures.AllowBackgroundServiceOverride='False'|
LicensedFeatures.UseBackgroundService='False'|
LicensedFeatures.UseBackgroundServiceWithSelfServiceSourcesOnly='True'|
LicensedFeatures.UseBackgroundServiceWithNonAdministratorsOnly='False'|
LicensedFeatures.UseBackgroundServiceInteractively='False'|
LicensedFeatures.UseBackgroundServiceWithEmptySessions='True'|
LicensedFeatures.AllowBackgroundServiceUninstallsFromUserInstallsOnly='False'|

LicensedFeatures.AllowPreviewFeatures='False'|
LicensedFeatures.ShowAllPackagesInProgramsAndFeatures='False'|
LicensedFeatures.AdminOnlyExecutionForAllChocolateyCommands='False'|
LicensedFeatures.AdminOnlyExecutionForNewCommand='False'|
LicensedFeatures.AdminOnlyExecutionForDownloadCommand='False'|
LicensedFeatures.ReduceInstalledPackageSize='True'|
LicensedFeatures.ReduceOnlyNupkgSize='False'|
LicensedFeatures.UseLocalSystemForServiceInstalls='True'|
LicensedFeatures.WarnOnUpcomingLicenseExpiration='True'|
LicensedFeatures.UseChocolateyCentralManagement='False'|
LicensedFeatures.UseChocolateyCentralManagementDeployments='False'|
LicensedFeatures.UseLogRetentionPolicy='True'|
LicensedFeatures.ExcludeChocolateyPackagesDuringUpgradeAll='False'|
LicensedNewCommand.UseOriginalFilesLocation='False'|
LicensedNewCommand.PauseOnError='False'|
LicensedNewCommand.BuildPackage='False'|
LicensedNewCommand.GeneratePackagesFromSoftwareInstalls='False'|
LicensedNewCommand.IncludeArchitectureInPackageId='False'|
LicensedDownloadCommand.Internalize='False'|
LicensedDownloadCommand.AppendUseOriginalLocation='True'|
LicensedDownloadCommand.InternalizeAnyUrlFound='False'|
LicensedDownloadCommand.DownloadInstalledPackages='False'|
LicensedDownloadCommand.IgnoreUnfoundPackages='False'|
LicensedConvertCommand.IncludeAll='False'|
LicensedConvertCommand.IncludeDependencies='False'|
LicensedPushCommand.IntuneAuthenticationUrl='https://login.microsoftonline.com'|

LicensedPushCommand.IntuneApiUrl='https://graph.microsoft.com'|
LicensedPushCommand.IntuneRetryIntervalInSeconds='5'|
LicensedPushCommand.IntuneUploadTimeoutInSeconds='600'|
LicensedPushCommand.IntuneUploadChunkSizeInMegabytes='10'|
LicensedPushCommand.SkipCleanup='False'|
LicensedListCommand.ShowAuditInformation='False'|
LicensedListCommand.ShowDisplayVersion='False'|
LicensedUninstallCommand.FromProgramsAndFeatures='False'|
VirusConfiguration.VirusCheckMinimumPositives='4'|
VirusConfiguration.VirusScannerType='Generic'|
VirusConfiguration.GenericVirusScannerArgs=''[[File]]''|
VirusConfiguration.GenericVirusScannerValidExitCodes='0'|
VirusConfiguration.GenericVirusScannerTimeoutInSeconds='120'|
LicensedServiceInstaller.DefaultUserName='ChocolateyLocalAdmin'|
CentralManagementConfiguration.ReportPackagesTimerIntervalInSeconds='1800'|

CentralManagementConfiguration.ReceiveTimeoutInSeconds='30'|
CentralManagementConfiguration.SendTimeoutInSeconds='30'|
CentralManagementConfiguration.CertificateValidationMode='PeerOrChainTrust'|

CentralManagementConfiguration.MaxReceiveMessageSizeInBytes='2147483647'|

CentralManagementConfiguration.DeploymentCheckTimerIntervalInSeconds='180'|

LicensedBackgroundService.LogRetentionPolicyInDays='30'|
CommandName='upgrade'|
CacheLocation='C:\Users\richard.dzien.a\AppData\Local\Temp\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='.'|SourceType='normal'|Debug='True'|Verbose='True'|
Trace='False'|Force='False'|Noop='False'|HelpRequested='False'|
UnsuccessfulParsing='False'|RegularOutput='True'|QuietOutput='False'|
PromptForConfirmation='False'|DisableCompatibilityChecks='False'|
AcceptLicense='True'|AllowUnofficialBuild='False'|Input='bob'|
AllVersions='False'|SkipPackageInstallProvider='False'|
SkipHookScripts='False'|PackageNames='bob'|Prerelease='False'|
ForceX86='False'|OverrideArguments='False'|NotSilent='False'|
ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|AllowDowngrade='False'|
ForceDependencies='False'|PinPackage='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.17763.0'|
Information.PlatformName='Windows Server 2016'|
Information.ChocolateyVersion='1.3.1.0'|
Information.ChocolateyProductVersion='1.3.1'|
Information.FullName='choco, Version=1.3.1.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='True'|
Information.UserName='richard.dzien.a'|
Information.UserDomainName='CREDITCALLCOUK'|
Information.IsUserAdministrator='True'|
Information.IsUserSystemAccount='False'|
Information.IsUserRemoteDesktop='False'|
Information.IsUserRemote='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='True'|
Information.LicenseType='Business'|
Information.CurrentDirectory='C:\temp\chocotest'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseEnhancedExitCodes='False'|
Features.UseFipsCompliantChecksums='False'|
Features.ShowNonElevatedWarnings='True'|
Features.ShowDownloadProgress='True'|
Features.StopOnFirstPackageFailure='False'|
Features.UseRememberedArgumentsForUpgrades='False'|
Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
Features.SkipPackageUpgradesWhenNotInstalled='False'|
Features.RemovePackageInformationOnUninstall='False'|
Features.ExitOnRebootDetected='False'|
Features.LogValidationResultsOnWarnings='True'|
Features.UsePackageRepositoryOptimizations='True'|
ListCommand.LocalOnly='False'|ListCommand.IdOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|ListCommand.PageSize='25'|
ListCommand.Exact='False'|ListCommand.ByIdOnly='False'|
ListCommand.ByTagOnly='False'|ListCommand.IdStartsWith='False'|
ListCommand.OrderByPopularity='False'|ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|
ListCommand.IncludeVersionOverrides='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
UpgradeCommand.ExcludePrerelease='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
SourceCommand.AllowSelfService='False'|
SourceCommand.VisibleToAdminsOnly='False'|
FeatureCommand.Command='unknown'|ConfigCommand.Command='unknown'|
ApiKeyCommand.Remove='False'|PinCommand.Command='unknown'|
OutdatedCommand.IgnorePinned='False'|
ExportCommand.IncludeVersionNumbers='False'|Proxy.BypassOnLocal='True'|
TemplateCommand.Command='unknown'|
_ Chocolatey:ProChocolateyUpgradeCommand - Normal Run Mode _
Upgrading the following packages:
bob
By upgrading, you accept licenses for the packages.
Returning loaded assembly type for 'chocolatey.licensed'
Returning loaded assembly type for 'chocolatey.licensed'
bob is not installed. Installing...
Using '.'.
- Supports prereleases? 'True'.
- Is ServiceBased? 'False'.
Package 'bob' found on source '.'
[NuGet] Installing 'bob 0.1'.
[NuGet] Added file 'chocolateybeforemodify.ps1' to folder 'bob\tools'.
[NuGet] Added file 'chocolateyinstall.ps1' to folder 'bob\tools'.
[NuGet] Added file 'chocolateyuninstall.ps1' to folder 'bob\tools'.
[NuGet] Added file 'LICENSE.txt' to folder 'bob\tools'.
[NuGet] Added file 'VERIFICATION.txt' to folder 'bob\tools'.
[NuGet] Added file 'bob.nupkg' to folder 'bob'.
[NuGet] Added file 'bob.nuspec' to folder 'bob'.
[NuGet] Successfully installed 'bob 0.1'.

bob v0.1
bob package files upgrade completed. Performing other installation steps.
Setting installer args for bob
Setting package parameters for bob
Contents of 'C:\ProgramData\chocolatey\lib\bob\tools\chocolateyinstall.ps1':
$foo = read-host "Enter Something"
new-item -type file -path c:\temp\chocotest\installed.txt
Calling built-in PowerShell host with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\bob\tools\chocolateyinstall.ps1' -installArguments '' -packageParameters '' -preRunHookScripts $null -postRunHookScripts $null']
Redirecting System.Management.Automation.resources, Version=3.0.0.0, Culture=en-US, PublicKeyToken=31bf3856ad364e35, requested by ''
Host version is 5.1.17763.1, PowerShell Version is '5.1.17763.3770' and CLR Version is '4.0.30319.42000'.
VERBOSE: Exporting function 'Format-FileSize'.
VERBOSE: Exporting function 'Get-ChecksumValid'.
VERBOSE: Exporting function 'Get-ChocolateyPath'.
VERBOSE: Exporting function 'Get-ChocolateyUnzip'.
VERBOSE: Exporting function 'Get-ChocolateyWebFile'.
VERBOSE: Exporting function 'Get-EnvironmentVariable'.
VERBOSE: Exporting function 'Get-EnvironmentVariableNames'.
VERBOSE: Exporting function 'Get-FtpFile'.
VERBOSE: Exporting function 'Get-OSArchitectureWidth'.
VERBOSE: Exporting function 'Get-PackageParameters'.
VERBOSE: Exporting function 'Get-PackageParametersBuiltIn'.
VERBOSE: Exporting function 'Get-ToolsLocation'.
VERBOSE: Exporting function 'Get-UACEnabled'.
VERBOSE: Exporting function 'Get-UninstallRegistryKey'.
VERBOSE: Exporting function 'Get-VirusCheckValid'.
VERBOSE: Exporting function 'Get-WebFile'.
VERBOSE: Exporting function 'Get-WebFileName'.
VERBOSE: Exporting function 'Get-WebHeaders'.
VERBOSE: Exporting function 'Install-BinFile'.
VERBOSE: Exporting function 'Install-ChocolateyEnvironmentVariable'.
VERBOSE: Exporting function 'Install-ChocolateyExplorerMenuItem'.
VERBOSE: Exporting function 'Install-ChocolateyFileAssociation'.
VERBOSE: Exporting function 'Install-ChocolateyInstallPackage'.
VERBOSE: Exporting function 'Install-ChocolateyPackage'.
VERBOSE: Exporting function 'Install-ChocolateyPath'.
VERBOSE: Exporting function 'Install-ChocolateyPinnedTaskBarItem'.
VERBOSE: Exporting function 'Install-ChocolateyPowershellCommand'.
VERBOSE: Exporting function 'Install-ChocolateyShortcut'.
VERBOSE: Exporting function 'Install-ChocolateyVsixPackage'.
VERBOSE: Exporting function 'Install-ChocolateyZipPackage'.
VERBOSE: Exporting function 'Install-Vsix'.
VERBOSE: Exporting function 'Set-EnvironmentVariable'.
VERBOSE: Exporting function 'Set-PowerShellExitCode'.
VERBOSE: Exporting function 'Start-ChocolateyProcessAsAdmin'.
VERBOSE: Exporting function 'Test-ProcessAdminRights'.
VERBOSE: Exporting function 'Uninstall-BinFile'.
VERBOSE: Exporting function 'Uninstall-ChocolateyEnvironmentVariable'.
VERBOSE: Exporting function 'Uninstall-ChocolateyPackage'.
VERBOSE: Exporting function 'Uninstall-ChocolateyZipPackage'.
VERBOSE: Exporting function 'Update-SessionEnvironment'.
VERBOSE: Exporting function 'Write-FunctionCallLogMessage'.
VERBOSE: Exporting alias 'Get-ProcessorBits'.
VERBOSE: Exporting alias 'Get-OSBitness'.
VERBOSE: Exporting alias 'Get-InstallRegistryKey'.
VERBOSE: Exporting alias 'Generate-BinFile'.
VERBOSE: Exporting alias 'Add-BinFile'.
VERBOSE: Exporting alias 'Start-ChocolateyProcess'.
VERBOSE: Exporting alias 'Invoke-ChocolateyProcess'.
VERBOSE: Exporting alias 'Remove-BinFile'.
VERBOSE: Exporting alias 'refreshenv'.
Importing 'C:\ProgramData\chocolatey\helpers\..\extensions\chocolatey\chocolatey.licensed.dll'
Loading 'chocolatey.licensed' extension
VERBOSE: Importing cmdlet 'Get-AppSettingsJsonFileContentCmdlet'.
VERBOSE: Importing cmdlet 'Get-ChecksumValidCmdlet'.
VERBOSE: Importing cmdlet 'Get-ChocolateyUnzipCmdlet'.
VERBOSE: Importing cmdlet 'Get-ChocolateyWebFileCmdlet'.
VERBOSE: Importing cmdlet 'Get-VirusCheckValidCmdlet'.
VERBOSE: Importing cmdlet 'Get-WebFileCmdlet'.
VERBOSE: Importing cmdlet 'Get-WebFileNameCmdlet'.
VERBOSE: Importing cmdlet 'Get-WebHeadersCmdlet'.
VERBOSE: Importing cmdlet 'Install-AppSettingsJsonFileCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyInstallPackageCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyPackageCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyZipPackageCmdlet'.
VERBOSE: Importing cmdlet 'Invoke-ChocolateyProcessCmdlet'.
VERBOSE: Importing cmdlet 'Invoke-ValidateChocolateyLicenseCmdlet'.
VERBOSE: Importing cmdlet 'Start-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Importing cmdlet 'Stop-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Importing cmdlet 'Uninstall-ChocolateyWindowsServiceCmdlet'.
Loading community extensions
Importing 'C:\ProgramData\chocolatey\extensions\chocolatey\chocolatey.extensions.psm1'
VERBOSE: Loading module from path 'C:\ProgramData\chocolatey\extensions\chocolatey\chocolatey.extensions.psm1'.
Loading 'chocolatey.licensed' extension.
VERBOSE: Loading module from path 'C:\ProgramData\chocolatey\extensions\chocolatey\chocolatey.licensed.dll'.
VERBOSE: Importing cmdlet 'Get-AppSettingsJsonFileContentCmdlet'.
VERBOSE: Importing cmdlet 'Get-ChecksumValidCmdlet'.
VERBOSE: Importing cmdlet 'Get-ChocolateyUnzipCmdlet'.
VERBOSE: Importing cmdlet 'Get-ChocolateyWebFileCmdlet'.
VERBOSE: Importing cmdlet 'Get-VirusCheckValidCmdlet'.
VERBOSE: Importing cmdlet 'Get-WebFileCmdlet'.
VERBOSE: Importing cmdlet 'Get-WebFileNameCmdlet'.
VERBOSE: Importing cmdlet 'Get-WebHeadersCmdlet'.
VERBOSE: Importing cmdlet 'Install-AppSettingsJsonFileCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyInstallPackageCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyPackageCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyZipPackageCmdlet'.
VERBOSE: Importing cmdlet 'Invoke-ChocolateyProcessCmdlet'.
VERBOSE: Importing cmdlet 'Invoke-ValidateChocolateyLicenseCmdlet'.
VERBOSE: Importing cmdlet 'Start-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Importing cmdlet 'Stop-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Importing cmdlet 'Uninstall-ChocolateyWindowsServiceCmdlet'.
License type set to Business
VERBOSE: Exporting cmdlet 'Get-AppSettingsJsonFileContentCmdlet'.
VERBOSE: Exporting cmdlet 'Get-ChecksumValidCmdlet'.
VERBOSE: Exporting cmdlet 'Get-ChocolateyUnzipCmdlet'.
VERBOSE: Exporting cmdlet 'Get-ChocolateyWebFileCmdlet'.
VERBOSE: Exporting cmdlet 'Get-VirusCheckValidCmdlet'.
VERBOSE: Exporting cmdlet 'Get-WebFileCmdlet'.
VERBOSE: Exporting cmdlet 'Get-WebFileNameCmdlet'.
VERBOSE: Exporting cmdlet 'Get-WebHeadersCmdlet'.
VERBOSE: Exporting cmdlet 'Install-AppSettingsJsonFileCmdlet'.
VERBOSE: Exporting cmdlet 'Install-ChocolateyInstallPackageCmdlet'.
VERBOSE: Exporting cmdlet 'Install-ChocolateyPackageCmdlet'.
VERBOSE: Exporting cmdlet 'Install-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Exporting cmdlet 'Install-ChocolateyZipPackageCmdlet'.
VERBOSE: Exporting cmdlet 'Invoke-ChocolateyProcessCmdlet'.
VERBOSE: Exporting cmdlet 'Invoke-ValidateChocolateyLicenseCmdlet'.
VERBOSE: Exporting cmdlet 'Start-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Exporting cmdlet 'Stop-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Exporting cmdlet 'Uninstall-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Exporting alias 'Uninstall-ChocolateyPackageCmdlet'.
VERBOSE: Importing cmdlet 'Get-AppSettingsJsonFileContentCmdlet'.
VERBOSE: Importing cmdlet 'Get-ChecksumValidCmdlet'.
VERBOSE: Importing cmdlet 'Get-ChocolateyUnzipCmdlet'.
VERBOSE: Importing cmdlet 'Get-ChocolateyWebFileCmdlet'.
VERBOSE: Importing cmdlet 'Get-VirusCheckValidCmdlet'.
VERBOSE: Importing cmdlet 'Get-WebFileCmdlet'.
VERBOSE: Importing cmdlet 'Get-WebFileNameCmdlet'.
VERBOSE: Importing cmdlet 'Get-WebHeadersCmdlet'.
VERBOSE: Importing cmdlet 'Install-AppSettingsJsonFileCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyInstallPackageCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyPackageCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyZipPackageCmdlet'.
VERBOSE: Importing cmdlet 'Invoke-ChocolateyProcessCmdlet'.
VERBOSE: Importing cmdlet 'Invoke-ValidateChocolateyLicenseCmdlet'.
VERBOSE: Importing cmdlet 'Start-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Importing cmdlet 'Stop-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Importing cmdlet 'Uninstall-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Importing alias 'Uninstall-ChocolateyPackageCmdlet'.
Importing 'C:\ProgramData\chocolatey\extensions\chocolatey-core\chocolatey-core.psm1'
VERBOSE: Loading module from path 'C:\ProgramData\chocolatey\extensions\chocolatey-core\chocolatey-core.psm1'.
VERBOSE: Exporting function 'Get-UninstallRegistryKey'.
VERBOSE: Exporting function 'Get-AppInstallLocation'.
VERBOSE: Exporting function 'Get-AvailableDriveLetter'.
VERBOSE: Exporting function 'Get-EffectiveProxy'.
VERBOSE: Exporting function 'Get-PackageCacheLocation'.
VERBOSE: Exporting function 'Get-PackageParameters'.
VERBOSE: Exporting function 'Get-WebContent'.
VERBOSE: Exporting function 'Register-Application'.
VERBOSE: Exporting function 'Remove-Process'.
VERBOSE: Importing function 'Get-AppInstallLocation'.
VERBOSE: Importing function 'Get-AvailableDriveLetter'.
VERBOSE: Importing function 'Get-EffectiveProxy'.
VERBOSE: Importing function 'Get-PackageCacheLocation'.
VERBOSE: Importing function 'Get-PackageParameters'.
VERBOSE: Importing function 'Get-UninstallRegistryKey'.
VERBOSE: Importing function 'Get-WebContent'.
VERBOSE: Importing function 'Register-Application'.
VERBOSE: Importing function 'Remove-Process'.
Importing 'C:\ProgramData\chocolatey\extensions\chocolatey-windowsupdate\chocolatey-windowsupdate.psm1'
VERBOSE: Loading module from path 'C:\ProgramData\chocolatey\extensions\chocolatey-windowsupdate\chocolatey-windowsupdate.psm1'.
VERBOSE: Exporting function 'Install-WindowsUpdate'.
VERBOSE: Exporting function 'Test-WindowsUpdate'.
VERBOSE: Importing function 'Install-WindowsUpdate'.
VERBOSE: Importing function 'Test-WindowsUpdate'.
VERBOSE: Exporting function 'Format-FileSize'.
VERBOSE: Exporting function 'Get-ChecksumValid'.
VERBOSE: Exporting function 'Get-ChocolateyPath'.
VERBOSE: Exporting function 'Get-ChocolateyUnzip'.
VERBOSE: Exporting function 'Get-ChocolateyWebFile'.
VERBOSE: Exporting function 'Get-EnvironmentVariable'.
VERBOSE: Exporting function 'Get-EnvironmentVariableNames'.
VERBOSE: Exporting function 'Get-FtpFile'.
VERBOSE: Exporting function 'Get-OSArchitectureWidth'.
VERBOSE: Exporting function 'Get-PackageParameters'.
VERBOSE: Exporting function 'Get-PackageParametersBuiltIn'.
VERBOSE: Exporting function 'Get-ToolsLocation'.
VERBOSE: Exporting function 'Get-UACEnabled'.
VERBOSE: Exporting function 'Get-UninstallRegistryKey'.
VERBOSE: Exporting function 'Get-VirusCheckValid'.
VERBOSE: Exporting function 'Get-WebFile'.
VERBOSE: Exporting function 'Get-WebFileName'.
VERBOSE: Exporting function 'Get-WebHeaders'.
VERBOSE: Exporting function 'Install-BinFile'.
VERBOSE: Exporting function 'Install-ChocolateyEnvironmentVariable'.
VERBOSE: Exporting function 'Install-ChocolateyExplorerMenuItem'.
VERBOSE: Exporting function 'Install-ChocolateyFileAssociation'.
VERBOSE: Exporting function 'Install-ChocolateyInstallPackage'.
VERBOSE: Exporting function 'Install-ChocolateyPackage'.
VERBOSE: Exporting function 'Install-ChocolateyPath'.
VERBOSE: Exporting function 'Install-ChocolateyPinnedTaskBarItem'.
VERBOSE: Exporting function 'Install-ChocolateyPowershellCommand'.
VERBOSE: Exporting function 'Install-ChocolateyShortcut'.
VERBOSE: Exporting function 'Install-ChocolateyVsixPackage'.
VERBOSE: Exporting function 'Install-ChocolateyZipPackage'.
VERBOSE: Exporting function 'Install-Vsix'.
VERBOSE: Exporting function 'Set-EnvironmentVariable'.
VERBOSE: Exporting function 'Set-PowerShellExitCode'.
VERBOSE: Exporting function 'Start-ChocolateyProcessAsAdmin'.
VERBOSE: Exporting function 'Test-ProcessAdminRights'.
VERBOSE: Exporting function 'Uninstall-BinFile'.
VERBOSE: Exporting function 'Uninstall-ChocolateyEnvironmentVariable'.
VERBOSE: Exporting function 'Uninstall-ChocolateyPackage'.
VERBOSE: Exporting function 'Uninstall-ChocolateyZipPackage'.
VERBOSE: Exporting function 'Update-SessionEnvironment'.
VERBOSE: Exporting function 'Write-FunctionCallLogMessage'.
VERBOSE: Exporting function 'Get-AppInstallLocation'.
VERBOSE: Exporting function 'Get-AvailableDriveLetter'.
VERBOSE: Exporting function 'Get-EffectiveProxy'.
VERBOSE: Exporting function 'Get-PackageCacheLocation'.
VERBOSE: Exporting function 'Get-WebContent'.
VERBOSE: Exporting function 'Register-Application'.
VERBOSE: Exporting function 'Remove-Process'.
VERBOSE: Exporting function 'Install-WindowsUpdate'.
VERBOSE: Exporting function 'Test-WindowsUpdate'.
VERBOSE: Exporting cmdlet 'Get-AppSettingsJsonFileContentCmdlet'.
VERBOSE: Exporting cmdlet 'Get-ChecksumValidCmdlet'.
VERBOSE: Exporting cmdlet 'Get-ChocolateyUnzipCmdlet'.
VERBOSE: Exporting cmdlet 'Get-ChocolateyWebFileCmdlet'.
VERBOSE: Exporting cmdlet 'Get-VirusCheckValidCmdlet'.
VERBOSE: Exporting cmdlet 'Get-WebFileCmdlet'.
VERBOSE: Exporting cmdlet 'Get-WebFileNameCmdlet'.
VERBOSE: Exporting cmdlet 'Get-WebHeadersCmdlet'.
VERBOSE: Exporting cmdlet 'Install-AppSettingsJsonFileCmdlet'.
VERBOSE: Exporting cmdlet 'Install-ChocolateyInstallPackageCmdlet'.
VERBOSE: Exporting cmdlet 'Install-ChocolateyPackageCmdlet'.
VERBOSE: Exporting cmdlet 'Install-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Exporting cmdlet 'Install-ChocolateyZipPackageCmdlet'.
VERBOSE: Exporting cmdlet 'Invoke-ChocolateyProcessCmdlet'.
VERBOSE: Exporting cmdlet 'Invoke-ValidateChocolateyLicenseCmdlet'.
VERBOSE: Exporting cmdlet 'Start-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Exporting cmdlet 'Stop-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Exporting cmdlet 'Uninstall-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Exporting alias 'Get-ProcessorBits'.
VERBOSE: Exporting alias 'Get-OSBitness'.
VERBOSE: Exporting alias 'Get-InstallRegistryKey'.
VERBOSE: Exporting alias 'Generate-BinFile'.
VERBOSE: Exporting alias 'Add-BinFile'.
VERBOSE: Exporting alias 'Start-ChocolateyProcess'.
VERBOSE: Exporting alias 'Invoke-ChocolateyProcess'.
VERBOSE: Exporting alias 'Remove-BinFile'.
VERBOSE: Exporting alias 'refreshenv'.
VERBOSE: Exporting alias 'Uninstall-ChocolateyPackageCmdlet'.
VERBOSE: Importing cmdlet 'Get-AppSettingsJsonFileContentCmdlet'.
VERBOSE: Importing cmdlet 'Get-ChecksumValidCmdlet'.
VERBOSE: Importing cmdlet 'Get-ChocolateyUnzipCmdlet'.
VERBOSE: Importing cmdlet 'Get-ChocolateyWebFileCmdlet'.
VERBOSE: Importing cmdlet 'Get-VirusCheckValidCmdlet'.
VERBOSE: Importing cmdlet 'Get-WebFileCmdlet'.
VERBOSE: Importing cmdlet 'Get-WebFileNameCmdlet'.
VERBOSE: Importing cmdlet 'Get-WebHeadersCmdlet'.
VERBOSE: Importing cmdlet 'Install-AppSettingsJsonFileCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyInstallPackageCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyPackageCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Importing cmdlet 'Install-ChocolateyZipPackageCmdlet'.
VERBOSE: Importing cmdlet 'Invoke-ChocolateyProcessCmdlet'.
VERBOSE: Importing cmdlet 'Invoke-ValidateChocolateyLicenseCmdlet'.
VERBOSE: Importing cmdlet 'Start-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Importing cmdlet 'Stop-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Importing cmdlet 'Uninstall-ChocolateyWindowsServiceCmdlet'.
VERBOSE: Importing function 'Format-FileSize'.
VERBOSE: Importing function 'Get-AppInstallLocation'.
VERBOSE: Importing function 'Get-AvailableDriveLetter'.
VERBOSE: Importing function 'Get-ChecksumValid'.
VERBOSE: Importing function 'Get-ChocolateyPath'.
VERBOSE: Importing function 'Get-ChocolateyUnzip'.
VERBOSE: Importing function 'Get-ChocolateyWebFile'.
VERBOSE: Importing function 'Get-EffectiveProxy'.
VERBOSE: Importing function 'Get-EnvironmentVariable'.
VERBOSE: Importing function 'Get-EnvironmentVariableNames'.
VERBOSE: Importing function 'Get-FtpFile'.
VERBOSE: Importing function 'Get-OSArchitectureWidth'.
VERBOSE: Importing function 'Get-PackageCacheLocation'.
VERBOSE: Importing function 'Get-PackageParameters'.
VERBOSE: Importing function 'Get-PackageParametersBuiltIn'.
VERBOSE: Importing function 'Get-ToolsLocation'.
VERBOSE: Importing function 'Get-UACEnabled'.
VERBOSE: Importing function 'Get-UninstallRegistryKey'.
VERBOSE: Importing function 'Get-VirusCheckValid'.
VERBOSE: Importing function 'Get-WebContent'.
VERBOSE: Importing function 'Get-WebFile'.
VERBOSE: Importing function 'Get-WebFileName'.
VERBOSE: Importing function 'Get-WebHeaders'.
VERBOSE: Importing function 'Install-BinFile'.
VERBOSE: Importing function 'Install-ChocolateyEnvironmentVariable'.
VERBOSE: Importing function 'Install-ChocolateyExplorerMenuItem'.
VERBOSE: Importing function 'Install-ChocolateyFileAssociation'.
VERBOSE: Importing function 'Install-ChocolateyInstallPackage'.
VERBOSE: Importing function 'Install-ChocolateyPackage'.
VERBOSE: Importing function 'Install-ChocolateyPath'.
VERBOSE: Importing function 'Install-ChocolateyPinnedTaskBarItem'.
VERBOSE: Importing function 'Install-ChocolateyPowershellCommand'.
VERBOSE: Importing function 'Install-ChocolateyShortcut'.
VERBOSE: Importing function 'Install-ChocolateyVsixPackage'.
VERBOSE: Importing function 'Install-ChocolateyZipPackage'.
VERBOSE: Importing function 'Install-Vsix'.
VERBOSE: Importing function 'Install-WindowsUpdate'.
VERBOSE: Importing function 'Register-Application'.
VERBOSE: Importing function 'Remove-Process'.
VERBOSE: Importing function 'Set-EnvironmentVariable'.
VERBOSE: Importing function 'Set-PowerShellExitCode'.
VERBOSE: Importing function 'Start-ChocolateyProcessAsAdmin'.
VERBOSE: Importing function 'Test-ProcessAdminRights'.
VERBOSE: Importing function 'Test-WindowsUpdate'.
VERBOSE: Importing function 'Uninstall-BinFile'.
VERBOSE: Importing function 'Uninstall-ChocolateyEnvironmentVariable'.
VERBOSE: Importing function 'Uninstall-ChocolateyPackage'.
VERBOSE: Importing function 'Uninstall-ChocolateyZipPackage'.
VERBOSE: Importing function 'Update-SessionEnvironment'.
VERBOSE: Importing function 'Write-FunctionCallLogMessage'.
VERBOSE: Importing alias 'Add-BinFile'.
VERBOSE: Importing alias 'Generate-BinFile'.
VERBOSE: Importing alias 'Get-InstallRegistryKey'.
VERBOSE: Importing alias 'Get-OSBitness'.
VERBOSE: Importing alias 'Get-ProcessorBits'.
VERBOSE: Importing alias 'Invoke-ChocolateyProcess'.
VERBOSE: Importing alias 'refreshenv'.
VERBOSE: Importing alias 'Remove-BinFile'.
VERBOSE: Importing alias 'Start-ChocolateyProcess'.
VERBOSE: Importing alias 'Uninstall-ChocolateyPackageCmdlet'.
---------------------------Script Execution---------------------------
Running 'ChocolateyScriptRunner' for bob v0.1 with packageScript 'C:\ProgramData\chocolatey\lib\bob\tools\chocolateyinstall.ps1', packageFolder:'C:\ProgramData\chocolatey\lib\bob', installArguments: '', packageParameters: '', preRunHookScripts: '', postRunHookScripts: '',
Running package script 'C:\ProgramData\chocolatey\lib\bob\tools\chocolateyinstall.ps1'

Enter Something
  Confirmation (`-y`) is set.
  Respond within 30 seconds or the default selection will be chosen. `CTRL-C here`
PS C:\temp\chocotest> choco list bob -l
Chocolatey v1.3.1 Business
bob 0.1
1 packages installed.
PS C:\temp\chocotest> gci installed.txt
gci : Cannot find path 'C:\temp\chocotest\installed.txt' because it does not exist.
At line:1 char:1
+ gci installed.txt
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\temp\chocotest\installed.txt:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

PS C:\temp\chocotest>

Additional Context

No response

@pauby
Copy link
Member

pauby commented Apr 5, 2023

At the stage of the prompt, the package is installed. Chocolatey has installed the package. It has to, to be able to run the script that has the prompt in it.

If you Ctrl-C out then, it doesn't install the software (or whatever the script is meant to do). But in order for the scripts to be there, the package has to be installed.

Pressing Ctrl-C can result in issues (as the issues I linked to below) so it's best avoided.

@pauby
Copy link
Member

pauby commented Apr 5, 2023

This is also related to #1548 and #619.

@richarddziennmi
Copy link
Author

OK, fair enough @pauby. Thank-you for the explanation. I just didn't see the distinction between the package, and what i wanted the package to do.

I wonder if the PSHost could be made to handle ctrl-c differently?

In my case, now knowing the above i just need to make sure my package version gets updated more vigilantly.

@pauby
Copy link
Member

pauby commented May 11, 2023

I'm going to close this as a duplicate of one of the above issues I linked to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants