Détails du package smp-poweroff_56_all.wapt
retour Revenir à la liste des packages

smp-poweroff

ATTENTION CE DÉPÔT n'est plus compatible 1.3 vous devez migrer en 1.5.1.21 !

Fichier control :

package           : smp-poweroff
version           : 56
architecture      : all
section           : base
priority          : optional
maintainer        : Simon Fonteneau
description       : automatic package for poweroff
depends           : 
conflicts         : 
maturity          : 
locale            : 
min_os_version    : 
max_os_version    : 
min_wapt_version  : 
sources           : 
installed_size    : 
signer            : wapt.lesfourmisduweb.org
signer_fingerprint: 8da83ebdac1a25e820b186510d049f47407b11835b0664fdc5bacd3595b1671d
signature         : vS8uB3FmllrWFXPqVY1SGpYqC0IZPtRL3cRpi8OVJWKoqlRDLcEVds5WTufRPqgatLcucTMUjqQ3fo0DQlS23LX5armCXO/LPO2rkqefSUJF2ykpr2QqN9u1eVKonNpx8G9jVJI3ymGNu24ZkciL/z2Jfe7FO8oWmzkb4jWd/8vQhu1S/gyYCqcdUF7+UvNdk0apgjJIk6G3qj7CVlkYNANWkRcM/By9oh7+N1MfVArK4NhOXfK5SCSjAy0UldifPFErk2TUrlyOq8W6cKPiLSVc/kB7j1MYkmRx5ZYZWJjXIei/aCh5sAAkQqTb7fhp9zNNYII+bzcN6/2V5LPYsw==
signature_date    : 20171122-013710
signed_attributes : package,version,architecture,section,priority,maintainer,description,depends,conflicts,maturity,locale,min_os_version,max_os_version,min_wapt_version,sources,installed_size,signer,signer_fingerprint,signature_date,signed_attributes






Fichier setup.py :

# -*- coding: utf-8 -*-
from setuphelpers import *
import os.path
import time

# registry key(s) where WAPT will find how to remove the application(s)
uninstallkey = []


def install():
    with disable_file_system_redirection():
        if not isfile(makepath(system32(),'shutdown_test_session.bat')):
            filecopyto('shutdown_test_session.bat',system32())

    if windows_version() > Version('6.0'):
        run('schtasks /Create /TN "test_shutdown_windows" /f /RU SYSTEM /xml test_shutdown_windows.xml')
        time.sleep(5)
        run('schtasks /Create /TN "force_shutdown_windows" /f /RU SYSTEM /xml force_shutdown_windows.xml')
    else:
        if 'test_shutdown_windows' in run('schtasks') :
            run('schtasks /delete /f /tn "test_shutdown_windows"')
        create_daily_task('test_shutdown_windows',r'cmd',r'C:\Windows\System32\shutdown_test_session.bat', max_runtime=120,start_hour=18,start_minute=30)

        if 'force_shutdown_windows' in run('schtasks') :
            run('schtasks /delete /f /tn "force_shutdown_windows"')
        create_daily_task('force_shutdown_windows','shutdown','-s -f -t 3', max_runtime=120,start_hour=02,start_minute=00)



    listtask = run('schtasks')
    if not "test_shutdown_windows" in listtask :
        error('La tache planifier nest pas installe')

    listtask = run('schtasks')
    if not "force_shutdown_windows" in listtask :
        error('La tache planifier nest pas installe')