Notices: This section not yet converted to new layout. Download stats are rolling back out.

This is not the latest version of Chocolatey Toast Extension (Unofficial) available.

Chocolatey Toast Extension (Unofficial)

1.0.0

Package test results are passing.

This package was approved by moderator flcdrg on 2/3/2017.

Allows Chocolatey packages to display toast messages to report their (un)installation progress.

To install Chocolatey Toast Extension (Unofficial), run the following command from the command line or from PowerShell:

C:\> choco install chocolatey-toast.extension --version 1.0.0

To upgrade Chocolatey Toast Extension (Unofficial), run the following command from the command line or from PowerShell:

C:\> choco upgrade chocolatey-toast.extension --version 1.0.0

Files

Hide
  • extensions\Show-ChocolateyUninstallSuccessToast.ps1 Show
    # Chocolatey Toast Extension (Unofficial)
    # Copyright (C) 2016-2017 Steven Lietaer, All rights reserved.
    # 
    # This program is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    # 
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    # 
    # You should have received a copy of the GNU General Public License
    # along with this program. If not, see <http://www.gnu.org/licenses/>.
    
    function Show-ChocolateyUninstallSuccessToast {
        param(
          [string] $packageName = $null,
          [string] $packageVersion = $null
        )
    
        $title = 'Package uninstallation successful';
        $text = "Chocolatey successfully uninstalled $packageName ($packageVersion).";
        $success = $true;
        $popup = $true;
        $expirationTime = [System.DateTime]::Now.AddHours(1);
    
        Show-ChocolateyToast $title $text $success $popup $expirationTime;
    }
  • extensions\Show-ChocolateyUninstallStartedToast.ps1 Show
    # Chocolatey Toast Extension (Unofficial)
    # Copyright (C) 2016-2017 Steven Lietaer, All rights reserved.
    # 
    # This program is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    # 
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    # 
    # You should have received a copy of the GNU General Public License
    # along with this program. If not, see <http://www.gnu.org/licenses/>.
    
    function Show-ChocolateyUninstallStartedToast {
        param(
          [string] $packageName = $null,
          [string] $packageVersion = $null
        )
    
        $title = 'Package uninstallation started';
        $text = "Chocolatey is uninstalling $packageName ($packageVersion).";
        $success = $true;
        $popup = $true;
        $expirationTime = [System.DateTime]::Now.AddSeconds(30);
    
        Show-ChocolateyToast $title $text $success $popup $expirationTime;
    }
  • extensions\Show-ChocolateyUninstallFailedToast.ps1 Show
    # Chocolatey Toast Extension (Unofficial)
    # Copyright (C) 2016-2017 Steven Lietaer, All rights reserved.
    # 
    # This program is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    # 
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    # 
    # You should have received a copy of the GNU General Public License
    # along with this program. If not, see <http://www.gnu.org/licenses/>.
    
    function Show-ChocolateyUninstallFailedToast {
        param(
          [string] $packageName = $null,
          [string] $packageVersion = $null
        )
    
        $title = 'Package uninstallation failed!';
        $text = "Chocolatey failed to uninstall $packageName ($packageVersion).";
        $success = $false;
        $popup = $true;
        $expirationTime = [System.DateTime]::Now.AddHours(24);
    
        Show-ChocolateyToast $title $text $success $popup $expirationTime;
    }
  • extensions\Init-ChocolateyToast.ps1 Show
    # Chocolatey Toast Extension (Unofficial)
    # Copyright (C) 2016-2017 Steven Lietaer, All rights reserved.
    # 
    # This program is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    # 
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    # 
    # You should have received a copy of the GNU General Public License
    # along with this program. If not, see <http://www.gnu.org/licenses/>.
    
    function Init-ChocolateyToast {
        param(
          [string] $appId = 'Chocolatey.Toast'
        )
    
        $registryPath = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings';
        
        if (!(Test-Path -Path "$registryPath\$appId"))
        {
            New-Item -Path $registryPath -Name $appId | Out-Null;
            
            New-ItemProperty -Path "$registryPath\$appId" -Name 'ShowInActionCenter' -Value 1 -PropertyType 'DWORD' | Out-Null;
        }
    }
  • extensions\images\toast-success.png
  • extensions\images\toast-failure.png
  • extensions\chocolatey-toast.psm1 Show
    # Chocolatey Toast Extension (Unofficial)
    # Copyright (C) 2016-2017 Steven Lietaer, All rights reserved.
    # 
    # This program is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    # 
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    # 
    # You should have received a copy of the GNU General Public License
    # along with this program. If not, see <http://www.gnu.org/licenses/>.
    
    $ScriptPath = Split-Path -parent $MyInvocation.MyCommand.Definition;
    
    Import-Module "$ScriptPath\Init-ChocolateyToast.ps1";
    Import-Module "$ScriptPath\Show-ChocolateyToast.ps1";
    Import-Module "$ScriptPath\Show-ChocolateyInstallFailedToast.ps1";
    Import-Module "$ScriptPath\Show-ChocolateyInstallStartedToast.ps1";
    Import-Module "$ScriptPath\Show-ChocolateyInstallSuccessToast.ps1";
    Import-Module "$ScriptPath\Show-ChocolateyUninstallFailedToast.ps1";
    Import-Module "$ScriptPath\Show-ChocolateyUninstallStartedToast.ps1";
    Import-Module "$ScriptPath\Show-ChocolateyUninstallSuccessToast.ps1";
    
    Export-ModuleMember -Function Show-ChocolateyToast;
    Export-ModuleMember -Function Show-ChocolateyInstallFailedToast;
    Export-ModuleMember -Function Show-ChocolateyInstallStartedToast;
    Export-ModuleMember -Function Show-ChocolateyInstallSuccessToast;
    Export-ModuleMember -Function Show-ChocolateyUninstallFailedToast;
    Export-ModuleMember -Function Show-ChocolateyUninstallStartedToast;
    Export-ModuleMember -Function Show-ChocolateyUninstallSuccessToast;
    
  • extensions\Show-ChocolateyToast.ps1 Show
    # Chocolatey Toast Extension (Unofficial)
    # Copyright (C) 2016-2017 Steven Lietaer, All rights reserved.
    # 
    # This program is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    # 
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    # 
    # You should have received a copy of the GNU General Public License
    # along with this program. If not, see <http://www.gnu.org/licenses/>.
    
    function Show-ChocolateyToast {
        param(
          [string] $title = $null,
          [string] $text = $null,
          [boolean] $success = $true,
          [boolean] $popup = $true,
          [DateTime] $expirationTime = [System.DateTime]::MinValue
        )
    
        try
        {
            $installDirectory = $env:ChocolateyInstall;
    
            $toastAppId = 'Chocolatey Toast';
            $toastTag = [System.DateTime]::Now.Ticks.ToString().SubString(4);
            $toastTitle = $title;
            $toastText = $text;
            $toastImage = "file:///$installDirectory\extensions\chocolatey-toast\images\toast-failure.png";
    
            if ($success)
            {
                $toastImage = "file:///$installDirectory\extensions\chocolatey-toast\images\toast-success.png";
            }
    
            if ($expirationTime -eq [System.DateTime]::MinValue)
            {
                if ($success)
                {
                    $expirationTime = [DateTime]::Now.AddHours(1);
                }
                else
                {
                    $expirationTime = [DateTime]::Now.AddHours(24);
                }
            }
    
            if ([System.Environment]::OSVersion.Version.Major -eq 10)
            {
                Init-ChocolateyToast $toastAppId;
            
                [Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null;
                $toastTemplate = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastImageAndText02);
    
                $toastXml = [xml] $toastTemplate.GetXml();
    
                $imageAltAttribute = $toastXml.CreateAttribute('alt');
                $imageAltAttribute.Value = $toastAppId;
    
                $imageSrcAttribute = $toastXml.CreateAttribute('src');
                $imageSrcAttribute.Value = $toastImage;
        
                $toastXml.GetElementsByTagName('image')[0].Attributes.SetNamedItem($imageAltAttribute) | Out-Null;
                $toastXml.GetElementsByTagName('image')[0].Attributes.SetNamedItem($imageSrcAttribute) | Out-Null;
                $toastXml.GetElementsByTagName('text')[0].AppendChild($toastXml.CreateTextNode($toastTitle)) | Out-Null;
                $toastXml.GetElementsByTagName('text')[1].AppendChild($toastXml.CreateTextNode($toastText)) | Out-Null;
        
                $xml = New-Object Windows.Data.Xml.Dom.XmlDocument;
                $xml.LoadXml($toastXml.OuterXml);
    
                $toast = [Windows.UI.Notifications.ToastNotification]::new($xml);
                $toast.Group = $toastAppId;
              	$toast.Tag = $toastTag;
                $toast.ExpirationTime = $expirationTime;
                $toast.SuppressPopup = ($popup -eq $false);
    
                $notifier = [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($toastAppId);
                $notifier.Show($toast);
            }
        }
        catch
        {
            # Ignore exception.
        }
    }
  • extensions\Show-ChocolateyInstallSuccessToast.ps1 Show
    # Chocolatey Toast Extension (Unofficial)
    # Copyright (C) 2016-2017 Steven Lietaer, All rights reserved.
    # 
    # This program is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    # 
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    # 
    # You should have received a copy of the GNU General Public License
    # along with this program. If not, see <http://www.gnu.org/licenses/>.
    
    function Show-ChocolateyInstallSuccessToast {
        param(
          [string] $packageName = $null,
          [string] $packageVersion = $null
        )
    
        $title = 'Package installation successful';
        $text = "Chocolatey successfully installed $packageName ($packageVersion).";
        $success = $true;
        $popup = $true;
        $expirationTime = [System.DateTime]::Now.AddHours(1);
    
        Show-ChocolateyToast $title $text $success $popup $expirationTime;
    }
  • extensions\Show-ChocolateyInstallStartedToast.ps1 Show
    # Chocolatey Toast Extension (Unofficial)
    # Copyright (C) 2016-2017 Steven Lietaer, All rights reserved.
    # 
    # This program is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    # 
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    # 
    # You should have received a copy of the GNU General Public License
    # along with this program. If not, see <http://www.gnu.org/licenses/>.
    
    function Show-ChocolateyInstallStartedToast {
        param(
          [string] $packageName = $null,
          [string] $packageVersion = $null
        )
    
        $title = 'Package installation started';
        $text = "Chocolatey is installing $packageName ($packageVersion).";
        $success = $true;
        $popup = $true;
        $expirationTime = [System.DateTime]::Now.AddSeconds(30);
    
        Show-ChocolateyToast $title $text $success $popup $expirationTime;
    }
  • extensions\Show-ChocolateyInstallFailedToast.ps1 Show
    # Chocolatey Toast Extension (Unofficial)
    # Copyright (C) 2016-2017 Steven Lietaer, All rights reserved.
    # 
    # This program is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    # 
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    # 
    # You should have received a copy of the GNU General Public License
    # along with this program. If not, see <http://www.gnu.org/licenses/>.
    
    function Show-ChocolateyInstallFailedToast {
        param(
          [string] $packageName = $null,
          [string] $packageVersion = $null
        )
    
        $title = 'Package installation failed!';
        $text = "Chocolatey failed to install $packageName ($packageVersion).";
        $success = $false;
        $popup = $true;
        $expirationTime = [System.DateTime]::Now.AddHours(24);
    
        Show-ChocolateyToast $title $text $success $popup $expirationTime;
    }

Virus Scan Results

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Dependencies

Package Maintainer(s)

Software Author(s)

  • Steven Lietaer

Copyright

(c) 2016-2017 Steven Lietaer, All rights reserved.

Tags

Release Notes

https://github.com/Nevets82/ChocolateyToastExtension

Version History

Version Downloads Last updated Status
Chocolatey Toast Extension (Unofficial) 1.0.0 407 Friday, January 27, 2017 approved

Discussion for the Chocolatey Toast Extension (Unofficial) Package

Ground rules:

  • This discussion is only about Chocolatey Toast Extension (Unofficial) and the Chocolatey Toast Extension (Unofficial) package. If you have feedback for Chocolatey, please contact the google group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or Chocolatey Toast Extension (Unofficial), or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.

comments powered by Disqus
Chocolatey.org uses cookies to enhance the user experience of the site.
Ok