Downloads:

978

Downloads of v 1.0.0:

444

Last Update:

27 Jan 2017

Package Maintainer(s):

Software Author(s):

  • Steven Lietaer

Tags:

chocolatey-toast extension toast

Chocolatey Toast Extension (Unofficial)

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

1.0.0 | Updated: 27 Jan 2017

Downloads:

978

Downloads of v 1.0.0:

444

Maintainer(s):

Software Author(s):

  • Steven Lietaer

Chocolatey Toast Extension (Unofficial) 1.0.0

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

All Checks are Passing

2 Passing Test


Validation Testing Passed


Verification Testing Passed

Details

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

>

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

>

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

>

NOTE: This applies to both open source and commercial editions of Chocolatey.

1. Ensure you are set for organizational deployment

Please see the organizational deployment guide

  • Open Source or Commercial:
    • Proxy Repository - Create a proxy nuget repository on Nexus, Artifactory Pro, or a proxy Chocolatey repository on ProGet. Point your upstream to https://chocolatey.org/api/v2. Packages cache on first access automatically. Make sure your choco clients are using your proxy repository as a source and NOT the default community repository. See source command for more information.
    • You can also just download the package and push it to a repository Download

3. Enter your internal repository url

(this should look similar to https://chocolatey.org/api/v2)

4. Choose your deployment method:


choco upgrade chocolatey-toast.extension -y --source="'STEP 3 URL'" [other options]

See options you can pass to upgrade.

See best practices for scripting.

Add this to a PowerShell script or use a Batch script with tools and in places where you are calling directly to Chocolatey. If you are integrating, keep in mind enhanced exit codes.

If you do use a PowerShell script, use the following to ensure bad exit codes are shown as failures:


choco upgrade chocolatey-toast.extension -y --source="'STEP 3 URL'"
$exitCode = $LASTEXITCODE

Write-Verbose "Exit code was $exitCode"
$validExitCodes = @(0, 1605, 1614, 1641, 3010)
if ($validExitCodes -contains $exitCode) {
  Exit 0
}

Exit $exitCode

- name: Ensure chocolatey-toast.extension installed
  win_chocolatey:
    name: chocolatey-toast.extension
    state: present
    version: 1.0.0
    source: STEP 3 URL

See docs at https://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html.

Coming early 2020! Central Managment Reporting available now! More information...


chocolatey_package 'chocolatey-toast.extension' do
  action    :install
  version  '1.0.0'
  source   'STEP 3 URL'
end

See docs at https://docs.chef.io/resource_chocolatey_package.html.


Chocolatey::Ensure-Package
(
    Name: chocolatey-toast.extension,
    Version: 1.0.0,
    Source: STEP 3 URL
);

Requires Otter Chocolatey Extension. See docs at https://inedo.com/den/otter/chocolatey.


cChocoPackageInstaller chocolatey-toast.extension
{
   Name     = 'chocolatey-toast.extension'
   Ensure   = 'Present'
   Version  = '1.0.0'
   Source   = 'STEP 3 URL'
}

Requires cChoco DSC Resource. See docs at https://github.com/chocolatey/cChoco.


package { 'chocolatey-toast.extension':
  provider => 'chocolatey',
  ensure   => '1.0.0',
  source   => 'STEP 3 URL',
}

Requires Puppet Chocolatey Provider module. See docs at https://forge.puppet.com/puppetlabs/chocolatey.


salt '*' chocolatey.install chocolatey-toast.extension version="1.0.0" source="STEP 3 URL"

See docs at https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.chocolatey.html.

5. If applicable - Chocolatey configuration/installation

See infrastructure management matrix for Chocolatey configuration elements and examples.

This package was approved by moderator flcdrg on 03 Feb 2017.

Description

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


extensions\chocolatey-toast.psm1
# 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\images\toast-failure.png
 
extensions\images\toast-success.png
 
extensions\Init-ChocolateyToast.ps1
# 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\Show-ChocolateyInstallFailedToast.ps1
# 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;
}
extensions\Show-ChocolateyInstallStartedToast.ps1
# 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-ChocolateyInstallSuccessToast.ps1
# 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-ChocolateyToast.ps1
# 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-ChocolateyUninstallFailedToast.ps1
# 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\Show-ChocolateyUninstallStartedToast.ps1
# 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-ChocolateyUninstallSuccessToast.ps1
# 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;
}

Log in or click on link to see number of positives.

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.

Version Downloads Last Updated Status
Chocolatey Toast Extension (Unofficial) 1.0.0 444 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