Add files via upload

This commit is contained in:
Iván Eduardo Chavez Ayub
2025-07-20 03:43:36 -06:00
committed by GitHub
parent 142cc69c9e
commit 3cc06d905e
7 changed files with 656 additions and 127 deletions
+87 -18
View File
@@ -1,13 +1,17 @@
; ===================================================================
; Warlock-Studio 3.0- Inno Setup Script
; Warlock-Studio 4.0 - Inno Setup Script with Online Download
; ===================================================================
#define AppName "Warlock-Studio"
#define AppVersion "3.0"
#define AppVersion "4.0"
#define AppPublisher "Iván Eduardo Chavez Ayub"
#define AppURL "https://github.com/Ivan-Ayub97/Warlock-Studio"
#define AppExeName "Warlock-Studio.exe"
; URLs para descargar los componentes AI (ajustar según tu servidor)
#define AIModelsURL "https://github.com/Ivan-Ayub97/Warlock-Studio/releases/download/3.0.1/AI-onnx.zip"
#define AIModelsSize "327000000" ; Tamaño aproximado en bytes
[Setup]
; --- Configuración Básica ---
AppName={#AppName}
@@ -25,50 +29,115 @@ ArchitecturesInstallIn64BitMode=x64
OutputDir=Output
OutputBaseFilename=Warlock-Studio-{#AppVersion}-Installer
SetupIconFile=..\Warlock-Studio\logo.ico
Compression=lzma2
Compression=lzma2/max
SolidCompression=yes
WizardStyle=modern
; --- Imágenes del Asistente ---
; NOTA: Asegúrate de que las rutas relativas sean correctas desde la ubicación de este script.
WizardImageFile=..\Warlock-Studio\Assets\wizard-image.bmp
WizardSmallImageFile=..\Warlock-Studio\Assets\wizard-small.bmp
UninstallDisplayIcon={app}\{#AppExeName}
; CORRECTO: LicenseFile se define ahora en la sección [Languages]
; para que cada idioma muestre su propia licencia.
[Languages]
; --- Definición de Idiomas y Licencias ---
; NOTA: Asegúrate de tener los archivos de licencia en la ruta especificada.
Name: "english"; MessagesFile: "compiler:Default.isl"; LicenseFile: "..\Warlock-Studio\License.txt"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "downloadai"; Description: "Download AI Models (Required - 327MB)"; GroupDescription: "Components"; Flags: checkedonce
[Files]
; --- Archivos de la Aplicación ---
; NOTA: La estructura de carpetas asumida es:
; - Proyecto/
; - InnoSetup_Script/ (Aquí va este archivo .iss)
; - Warlock-Studio/ (Aquí van los archivos de la aplicación)
; --- Archivos Básicos de la Aplicación (SIN AI-onnx) ---
Source: "..\Warlock-Studio\{#AppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Warlock-Studio\logo.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Warlock-Studio\AI-onnx\*"; DestDir: "{app}\AI-onnx"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\Warlock-Studio\Assets\*"; DestDir: "{app}\Assets"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\Warlock-Studio\LICENSE"; DestDir: "{app}"; DestName: "License.txt"; Flags: ignoreversion
Source: "..\Warlock-Studio\NOTICE.md"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
; --- Accesos Directos ---
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"; IconFilename: "{app}\logo.ico"; WorkingDir: "{app}"
Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; IconFilename: "{app}\logo.ico"; WorkingDir: "{app}"; Tasks: desktopicon
[Code]
var
DownloadPage: TDownloadWizardPage;
function OnDownloadProgress(const Url, FileName: String; const Progress, ProgressMax: Int64): Boolean;
begin
if Progress = ProgressMax then
Log(Format('Successfully downloaded %s', [FileName]));
Result := True;
end;
procedure InitializeWizard;
begin
// Create the pages
DownloadPage := CreateDownloadPage(SetupMessage(msgWizardPreparing), SetupMessage(msgPreparingDesc), @OnDownloadProgress);
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
if CurPageID = wpReady then begin
if IsTaskSelected('downloadai') then begin
DownloadPage.Clear;
DownloadPage.Add('{#AIModelsURL}', 'AI-onnx.zip', '');
DownloadPage.Show;
try
try
DownloadPage.Download; // This downloads the file(s)
Result := True;
except
if DownloadPage.AbortedByUser then
Log('Aborted by user.')
else
SuppressibleMsgBox(AddPeriod(GetExceptionMessage), mbCriticalError, MB_OK, IDOK);
Result := False;
end;
finally
DownloadPage.Hide;
end;
end else
Result := True;
end else
Result := True;
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
ZipPath, ExtractPath: String;
ResultCode: Integer;
begin
if CurStep = ssPostInstall then begin
if IsTaskSelected('downloadai') then begin
// Extraer el archivo ZIP descargado
ZipPath := ExpandConstant('{tmp}\AI-onnx.zip');
ExtractPath := ExpandConstant('{app}\AI-onnx');
if FileExists(ZipPath) then begin
// Crear carpeta destino
CreateDir(ExtractPath);
// Extraer usando PowerShell (disponible en Windows 10+)
if Exec('powershell.exe',
'-Command "Expand-Archive -Path ''' + ZipPath + ''' -DestinationPath ''' + ExtractPath + ''' -Force"',
'', SW_HIDE, ewWaitUntilTerminated, ResultCode) then begin
Log('AI models extracted successfully');
DeleteFile(ZipPath); // Limpiar archivo temporal
end else begin
MsgBox('Error extracting AI models. Please download manually from: ' + '{#AIModelsURL}',
mbError, MB_OK);
end;
end;
end;
end;
end;
[Run]
Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[UninstallDelete]
; --- Limpieza Adicional Durante la Desinstalación ---
Type: filesandordirs; Name: "{app}\AI-onnx"
Type: filesandordirs; Name: "{app}\Assets"
Type: filesandordirs; Name: "{app}\Assets"
[Messages]
english.BeveledLabel=AI Models will be downloaded during installation (327MB)