|
7 | 7 |
|
8 | 8 | diretorioarcomdefault = "c:\\Arcom" |
9 | 9 |
|
| 10 | +programas = { |
| 11 | + "Adobe Reader":"adobereader", |
| 12 | + "Java" : "javaruntime --x86SteamSteam", |
| 13 | + "Spark": "spark", |
| 14 | + "Teamviewer": "teamviewer", |
| 15 | + "Anydesk": "anydesk.install", |
| 16 | + "Google Chrome": "googlechrome" , |
| 17 | + "Firefox": "firefox" |
| 18 | + } |
| 19 | + |
| 20 | + |
10 | 21 | #Cria Diretorio Arcom |
11 | 22 | def createdirarcom(diretorioarcom): |
12 | 23 | if not os.path.exists(diretorioarcom): |
@@ -52,12 +63,16 @@ def executarscripts(values): |
52 | 63 | if values['chocoinstall']: |
53 | 64 | print("Executando chocolatey") |
54 | 65 | 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) |
55 | | - |
| 66 | + |
| 67 | + for descricao, comando in programas.items(): |
| 68 | + if values[comando]: |
| 69 | + print("Instalando " + descricao ) |
| 70 | + subprocess.call("choco install -y " + comando, shell=True) |
| 71 | + |
56 | 72 | if values['programsinstall']: |
57 | | - print("Executando Instalacao") |
58 | | - programas = ["adobereader", "javaruntime --x86SteamSteam", "spark", "teamviewer", "anydesk.install", "googlechrome" , "firefox"] |
59 | | - for programa in programas: |
60 | | - subprocess.call("choco install -y " + programa, shell=True) |
| 73 | + print("Executando instalacao de todos os programas") |
| 74 | + for descricao, comando in programas.items(): |
| 75 | + subprocess.call("choco install -y " + comando, shell=True) |
61 | 76 |
|
62 | 77 | if values['sisbrinstall']: |
63 | 78 | createdirarcom(diretorioarcom) |
@@ -92,16 +107,25 @@ def executarscripts(values): |
92 | 107 | def Menu(): |
93 | 108 | sg.theme('LightBlue') |
94 | 109 | sg.SetOptions(text_justification='right') |
| 110 | + listainstalacao = [] |
95 | 111 |
|
96 | | - flags = [ |
| 112 | + for descricao, comando in programas.items(): |
| 113 | + listainstalacao.append([sg.Checkbox('Instalar ' + descricao, key=comando, size=(24, 1))]) |
| 114 | + |
| 115 | + cabecalho = [ |
97 | 116 | [sg.Text('Diretório Arcom:'),sg.Input(diretorioarcomdefault,key='diretorioarcom', background_color = 'light gray', border_width = 1, justification='left', size=(12, 1))], |
98 | 117 | [sg.Checkbox('Instalar Chocolatey', key='chocoinstall', size=(24, 1))], |
| 118 | + ] |
| 119 | + |
| 120 | + rodape = [ |
99 | 121 | [sg.Checkbox('Instalar programas padrão', key='programsinstall', size=(24, 1))], |
100 | 122 | [sg.Checkbox('Instalar Sisbr 2.0', key='sisbrinstall', size=(24, 1))], |
101 | 123 | [sg.Checkbox('Remover registro do Citrix', key='citrixcleanup', size=(24, 1))], |
102 | 124 | [sg.Checkbox('Instalar SicoobNet empresarial', key='sicoobnetinstall', size=(24, 1))], |
103 | 125 | [sg.Checkbox('Limpeza do diretório Arcom', key='limpezageral', size=(24, 1))], |
104 | 126 | ] |
| 127 | + |
| 128 | + flags = cabecalho + listainstalacao + rodape |
105 | 129 |
|
106 | 130 | layout = [[sg.Frame('Opções:', flags, font='Any 12', title_color='black')], [ |
107 | 131 | sg.Button('Executar'), sg.Button('Cancelar')]] |
|
0 commit comments