2025-06-01 18:42:59 -03:00

132 lines
5.3 KiB
Plaintext

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Indetectables Toolkit Extras: VBDEC"
#define MyAppNameOriginal "Indetectables Toolkit"
#define MyAppVersion "RELEASE"
#define MyAppPublisher "Indetectables"
#define MyAppURL "https://www.indetectables.net/"
#define MyAppToolsFolder "{app}\toolkit"
#define MyAppBinsFolder "{app}\bin"
#define MyAppToolsIconsFolder "{app}\assets\icons"
#define MySrcDir "C:\code\toolkit"
#define MyOutputDir "C:\code"
[Setup]
AppId={{F5B3F1E3-74D3-4F18-B939-2BEF8AD5A9EF}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
VersionInfoVersion={#MyAppVersion}
AppVerName={#MyAppName} - {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={sd}\{#MyAppNameOriginal}
DefaultGroupName={#MyAppNameOriginal}
PrivilegesRequired=admin
;PrivilegesRequiredOverridesAllowed=dialog
OutputBaseFilename=extras-{#MyAppVersion}-vbdec
Compression=lzma2/max
SolidCompression=yes
WizardStyle=modern
ArchitecturesInstallIn64BitMode=x64
SetupIconFile="{#MySrcDir}\extras\vbdec\installer\icon.ico"
OutputDir={#MyOutputDir}
Uninstallable=no
DirExistsWarning=no
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
[CustomMessages]
english.FolderValidationError=The toolkit was not found in the selected folder. You must install it before you can continue.
spanish.FolderValidationError=No se ha encontrado el kit de herramientas en la carpeta seleccionada. Debe instalarlo antes de continuar.
catalan.FolderValidationError=El conjunt d'eines no s'ha trobat a la carpeta seleccionada. Heu d'instal·lar-lo abans de poder continuar.
portuguese.FolderValidationError=O conjunto de ferramentas não foi encontrado na pasta seleccionada. Deve ser instalado antes de poder continuar.
[Components]
Name: "vbdec"; Description: "Install VBDEC via Updater"; ExtraDiskSpaceRequired: 996147200; Types: full compact custom; Flags: fixed;
[Components]
Name: "updater"; Description: "Tools auto updater"; Types: full compact custom; Flags: fixed;
; Updater
[Components]
Name: "updater\main"; Description: "Updater"; Types: full compact custom; Flags: fixed;
[Files]
Source: "{#MySrcDir}\bin\updater\*"; DestDir: "{#MyAppBinsFolder}\updater"; Components: "updater\main"; Flags: ignoreversion recursesubdirs createallsubdirs; BeforeInstall: BeforeInstallScript;
Source: "{#MySrcDir}\bin\hstart\*"; Destdir: "{#MyAppBinsFolder}\hstart\"; Components: "updater\main"; Flags: ignoreversion recursesubdirs createallsubdirs;
[Icons]
Name: "{group}\Toolkit Updater"; Filename: "{#MyAppBinsFolder}\updater\updater.exe"; WorkingDir: "{#MyAppBinsFolder}\updater"; Components: "updater\main";
Name: "{userdesktop}\{#MyAppNameOriginal}\Toolkit Updater"; Filename: "{#MyAppBinsFolder}\updater\updater.exe"; WorkingDir: "{#MyAppBinsFolder}\updater"; Components: "updater\main";
; Fix default update config
[INI]
Filename: {#MyAppBinsFolder}\updater\tools.ini; Section: UpdaterConfig; Key: disable_clean; String: True; Components: "updater\main";
Filename: {#MyAppBinsFolder}\updater\tools.ini; Section: UpdaterConfig; Key: disable_repack; String: True; Components: "updater\main";
;;; etc
;;;;;;;;;;;;;;;;;;;;;;;;
[Run]
; Install VBDEC in toolkit
Filename: "{#MyAppBinsFolder}\updater\updater.exe"; Parameters: "-f -u VBDEC -dic -dsu"; Flags: shellexec waituntilterminated;
; Setup VBDEC components
Filename: "{#MyAppToolsFolder}\Decompilers\[VB] VBDEC\VBDEC-register.bat"; Parameters: ""; Flags: shellexec waituntilterminated;
; Configure installed tools in updater
Filename: "{#MyAppBinsFolder}\updater\bin\auto-config-ini.exe"; Parameters: "/FOLDER={#MyAppBinsFolder}\updater /TYPE=clean"; Flags: runhidden;
; Sync tools versions
Filename: "{#MyAppBinsFolder}\updater\bin\auto-config-ini.exe"; Parameters: "/FOLDER={#MyAppBinsFolder}\updater /TYPE=sync"; Flags: runhidden;
; Create all links
[Icons]
Name: "{group}\[VB] VBDEC"; Filename: "{#MyAppToolsFolder}\Decompilers\[VB] VBDEC\vbdec.exe"; WorkingDir: "{#MyAppToolsFolder}\Decompilers\[VB] VBDEC";
Name: "{#MyAppBinsFolder}\sendto\sendto\Decompilers\[VB] VBDEC"; Filename: "{#MyAppToolsFolder}\Decompilers\[VB] VBDEC\vbdec.exe"; WorkingDir: "{#MyAppToolsFolder}\Decompilers\[VB] VBDEC";
; Custom installer checks and scripts
[code]
function GetFileName(const FileName: string): string;
begin
Result := ExpandConstant('{#MyAppBinsFolder}\updater\' + FileName);
end;
procedure BeforeInstallScript();
begin
if FileExists(GetFileName('tools.ini')) then
begin
RenameFile(GetFileName('tools.ini'), GetFileName('tools.ini.old'));
end;
end;
function NextButtonClick(PageId: Integer): Boolean;
begin
Result := True;
if (PageId = wpSelectDir) and not FileExists(ExpandConstant('{app}\CHANGELOG.md')) then
begin
MsgBox(ExpandConstant('{cm:FolderValidationError}'), mbError, MB_OK);
Result := False;
exit;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if (CurStep = ssDone) and FileExists(GetFileName('tools.ini.old')) then
begin
DeleteFile(GetFileName('tools.ini.old'));
end;
end;