77
88diretorioarcom = "c:\\ arcom"
99
10+ #Cria Diretorio Arcom
1011def createdirarcom ():
1112 if not os .path .exists (diretorioarcom ):
1213 os .mkdir (diretorioarcom )
1314
15+
16+ # Baixa arquivos do google drives
1417def download_file_from_google_drive (id , destination ):
1518 URL = "https://docs.google.com/uc?export=download"
1619
@@ -40,6 +43,8 @@ def save_response_content(response, destination):
4043 if chunk : # filter out keep-alive new chunks
4144 f .write (chunk )
4245
46+
47+ #Funcões que são executadas de acordo com o retorno do valor do GUI
4348def executarscripts (values ):
4449 if values [0 ]:
4550 print ("Executando chocolatey" )
@@ -52,14 +57,25 @@ def executarscripts(values):
5257 if values [2 ]:
5358 createdirarcom ()
5459 print ("Baixando sisbr 2.0" )
55- if not os .path .isfile ("c: \\ arcom \\ sisbr2.0.exe" ):
60+ if not os .path .isfile (diretorioarcom + " \\ sisbr2.0.exe" ):
5661 file_id = '13E-X5fZZrj2FMZDIcLWJ94c9DgTqUA3f'
5762 destination = diretorioarcom + '\\ sisbr2.0.exe'
5863 download_file_from_google_drive (file_id , destination )
5964 print ("Download finalizado" )
6065 print ("Executando instalacao" )
61- subprocess .call (diretorioarcom + "\\ sisbr2.0.exe " )
62-
66+ subprocess .call (diretorioarcom + "\\ sisbr2.0.exe" )
67+ if values [3 ]:
68+ print ("Removendo registro" )
69+ subprocess .call ("reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing /f" )
70+ if values [4 ]:
71+ if not os .path .isfile (diretorioarcom + "\\ instalador-sicoobnet-windows-amd64.exe" ):
72+ print ("Baixando Sicoobnet Empresarial" )
73+ urlsicoobnet = "https://office-sicoob-instalador.s3-us-west-2.amazonaws.com/instalador-sicoobnet-windows-amd64.exe"
74+ download = requests .get (urlsicoobnet , allow_redirects = True )
75+ open (diretorioarcom + "\\ instalador-sicoobnet-windows-amd64.exe" , 'wb' ).write (download .content )
76+ subprocess .call (diretorioarcom + "\\ instalador-sicoobnet-windows-amd64.exe" )
77+
78+ #Funcao que gera o a GUI
6379def Menu ():
6480 sg .theme ('LightBlue' )
6581 sg .SetOptions (text_justification = 'right' )
@@ -68,6 +84,8 @@ def Menu():
6884 [sg .Checkbox ('Instalar Chocolatey' , size = (24 , 1 ))],
6985 [sg .Checkbox ('Instalar programas padrão' , size = (24 , 1 ))],
7086 [sg .Checkbox ('Instalar sisbr 2.0' , size = (24 , 1 ))],
87+ [sg .Checkbox ('Remover registro do Citrix' , size = (24 , 1 ))],
88+ [sg .Checkbox ('Instalar SicoobNet empresarial' , size = (24 , 1 ))],
7189 ]
7290
7391 layout = [[sg .Frame ('Opções:' , flags , font = 'Any 12' , title_color = 'black' )], [
0 commit comments