33import subprocess
44import requests
55import os
6-
6+ import shutil
77
88diretorioarcom = "c:\\ arcom"
99
@@ -46,15 +46,18 @@ def save_response_content(response, destination):
4646
4747#Funcões que são executadas de acordo com o retorno do valor do GUI
4848def executarscripts (values ):
49- if values [0 ]:
49+
50+ if values ['chocoinstall' ]:
5051 print ("Executando chocolatey" )
5152 subprocess .call ('C:\Windows\System32\powershell.exe Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString("https://chocolatey.org/install.ps1"))' , shell = True )
52- if values [1 ]:
53+
54+ if values ['programsinstall' ]:
5355 print ("Executando Instalacao" )
5456 programas = ["adobereader" , "javaruntime --x86SteamSteam" , "spark" , "teamviewer" , "anydesk.install" , "googlechrome" , "firefox" ]
5557 for programa in programas :
5658 subprocess .call ("choco install -y " + programa , shell = True )
57- if values [2 ]:
59+
60+ if values ['sisbrinstall' ]:
5861 createdirarcom ()
5962 print ("Baixando sisbr 2.0" )
6063 if not os .path .isfile (diretorioarcom + "\\ sisbr2.0.exe" ):
@@ -64,29 +67,37 @@ def executarscripts(values):
6467 print ("Download finalizado" )
6568 print ("Executando instalacao" )
6669 subprocess .call (diretorioarcom + "\\ sisbr2.0.exe" )
67- if values [3 ]:
70+
71+ if values ['citrixcleanup' ]:
6872 print ("Removendo registro" )
6973 subprocess .call ("reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing /f" )
70- if values [4 ]:
74+
75+ if values ['sicoobnetinstall' ]:
7176 createdirarcom ()
7277 if not os .path .isfile (diretorioarcom + "\\ instalador-sicoobnet-windows-amd64.exe" ):
7378 print ("Baixando Sicoobnet Empresarial" )
7479 urlsicoobnet = "https://office-sicoob-instalador.s3-us-west-2.amazonaws.com/instalador-sicoobnet-windows-amd64.exe"
7580 download = requests .get (urlsicoobnet , allow_redirects = True )
7681 open (diretorioarcom + "\\ instalador-sicoobnet-windows-amd64.exe" , 'wb' ).write (download .content )
7782 subprocess .call (diretorioarcom + "\\ instalador-sicoobnet-windows-amd64.exe" )
83+
84+ if values ['limpezageral' ]:
85+ if os .path .exists (diretorioarcom ):
86+ shutil .rmtree (diretorioarcom )
87+
7888
7989#Funcao que gera o a GUI
8090def Menu ():
8191 sg .theme ('LightBlue' )
8292 sg .SetOptions (text_justification = 'right' )
8393
8494 flags = [
85- [sg .Checkbox ('Instalar Chocolatey' , size = (24 , 1 ))],
86- [sg .Checkbox ('Instalar programas padrão' , size = (24 , 1 ))],
87- [sg .Checkbox ('Instalar sisbr 2.0' , size = (24 , 1 ))],
88- [sg .Checkbox ('Remover registro do Citrix' , size = (24 , 1 ))],
89- [sg .Checkbox ('Instalar SicoobNet empresarial' , size = (24 , 1 ))],
95+ [sg .Checkbox ('Instalar Chocolatey' , key = 'chocoinstall' , size = (24 , 1 ))],
96+ [sg .Checkbox ('Instalar programas padrão' , key = 'programsinstall' , size = (24 , 1 ))],
97+ [sg .Checkbox ('Instalar sisbr 2.0' , key = 'sisbrinstall' , size = (24 , 1 ))],
98+ [sg .Checkbox ('Remover registro do Citrix' , key = 'citrixcleanup' , size = (24 , 1 ))],
99+ [sg .Checkbox ('Instalar SicoobNet empresarial' , key = 'sicoobnetinstall' , size = (24 , 1 ))],
100+ [sg .Checkbox ('Limpeza do diretório Arcom' , key = 'limpezageral' , size = (24 , 1 ))],
90101 ]
91102
92103 layout = [[sg .Frame ('Opções:' , flags , font = 'Any 12' , title_color = 'black' )], [
0 commit comments