├── .gitattributes ├── nuget.exe ├── GetPackage.py ├── LICENSE └── Update.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /nuget.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesbond90/aacommpyDownloader/HEAD/nuget.exe -------------------------------------------------------------------------------- /GetPackage.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | # Get current working directory 4 | cwd = os.getcwd() 5 | 6 | # Run nuget command to install package in current directory 7 | os.system(f'nuget install Agito.AAComm -Source "https://api.nuget.org/v3/index.json" -OutputDirectory {cwd}') -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 trunghieu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Update.py: -------------------------------------------------------------------------------- 1 | import win32com.client 2 | import os 3 | 4 | # create a new task scheduler object 5 | scheduler = win32com.client.Dispatch('Schedule.Service') 6 | 7 | # connect to the local machine task scheduler 8 | scheduler.Connect() 9 | 10 | # create a new task scheduler task object 11 | task = scheduler.NewTask(0) 12 | 13 | # configure the task scheduler settings 14 | task.RegistrationInfo.Description = 'Update AAComm' 15 | task.Settings.Enabled = True 16 | task.Settings.Hidden = False 17 | task.Settings.StartWhenAvailable = True 18 | 19 | # create a trigger for the task scheduler task 20 | trigger = task.Triggers.Create(2) # 2 means monthly trigger 21 | trigger.StartBoundary = '2023-03-05T20:00:00' # set the starting time 22 | trigger.Id = 'MyTrigger' 23 | trigger.Enabled = True 24 | monthly = trigger.MonthlyTrigger # get the monthly trigger options 25 | monthly.DaysOfMonth = [1] # run on the 1st day of the month 26 | 27 | # create an action for the task scheduler task 28 | cwd = os.getcwd() 29 | action = task.Actions.Create(0) 30 | action.Path = cwd + '\\Update.py' 31 | action.Arguments = '' 32 | 33 | # save the task scheduler task 34 | root_folder = scheduler.GetFolder('\\') 35 | root_folder.RegisterTaskDefinition( 36 | 'MyTask', # name of the task scheduler task 37 | task, # task scheduler task object 38 | 6, # create or update existing task 39 | '', # user account to run the task 40 | '', # password for user account 41 | 0) # do not specify for interactive user account 42 | --------------------------------------------------------------------------------