Downloads:
957
Downloads of v 1.0.3:
833
Last Update:
25 Mar 2021
Package Maintainer(s):
Software Author(s):
- David Yair
Tags:
notepadplusplus-plugin.template- Software Specific:
- Software Site
- Package Specific:
- Package Source
- Package outdated?
- Package broken?
- Contact Maintainers
- Contact Site Admins
- Software Vendor?
- Report Abuse
- Download
NotepadPlusPlus-Plugin Template
- 1
- 2
- 3
1.0.3 | Updated: 25 Mar 2021
- Software Specific:
- Software Site
- Package Specific:
- Package Source
- Package outdated?
- Package broken?
- Contact Maintainers
- Contact Site Admins
- Software Vendor?
- Report Abuse
- Download
Downloads:
957
Downloads of v 1.0.3:
833
Maintainer(s):
Software Author(s):
- David Yair
NotepadPlusPlus-Plugin Template 1.0.3
Legal Disclaimer: Neither this package nor Chocolatey Software, Inc. are affiliated with or endorsed by David Yair. The inclusion of David Yair trademark(s), if any, upon this webpage is solely to identify David Yair goods or services and not for commercial purposes.
- 1
- 2
- 3
All Checks are Passing
3 Passing Tests
Deployment Method: Individual Install, Upgrade, & Uninstall
To install NotepadPlusPlus-Plugin Template, run the following command from the command line or from PowerShell:
To upgrade NotepadPlusPlus-Plugin Template, run the following command from the command line or from PowerShell:
To uninstall NotepadPlusPlus-Plugin Template, run the following command from the command line or from PowerShell:
Deployment Method:
This applies to both open source and commercial editions of Chocolatey.
1. Enter Your Internal Repository Url
(this should look similar to https://community.chocolatey.org/api/v2/)
2. Setup Your Environment
1. Ensure you are set for organizational deployment
Please see the organizational deployment guide
2. Get the package into your environment
Option 1: Cached Package (Unreliable, Requires Internet - Same As Community)-
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://community.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
-
Open Source
-
Download the package:
Download - Follow manual internalization instructions
-
-
Package Internalizer (C4B)
-
Run: (additional options)
choco download notepadplusplus-plugin.template --internalize --source=https://community.chocolatey.org/api/v2/
-
For package and dependencies run:
choco push --source="'INTERNAL REPO URL'"
- Automate package internalization
-
Run: (additional options)
3. Copy Your Script
choco upgrade notepadplusplus-plugin.template -y --source="'INTERNAL REPO 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 notepadplusplus-plugin.template -y --source="'INTERNAL REPO URL'"
$exitCode = $LASTEXITCODE
Write-Verbose "Exit code was $exitCode"
$validExitCodes = @(0, 1605, 1614, 1641, 3010)
if ($validExitCodes -contains $exitCode) {
Exit 0
}
Exit $exitCode
- name: Install notepadplusplus-plugin.template
win_chocolatey:
name: notepadplusplus-plugin.template
version: '1.0.3'
source: INTERNAL REPO URL
state: present
See docs at https://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html.
chocolatey_package 'notepadplusplus-plugin.template' do
action :install
source 'INTERNAL REPO URL'
version '1.0.3'
end
See docs at https://docs.chef.io/resource_chocolatey_package.html.
cChocoPackageInstaller notepadplusplus-plugin.template
{
Name = "notepadplusplus-plugin.template"
Version = "1.0.3"
Source = "INTERNAL REPO URL"
}
Requires cChoco DSC Resource. See docs at https://github.com/chocolatey/cChoco.
package { 'notepadplusplus-plugin.template':
ensure => '1.0.3',
provider => 'chocolatey',
source => 'INTERNAL REPO URL',
}
Requires Puppet Chocolatey Provider module. See docs at https://forge.puppet.com/puppetlabs/chocolatey.
4. If applicable - Chocolatey configuration/installation
See infrastructure management matrix for Chocolatey configuration elements and examples.
This package was approved by moderator TheCakeIsNaOH on 01 Apr 2021.
Template package for creating notepadplusplus plugin packages
Template Properties
PLUGIN_NAME
- Optional property for using this template. Use this property to specify the plugin dll file name when it is different from your plugin name.
For example if my plugin is called: 'SaveAndExec' and my plugin dll file is named: 'exec.dll' then I can pass it with: PLUGIN_NAME="exec"
Default: package-id.
Usage
- Create choco package sources using this template. See examples below:
- Example 1:
choco new bettermultiselection -t notepadplusplus-plugin
- Example 2:
choco new myplugin -t notepadplusplus-plugin PLUGIN_NAME="DllPluginFileName"
- Put your plugin dll file into tools\x32 or tools\x64 (or both)
- Pack the plugin package by with
choco pack
command
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>notepadplusplus-plugin-[[PackageNameLower]]</id>
<version>[[PackageVersion]]</version>
<title>Notepad++ Plugin - [[PackageName]] (Install)</title>
<authors>David Yair</authors>
<owners>David Yair</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>
Install Notepad++ Plugin [[PackageName]]
## Package parameters
- `/nppInstallDir:{Notepad++ installation dir}` - Provide full path to notepad++ existing installation dir. If not provided will search the default locations.
- `/skipIfAlreadyInstalled` - Instructs the installing script to skip if an any plugin existing-installation is detected.
- `/removePluginDir` - Uninstall flag to remove the whole plugin dir upon uninstall. Default behavior is to remove the whole dir only when it is empty after uninstalling.
Example 1: `choco install notepadplusplus-plugin-[[PackageNameLower]] --yes --params " /nppInstallDir:""C:\My\Notepad++"" "`
Example 2: `choco install notepadplusplus-plugin-[[PackageNameLower]] --yes --params " /nppInstallDir:""C:\My\Notepad++"" /skipIfAlreadyInstalled "`
Example 3: `choco uninstall notepadplusplus-plugin-[[PackageNameLower]] --yes --params " /nppInstallDir:""C:\My\Notepad++"" /removePluginDir "`
</description>
<summary>This package is a plugin installation for 'Notepad++' which is a free source code editor and Notepad replacement that supports several languages.</summary>
<tags>notepad notepadplusplus-plugin notepad-plus-plus editor text development foss</tags>
<dependencies>
<dependency id="notepadplusplus.install" />
</dependencies>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
$pluginName = "[[PLUGIN_NAME]]"
$attribNamePluginName = "[[PLUGIN_NAME" + "]]"
if ((! $pluginName) -or ($pluginName.trim() -eq "") -or ($pluginName.trim() -eq $attribNamePluginName)) {Write-Host "Updating plugin-name to: '[[PackageName]]'" -ForegroundColor Cyan; $pluginName = "[[PackageName]]"}
$pluginDirName = $pluginName
$notepadPlusPlusSoftwareName = 'Notepad\+\+*'
$toolsPath = Split-Path -parent $MyInvocation.MyCommand.Definition
$pluginDllFileName = "$pluginName.dll"
$removePluginDir = $false
# Load helpers file
$helpersFile = Join-Path $toolsPath "helpers.ps1"
$helpersFile = Get-Item $helpersFile
Write-Host "Loading helpers file: $helpersFile"
. "$helpersFile"
# Read package parameters for notepad++ installation dir:
$pp = Get-PackageParameters
if ($pp -and $pp.Keys.Count -gt 0) {Write-Host "`nReceived package params:" -ForegroundColor Cyan; $pp.Keys | foreach {Write-Host $_ = $pp[$_]}; Write-Host "`n" }
if ($pp['nppInstallDir']) { $installLocation = $pp['nppInstallDir']}
if ($pp['removePluginDir']) { $removePluginDir = $true}
# Attempt to get current installed notepad++ dir
if (! $installLocation) {
Write-Host "Did not receive param: '/nppInstallDir' - Attempting to locate $notepadPlusPlusSoftwareName installation dir"
$installLocation = getNppInstallationDir $notepadPlusPlusSoftwareName
}
# Validate
checkNppInstallationDirIsValid $installLocation
# Prepare envs
$pluginsDir = Join-Path $installLocation "plugins"
$pluginInstallLocation = Join-Path $pluginsDir "$pluginDirName"
$pluginInstallLocationDllFile = Join-Path $pluginInstallLocation $pluginDllFileName
# Check plugin dir exists:
if (! (Test-Path -Path $pluginInstallLocation)) {Write-Warning "Plugin: '$pluginName' installation dir is missing from: $pluginInstallLocation `nNothing to do here.."; exit 0}
# Kill any running Notepad++ instances
killOpenProcesses "notepad++.exe"
# Check plugin dll file exists:
if (! (Test-Path -Path $pluginInstallLocationDllFile)) {
Write-Warning "Plugin: '$pluginName' dll file is missing from: $pluginInstallLocationDllFile"
checkAndRemovePluginDir $pluginInstallLocation
exit 0
}
# Remove plugin DLL file
$errHelpMsg = "Failed to remove plugin dll: '$pluginInstallLocationDllFile'"
Write-Host "Removing plugin dll: $pluginInstallLocationDllFile"
Remove-Item -Path $pluginInstallLocationDllFile -Force
if (! $?) {Write-Host "Error - Remove action seems to have failed`n$errHelpMsg" -ForegroundColor RED ; exit 1}
if (Test-Path -Path $pluginInstallLocationDllFile) {Write-Host "Error - Remove action seems to have failed`n$errHelpMsg" -ForegroundColor RED ; exit 1}
checkAndRemovePluginDir $pluginInstallLocation
exit 0
# Contains helper functions for chocolateyInstall.ps1 & chocolateyUninstall.ps1 scripts
function getNppInstallationDir($nppSoftwareName) {
### Returns Notepad++ installation dir or $null if it can't find it
$_nppInstallationDir = Get-AppInstallLocation $nppSoftwareName
if (! $_nppInstallationDir) {
Write-Warning "Can't find $notepadPlusPlusSoftwareName install location via Chocolatey"
# Default Install Locations
$notepadPlusPlusDefaultInstallLocations = [System.Collections.ArrayList]::new()
$notepadPlusPlusDefaultInstallLocations.add("$(Join-Path $env:ProgramFiles 'Notepad++')") | Out-Null
$notepadPlusPlusDefaultInstallLocations.add("$(Join-Path $env:ProgramW6432 'Notepad++')") | Out-Null
$notepadPlusPlusDefaultInstallLocations.add("$(Join-Path ${env:ProgramFiles(x86)} 'Notepad++')") | Out-Null
# Remove Duplicate Paths
$notepadPlusPlusDefaultInstallLocations = $notepadPlusPlusDefaultInstallLocations | select -Unique
Write-Host "Looking for $notepadPlusPlusSoftwareName installation dir in default locations:"
$notepadPlusPlusDefaultInstallLocations | foreach {Write-Host " - $_"}
# Check for first path that exists
$notepadPlusPlusDefaultInstallLocations | foreach {if (Test-path -Path $_) {$_nppInstallationDir = $_; Write-Host "Found $notepadPlusPlusSoftwareName installation dir: $_nppInstallationDir" -ForegroundColor Yellow; return $_nppInstallationDir} }
}
return $_nppInstallationDir
}
function checkNppInstallationDirIsValid($nppInstallationDir) {
### Checks that provided path is actually a Notpad++ installation dir
### by testing if it exists & contains a 'plugins' dir
Write-Host "Validating $notepadPlusPlusSoftwareName installation dir: $nppInstallationDir"
$errHelpMsg = "You can try to reinstall this package and provide the $notepadPlusPlusSoftwareName existing installation dir via param: '/nppInstallDir'. `nExample: choco install $pluginPkgName --yes --params `" /nppInstallDir:`"`"C:\Notepad++`"`" `" "
if (! $nppInstallationDir) {Write-Host "Error - No $notepadPlusPlusSoftwareName installation dir provided ('nppInstallationDir' is null) `nFailed to find $notepadPlusPlusSoftwareName installation dir`n${errHelpMsg}" -ForegroundColor RED ; exit 1}
if (! (Test-Path -Path $nppInstallationDir)) {Write-Host "Error - Missing or unreachable $notepadPlusPlusSoftwareName installation dir: '$nppInstallationDir'`n${errHelpMsg}" -ForegroundColor RED ; exit 1}
$pluginsDir = Join-Path $nppInstallationDir "plugins"
if (! (Test-Path -Path $pluginsDir)) {Write-Host "Error - Missing or unreachable $notepadPlusPlusSoftwareName plugins dir: '$pluginsDir'`n${errHelpMsg}" -ForegroundColor RED ; exit 1}
}
function checkAndRemovePluginDir($nppPluginDir) {
# Check if plugin dll dir is empty - if so then remove it
$directoryInfo = Get-ChildItem $nppPluginDir | Measure-Object
# $directoryInfo.count Returns the count of all of the objects in the directory
if (($directoryInfo.count -gt 0) -and (! $removePluginDir)) {Write-Warning "Plugin: '$pluginName' dir: ${nppPluginDir} is not empty and flag: '/removePluginDir' was not received. You should delete it by yourself later"; exit 0}
Write-Host "Removing plugin dir: '${nppPluginDir}' "
# Delete dir content
Get-ChildItem -Path $nppPluginDir -Recurse | Remove-Item -force -recurse
# Remove the dir itself
Remove-Item $nppPluginDir -Force
}
function createDir($directoryPath) {
### Creates a directory at a given path
### Fails execution upon failure
if (! (Test-Path -Path $directoryPath)) {
Write-Host "Creating dir: '$directoryPath'"
New-Item -Type Directory -Path $directoryPath -Force
if (! (Test-Path -Path $directoryPath)) {Write-Host "Error - Missing or unreachable dir: '$directoryPath'`nand also failed to create it" -ForegroundColor RED ; exit 1}
}
}
function cleanup() {
# Removes dirs: 'x32' & 'x64' from 'tools' dir
Write-Host "Cleaning unncessary files: $toolsPath\*.dll" -ForegroundColor Yellow
if (! $toolsPath) {Write-Host "Resetting var: 'toolsPath'"; $toolsPath = Split-Path -parent $MyInvocation.MyCommand.Definition}
Get-ChildItem -Recurse $toolsPath\*.dll | ForEach-Object { Remove-Item $_ -ea 0; if (Test-Path $_) { Set-Content "$_.ignore" '' } }
}
function killProcess($procName, $procId) {
Write-Host "Killing process: '$procName' pid: $procId" -ForegroundColor Yellow
& "taskkill" "/f" "/t" "/PID" "$procId"
if ($LASTEXITCODE -ne 0) {Write-Host "Error - Failed killing process: $procName" -ForegroundColor RED; return}
}
function killOpenProcesses($processName) {
$ownPid = $pid
Write-Host "Looking for processes with name: '$processName'"
$targetProcessesList = Get-WmiObject Win32_Process | where { ($_.ProcessId -ne $ownPid) -and (($_.Caption -Like "*${processName}*") -or ($_.Name -Like "*${processName}*") -or ($_.Description -Like "*${processName}*") -or ($_.ProcessName -Like "*${processName}*")) }
if (! $targetProcessesList) {return}
if (! $targetProcessesList.Count) {Write-Host "Found 1 process to kill"; killProcess $targetProcessesList.Name $targetProcessesList.ProcessId; return}
Write-Host "Found $($targetProcessesList.Count) processes to kill" -ForegroundColor Cyan
$targetProcessesList | foreach {killProcess $_.Name $_.ProcessId} # Multiple processes
}
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.
Add to Builder | Version | Downloads | Last Updated | Status |
---|---|---|---|---|
NotepadPlusPlus-Plugin Template 1.0.3 | 833 | Thursday, March 25, 2021 | Approved | |
NotepadPlusPlus-Plugin Template 1.0.0 | 124 | Monday, March 1, 2021 | Approved |
Copyright (c) 2021 David Yair
This package has no dependencies.
Ground Rules:
- This discussion is only about NotepadPlusPlus-Plugin Template and the NotepadPlusPlus-Plugin Template 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 NotepadPlusPlus-Plugin Template, 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.