tis-schedule-wapt-upgrade-on-boot

1.0-4
Trigger "wapt-get upgrade" when the PC boot
662 downloads
Download
default icon

  Description 

  • package : tis-schedule-wapt-upgrade-on-boot
  • version : 1.0-4
  • architecture : all
  • categories : System and network,Security
  • maintainer : Tranquil IT
  • description : Trigger "wapt-get upgrade" when the PC boot
  • locale :
  • target_os : windows
  • min_wapt_version : 1.5
  • sources :
  • installed_size :
  • impacted_process :
  • description_fr : Lance un "wapt-get upgrade" quand le PC démarre
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor :
  • licence :
  • signature_date : 2020-10-27T17:32:25.335775

  Setup.py 

# -*- coding: utf-8 -*-
from setuphelpers import *

uninstallkey = []

# Microsoft Procedure: https://docs.microsoft.com/windows/win32/taskschd/daily-trigger-example--xml-

# Defining variables
task_name = 'auto-wapt-upgrade-on-boot'
task_file = 'auto-wapt-upgrade-on-boot.xml'
task_xml_content = """<?xml version="1.0" encoding="UTF-16"?>
<Task xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2020-01-01T00:00:00.0000</Date>
    <Author>Tranquil_IT</Author>
    <Description>WAPT auto-upgrade</Description>
  </RegistrationInfo>
  <Triggers>
    <BootTrigger>
      <Enabled>true</Enabled>
    </BootTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>S-1-5-18</UserId>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT2H</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>wapt-get</Command>
      <Arguments>-S upgrade</Arguments>
    </Exec>
  </Actions>
</Task>"""


def install():
    # Forming the xml file
    open_file = open(task_file,'w')
    open_file.write(task_xml_content)
    open_file.close()

    # Creating the scheduled task
    if windows_version() > Version('6.0'):
        run('schtasks /create /f /TN "%s" /RU SYSTEM /XML %s' % (task_name, task_file))
    else:
        if task_name in run('schtasks'):
            run('schtasks /delete /f /TN "%s"' % task_name)
        create_daily_task(task_name,'wapt-get','-S upgrade', max_runtime=120,start_hour=start_hour,start_minute=start_minute)


def uninstall():
    if task_name in run('schtasks'):
        run('schtasks /delete /f /TN "%s"' % task_name)




def update_package():
    # Initializing variables
    version = control.version.split('-')[0]

    # Incrementing version of the package
    control.version = '%s-%s'%(version,int(control.version.split('-')[-1])+1)
    control.save_control_to_wapt()
    print('Changing package version to: %s in WAPT\\control' % control.version)


										

  Changelog 



No changelog.txt.
									
  manifest.sha256