Compare commits
2 Commits
00a789c410
...
9cd6d13ca3
| Author | SHA1 | Date |
|---|---|---|
|
|
9cd6d13ca3 | 2 months ago |
|
|
538245279e | 2 months ago |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,88 +0,0 @@
|
||||
import os
|
||||
import urllib.request
|
||||
import shutil
|
||||
from pymxs import runtime as rt
|
||||
|
||||
# ==========================================
|
||||
# CONFIGURAÇÕES DO GITEA - IMMERSE GAMES
|
||||
# ==========================================
|
||||
GITEA_RAW_URL = "https://git.immersegame.com/vr4life_public/vr4life-3dmax-plugin/raw/branch/main/"
|
||||
GITEA_TOKEN = "3831a0da2f87e391f41f4649d48498136a1903c9"
|
||||
|
||||
# Caminho onde os scripts são instalados (Documentos)
|
||||
user_scripts_dir = rt.getDir(rt.name("userScripts"))
|
||||
PLUGIN_DIR = os.path.join(user_scripts_dir, "VR4Life_Plugin").replace("\\", "/")
|
||||
|
||||
FILES_TO_DOWNLOAD = [
|
||||
"vr4life_ui.py",
|
||||
"vr4life_engine.py",
|
||||
"vr4life_cloud.py",
|
||||
"run_vr4life.py",
|
||||
"vr4life_updater.py",
|
||||
"install_vr4life.py",
|
||||
"vr4life.mnx",
|
||||
"version.txt"
|
||||
]
|
||||
|
||||
def install_from_cloud():
|
||||
rt.clearListener()
|
||||
print("=== DEBUG DE CAMINHOS VR4LIFE ===")
|
||||
print(f"Diretório de destino dos Pythons: {PLUGIN_DIR}")
|
||||
|
||||
if not os.path.exists(PLUGIN_DIR):
|
||||
os.makedirs(PLUGIN_DIR)
|
||||
|
||||
try:
|
||||
for file_name in FILES_TO_DOWNLOAD:
|
||||
remote_url = f"{GITEA_RAW_URL}{file_name}?token={GITEA_TOKEN}"
|
||||
local_path = os.path.join(PLUGIN_DIR, file_name).replace("\\", "/")
|
||||
|
||||
req = urllib.request.Request(remote_url)
|
||||
req.add_header("Authorization", "token " + GITEA_TOKEN)
|
||||
response = urllib.request.urlopen(req)
|
||||
|
||||
if file_name.endswith(".mnx"):
|
||||
with open(local_path, "wb") as f:
|
||||
f.write(response.read())
|
||||
print(f"MNX baixado para: {local_path}")
|
||||
else:
|
||||
remote_code = response.read().decode('utf-8')
|
||||
with open(local_path, "w", encoding="utf-8") as f:
|
||||
f.write(remote_code)
|
||||
print(f"Script baixado para: {local_path}")
|
||||
|
||||
# --- INSTALAÇÃO DO MENU ---
|
||||
pasta_macros = rt.pathConfig.getDir(rt.name("userMacros"))
|
||||
pasta_enu = os.path.dirname(pasta_macros)
|
||||
pasta_ui_usuario = os.path.join(pasta_enu, "en-US", "UI")
|
||||
|
||||
if not os.path.exists(pasta_ui_usuario):
|
||||
os.makedirs(pasta_ui_usuario)
|
||||
|
||||
# AGORA GARANTIMOS QUE O PATH DE ORIGEM É O PLUGIN_DIR
|
||||
origem_mnx = os.path.join(PLUGIN_DIR, "vr4life.mnx")
|
||||
destino_mnx = os.path.join(pasta_ui_usuario, "vr4life.mnx")
|
||||
|
||||
print(f"Tentando copiar MNX da origem: {origem_mnx}")
|
||||
print(f"Para o destino final: {destino_mnx}")
|
||||
|
||||
if os.path.exists(origem_mnx):
|
||||
shutil.copy2(origem_mnx, destino_mnx)
|
||||
print(">>> Cópia do MNX realizada com sucesso!")
|
||||
else:
|
||||
print("!!! ERRO: O arquivo vr4life.mnx não foi encontrado na pasta PLUGIN_DIR após o download.")
|
||||
|
||||
# Executa o instalador local
|
||||
install_script = os.path.join(PLUGIN_DIR, "install_vr4life.py").replace("\\", "/")
|
||||
if os.path.exists(install_script):
|
||||
print(f"Executando script de instalação: {install_script}")
|
||||
rt.python.ExecuteFile(install_script)
|
||||
|
||||
rt.messageBox("Instalação Online concluída. Verifique o Listener para o log de caminhos.", title="VR4Life")
|
||||
|
||||
except Exception as e:
|
||||
print(f"ERRO TÉCNICO: {str(e)}")
|
||||
rt.messageBox(f"Falha na instalação: {str(e)}", title="Erro")
|
||||
|
||||
if __name__ == "__main__":
|
||||
install_from_cloud()
|
||||
@ -1,7 +0,0 @@
|
||||
name "Instalador VR4Life"
|
||||
version 1.0
|
||||
|
||||
extract to "$temp\VR4Life_Install"
|
||||
|
||||
run "run_installer.ms"
|
||||
drop "run_installer.ms"
|
||||
@ -1 +0,0 @@
|
||||
python.executeFile (getDir #temp + @"\VR4Life_Install\Instalador_Online_VR4Life.py")
|
||||
Binary file not shown.
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<MaxMenuTransformations>
|
||||
<CreateTopLevelMenu Id="167d260c-f391-4e63-b6a9-4798fbfcadc5" Title="Vr4Life"/>
|
||||
<CreateMenuAction MenuId="167d260c-f391-4e63-b6a9-4798fbfcadc5" Id="a37d867e-3d05-4859-9a55-70cd394c8e72" ActionId="647394-VR4Life_Launcher`Immerse Games"/>
|
||||
<CreateMenuAction MenuId="167d260c-f391-4e63-b6a9-4798fbfcadc5" Id="8df661bf-5425-4fbf-9ee3-ac14cd067b0c" ActionId="647394-VR4Life_Launcher`Immerse Games"/>
|
||||
<DeleteItem Id="8df661bf-5425-4fbf-9ee3-ac14cd067b0c"/>
|
||||
<DeleteItem Id="a37d867e-3d05-4859-9a55-70cd394c8e72"/>
|
||||
<CreateMenuAction MenuId="167d260c-f391-4e63-b6a9-4798fbfcadc5" Id="d66e56ef-ecf4-4758-923e-b7ce929e440c" ActionId="647394-VR4Life_Launcher`Immerse Games"/>
|
||||
<CreateMenuAction MenuId="167d260c-f391-4e63-b6a9-4798fbfcadc5" Id="071a64d3-3fe9-4674-b58a-b5e3047e3109" ActionId="647394-VR4Life_Update`Immerse Games"/>
|
||||
</MaxMenuTransformations>
|
||||
Loading…
Reference in New Issue