tis-notepadplusplus
8.1.4-8
Notepad++ is a text editor and source code editor for use with Microsoft Windows
16400 downloads

Description
- package : tis-notepadplusplus
- name : Notepad++
- version : 8.1.4-8
- categories : Office,Development
- maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ,Gaëtan SEGAT
- installed_size : 2527232
- editor : Don Ho
- licence : GPL
- signature_date : 2021-08-31T17:22:54.575406
- size : 3.97 Mo
- locale : all
- target_os : windows
- impacted_process : notepad++
- architecture : x86
- Homepage : https://notepad-plus-plus.org/
control
package : tis-notepadplusplus
version : 8.1.4-8
architecture : x86
section : base
priority : optional
name : Notepad++
categories : Office,Development
maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ,Gaëtan SEGAT
description : Notepad++ is a text editor and source code editor for use with Microsoft Windows
depends :
conflicts :
maturity : PROD
locale : all
target_os : windows
min_wapt_version : 1.8
sources : https://notepad-plus-plus.org/downloads/
installed_size : 2527232
impacted_process : notepad++
description_fr : Notepad++ est un éditeur de texte libre générique, fonctionnant sous Windows
description_pl :
description_de :
description_es :
description_pt :
description_it :
description_nl :
description_ru :
audit_schedule :
editor : Don Ho
keywords : text,editor,notepad,++,note,pad
licence : GPL
homepage : https://notepad-plus-plus.org/
package_uuid : 9be7b5ca-24ce-4dfe-a4e0-6ff39c5e6dd8
valid_from :
valid_until :
forced_install_on :
changelog : https://notepad-plus-plus.org/news/
min_os_version : 5.1
max_os_version :
icon_sha256sum : 416085afa2c9d514cd68126bd43084388b210a5f93da147c0a80db1821cf28a2
signer : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature : ryNhkzcPg9uNQrgQUPCxlEZiNuxWXtBvo6PFVHOPp9q1HAicpftl1bOXBCTBxZl/UCo6znGW+WS6AeVdPAUtbDVn/VINBOdxqYeSfeDKdYzhPwXSjdbYILuH6IPlz/48XTTtg6bjFDWu/Ks9TmBNhHWuwFffnhQeEfJxCBgG3r7KeZMltgd0BJN6YmLfuQtjY4JSvX3oGKH606+dqw2ZbXtxM5fQPacSn3I9Pd8XDtqRGQqq0/M9uC9SEfAQOI8uGgO64y+/9L1ekiKPByMrcSrwJBHvg2buLmcHFsTurQl9v2dzS5MguXq0+WX0m+ssZd2otPnu1T+VfQDzPTVX1g==
signature_date : 2021-08-31T17:22:54.575406
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
Setup.py
# -*- coding: utf-8 -*-
from setuphelpers import *
import platform
import json
# Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
bin_contains = 'npp'
silent_args = '/S'
app_uninstallkey = 'Notepad++'
def install():
# Declaring local variables
package_version = control.get_software_version()
bin_name = glob.glob('*%s*.exe' % bin_contains)[0]
# Installing the package
print("Installing: %s" % bin_name)
install_exe_if_needed(bin_name,
silentflags=silent_args,
key=app_uninstallkey,
min_version=package_version,
)
def session_setup():
print('Disabling: update check')
#C:\Users\user\AppData\Roaming\Notepad++
app_roam_appdata = makepath(application_data,'Notepad++')
conf_file_loc = makepath(app_roam_appdata,'config.xml')
config_xml_content = r"""<?xml version="1.0" encoding="Windows-1252" ?>
<NotepadPlus>
<GUIConfigs>
<GUIConfig name="ToolBar" visible="yes">standard</GUIConfig>
<GUIConfig name="StatusBar">show</GUIConfig>
<GUIConfig name="TabBar" dragAndDrop="yes" drawTopBar="yes" drawInactiveTab="yes" reduce="yes" closeButton="yes" doubleClick2Close="no" vertical="no" multiLine="no" hide="no" quitOnEmpty="no" />
<GUIConfig name="ScintillaViewsSplitter">vertical</GUIConfig>
<GUIConfig name="UserDefineDlg" position="undocked">hide</GUIConfig>
<GUIConfig name="TabSetting" replaceBySpace="no" size="4" />
<GUIConfig name="AppPosition" x="0" y="0" width="1100" height="700" isMaximized="no" />
<GUIConfig name="noUpdate" intervalDays="15" nextUpdateDate="20200415">yes</GUIConfig>
<GUIConfig name="Auto-detection">yes</GUIConfig>
<GUIConfig name="CheckHistoryFiles">no</GUIConfig>
<GUIConfig name="TrayIcon">no</GUIConfig>
<GUIConfig name="MaitainIndent">yes</GUIConfig>
<GUIConfig name="TagsMatchHighLight" TagAttrHighLight="yes" HighLightNonHtmlZone="no">yes</GUIConfig>
<GUIConfig name="RememberLastSession">yes</GUIConfig>
<GUIConfig name="DetectEncoding">yes</GUIConfig>
<GUIConfig name="NewDocDefaultSettings" format="0" encoding="4" lang="0" codepage="-1" openAnsiAsUTF8="yes" />
<GUIConfig name="langsExcluded" gr0="0" gr1="0" gr2="0" gr3="0" gr4="0" gr5="0" gr6="0" gr7="0" gr8="0" gr9="0" gr10="0" gr11="0" gr12="0" langMenuCompact="yes" />
<GUIConfig name="Print" lineNumber="yes" printOption="3" headerLeft="" headerMiddle="" headerRight="" footerLeft="" footerMiddle="" footerRight="" headerFontName="" headerFontStyle="0" headerFontSize="0" footerFontName="" footerFontStyle="0" footerFontSize="0" margeLeft="0" margeRight="0" margeTop="0" margeBottom="0" />
<GUIConfig name="Backup" action="0" useCustumDir="no" dir="" isSnapshotMode="yes" snapshotBackupTiming="7000" />
<GUIConfig name="TaskList">yes</GUIConfig>
<GUIConfig name="MRU">yes</GUIConfig>
<GUIConfig name="URL">2</GUIConfig>
<GUIConfig name="globalOverride" fg="no" bg="no" font="no" fontSize="no" bold="no" italic="no" underline="no" />
<GUIConfig name="auto-completion" autoCAction="3" triggerFromNbChar="1" autoCIgnoreNumbers="yes" funcParams="yes" />
<GUIConfig name="auto-insert" parentheses="no" brackets="no" curlyBrackets="no" quotes="no" doubleQuotes="no" htmlXmlTag="no" />
<GUIConfig name="sessionExt"></GUIConfig>
<GUIConfig name="workspaceExt"></GUIConfig>
<GUIConfig name="MenuBar">show</GUIConfig>
<GUIConfig name="Caret" width="1" blinkRate="600" />
<GUIConfig name="ScintillaGlobalSettings" enableMultiSelection="no" />
<GUIConfig name="openSaveDir" value="0" defaultDirPath="" />
<GUIConfig name="titleBar" short="no" />
<GUIConfig name="wordCharList" useDefault="yes" charsAdded="" />
<GUIConfig name="delimiterSelection" leftmostDelimiter="40" rightmostDelimiter="41" delimiterSelectionOnEntireDocument="no" />
<GUIConfig name="multiInst" setting="0" />
<GUIConfig name="MISC" fileSwitcherWithoutExtColumn="no" backSlashIsEscapeCharacterForSql="yes" newStyleSaveDlg="yes" isFolderDroppedOpenFiles="no" docPeekOnTab="no" docPeekOnMap="no" />
<GUIConfig name="searchEngine" searchEngineChoice="2" searchEngineCustom="" />
<GUIConfig name="SmartHighLight" matchCase="no" wholeWordOnly="yes" useFindSettings="no" onAnotherView="no">yes</GUIConfig>
<GUIConfig name="ScintillaPrimaryView" lineNumberMargin="show" bookMarkMargin="show" indentGuideLine="show" folderMarkStyle="box" lineWrapMethod="aligned" currentLineHilitingShow="show" scrollBeyondLastLine="no" disableAdvancedScrolling="no" wrapSymbolShow="hide" Wrap="no" borderEdge="yes" edge="no" edgeNbColumn="80" zoom="0" zoom2="0" whiteSpaceShow="hide" eolShow="hide" borderWidth="2" smoothFont="no" />
<GUIConfig name="DockingManager" leftWidth="200" rightWidth="200" topHeight="200" bottomHeight="200">
<ActiveTabs cont="0" activeTab="-1" />
<ActiveTabs cont="1" activeTab="-1" />
<ActiveTabs cont="2" activeTab="-1" />
<ActiveTabs cont="3" activeTab="-1" />
</GUIConfig>
</GUIConfigs>
<FindHistory nbMaxFindHistoryPath="10" nbMaxFindHistoryFilter="10" nbMaxFindHistoryFind="10" nbMaxFindHistoryReplace="10" matchWord="no" matchCase="no" wrap="yes" directionDown="yes" fifRecuisive="yes" fifInHiddenFolder="no" dlgAlwaysVisible="no" fifFilterFollowsDoc="no" fifFolderFollowsDoc="no" searchMode="0" transparencyMode="1" transparency="150" dotMatchesNewline="no" isSearch2ButtonsMode="no" />
<History nbMaxFile="10" inSubMenu="no" customLength="-1" />
<ProjectPanels>
<ProjectPanel id="0" workSpaceFile="" />
<ProjectPanel id="1" workSpaceFile="" />
<ProjectPanel id="2" workSpaceFile="" />
</ProjectPanels>
</NotepadPlus>
"""
if not isfile(conf_file_loc):
if not isdir(app_roam_appdata):
mkdirs(app_roam_appdata)
file_open = open(conf_file_loc,'w')
file_open.write(config_xml_content)
file_open.close()
else:
import xml.etree.ElementTree as ET
xml_data_conf_tree = ET.parse(conf_file_loc)
xml_data_conf = xml_data_conf_tree.getroot()
for GUIConfig in xml_data_conf.iter('GUIConfig'):
if GUIConfig.get('name') == 'noUpdate':
if GUIConfig.text=='no':
GUIConfig.text='yes'
xml_data_conf_tree.write(conf_file_loc)
def update_package():
# Declaring local variables
result = False
proxies = get_proxies()
if not proxies:
proxies = get_proxies_from_wapt_console()
if control.architecture == 'x64':
bin_search = 'Installer.x64.exe'
bin_name_sub ='npp.%s.Installer.x64.exe'
else :
bin_search='Installer.exe'
bin_name_sub ='npp.%s.Installer.exe'
app_name = control.name
git_repo = 'notepad-plus-plus/notepad-plus-plus'
url_api = 'https://api.github.com/repos/%s/releases/latest' % git_repo
# Getting latest version information from official sources
print("API used is: %s" % url_api)
json_load = json.loads(wgets(url_api, proxies=proxies))
for download in json_load['assets']:
if bin_search in download['name'] :
url_dl = download['browser_download_url']
version = json_load['tag_name'].replace('v', '')
latest_bin = download['name']
break
print("Latest %s version is: %s" % (app_name, version))
print("Download URL is: %s" % url_dl)
# Downloading latest binaries
if not isfile(latest_bin):
print("Downloading: %s" % latest_bin)
wget(url_dl, latest_bin, proxies=proxies)
# Checking version from file
version_from_file = get_version_from_binary(latest_bin,'FileVersion')
if not version_from_file.startswith(version):
# remove additional .0 at the end of the version from file
'.'.join(get_version_from_binary(latest_bin,'FileVersion').split('.')[:3])
print("Changing version to the version number of the binary")
version = version_from_file
os.rename(latest_bin,bin_name_sub % version)
# Changing version of the package
if Version(version) > Version(control.get_software_version()):
print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
result = True
control.version = '%s-%s' % (Version(version), control.version.split('-', 1)[-1])
#control.set_software_version(Version(version))
control.save_control_to_wapt()
# Deleting outdated binaries
remove_outdated_binaries(version)
# Validating update-package-sources
return result
def get_proxies():
r"""Return system proxy with the urllib python library
>>> get_proxies()
{'http': 'http://srvproxy.ad.domain.lan:8080',
'https': 'http://srvproxy.ad.domain.lan:8080'}
"""
if platform.python_version_tuple()[0] == '3':
from urllib.request import getproxies
else:
from urllib import getproxies
return getproxies()
def get_proxies_from_wapt_console():
r"""Return proxy information from the current user WAPT console
>>> get_proxies_from_wapt_console()
{'http': 'http://srvproxy.ad.domain.lan:8080',
'https': 'http://srvproxy.ad.domain.lan:8080'}
"""
proxies = {}
if platform.system() == 'Windows':
waptconsole_ini_path = makepath(user_local_appdata(), 'waptconsole', 'waptconsole.ini')
else:
waptconsole_ini_path = makepath(user_home_directory(), '.config', 'waptconsole', 'waptconsole.ini')
if isfile(waptconsole_ini_path):
proxy_wapt = inifile_readstring(waptconsole_ini_path, 'global', 'http_proxy')
if proxy_wapt:
proxies = {'http': proxy_wapt, 'https': proxy_wapt}
return proxies
def get_version_from_binary(filename, property_name='ProductVersion'):
r""" Get installer version from file informations, for now, only exe and msi files are compatibles
Args:
filename (str): path to the file
property_name (str): selected property
Returns:
str: version number
"""
if filename.endswith('.msi'):
return get_msi_properties(filename)[property_name]
else:
return get_file_properties(filename)[property_name]
def remove_outdated_binaries(version, filename_contains=None, list_extensions=['exe','msi','deb','rpm','dmg','pkg']):
r"""Remove files based on the version contained in his filename
Args:
version (str): version number of keeped files
filename_contains (str or list of str): Part of the filename that must be contained (useful for distinguishing architecture and os)
list_extensions (str or list of str): file extensions of verified files
Returns:
None
.. versionadded:: 2.0
"""
if type(list_extensions) != list:
list_extensions = [list_extensions]
if filename_contains:
if type(filename_contains) != list:
filename_contains = [filename_contains]
list_extensions = ['.' + ext for ext in list_extensions if ext[0] != '.']
for file_ext in list_extensions:
for bin_in_dir in glob.glob('*%s' % file_ext):
if not version in bin_in_dir:
remove_file(bin_in_dir)
if filename_contains:
for filename_contain in filename_contains:
if not filename_contain in bin_in_dir:
remove_file(bin_in_dir)
eadefd67e95bef200b2506caf8b3c82e0ea6c3cf895936614ba442989a08db4e : npp.8.1.4.Installer.exe
7b94c4aa889cfdec13f0ae7e3371906631ef0f3d80820a97632af1882ab7dc9d : setup.py
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
416085afa2c9d514cd68126bd43084388b210a5f93da147c0a80db1821cf28a2 : WAPT/icon.png
939a21719ae1ed38c332c7ad775299f151b77ef63b7c9e92880e58dc2e8b5bfe : WAPT/control