Skip to content

Commit 9d322c1

Browse files
committed
Definido diretório arcom variável
1 parent 35501dd commit 9d322c1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

install_coops_python.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
import os
66
import shutil
77

8-
diretorioarcom = "c:\\arcom"
8+
diretorioarcomdefault = "c:\\arcom"
99

1010
#Cria Diretorio Arcom
11-
def createdirarcom():
11+
def createdirarcom(diretorioarcom):
1212
if not os.path.exists(diretorioarcom):
1313
os.mkdir(diretorioarcom)
1414

@@ -46,7 +46,9 @@ def save_response_content(response, destination):
4646

4747
#Funcões que são executadas de acordo com o retorno do valor do GUI
4848
def executarscripts(values):
49-
49+
50+
diretorioarcom = values['diretorioarcom']
51+
5052
if values['chocoinstall']:
5153
print("Executando chocolatey")
5254
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)
@@ -58,7 +60,7 @@ def executarscripts(values):
5860
subprocess.call("choco install -y " + programa, shell=True)
5961

6062
if values['sisbrinstall']:
61-
createdirarcom()
63+
createdirarcom(diretorioarcom)
6264
print("Baixando sisbr 2.0")
6365
if not os.path.isfile(diretorioarcom + "\\sisbr2.0.exe"):
6466
file_id = '13E-X5fZZrj2FMZDIcLWJ94c9DgTqUA3f'
@@ -73,7 +75,7 @@ def executarscripts(values):
7375
subprocess.call("reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing /f")
7476

7577
if values['sicoobnetinstall']:
76-
createdirarcom()
78+
createdirarcom(diretorioarcom)
7779
if not os.path.isfile(diretorioarcom + "\\instalador-sicoobnet-windows-amd64.exe"):
7880
print("Baixando Sicoobnet Empresarial")
7981
urlsicoobnet = "https://office-sicoob-instalador.s3-us-west-2.amazonaws.com/instalador-sicoobnet-windows-amd64.exe"
@@ -92,6 +94,7 @@ def Menu():
9294
sg.SetOptions(text_justification='right')
9395

9496
flags = [
97+
[sg.Text('Diretório Arcom:'),sg.Input(diretorioarcomdefault,key='diretorioarcom', background_color = 'light gray', border_width = 1, justification='left', size=(12, 1))],
9598
[sg.Checkbox('Instalar Chocolatey', key='chocoinstall', size=(24, 1))],
9699
[sg.Checkbox('Instalar programas padrão', key='programsinstall', size=(24, 1))],
97100
[sg.Checkbox('Instalar sisbr 2.0', key='sisbrinstall', size=(24, 1))],

0 commit comments

Comments
 (0)