diff --git a/.github/workflows/builder-extras.yml b/.github/workflows/builder-extras.yml index 3dcd8b8..cd4a4ec 100644 --- a/.github/workflows/builder-extras.yml +++ b/.github/workflows/builder-extras.yml @@ -110,6 +110,34 @@ jobs: working-directory: ${{ env.EXTRAS_PATH }}/unpacking/installer run: ISCC.exe setup.iss + + ##---------------- + ## Build VBDEC + ##---------------- + - name: Update Unpacking installer .iss config paths + working-directory: ${{ env.EXTRAS_PATH }}/vbdec/installer + shell: bash + run: | + WORKSPACE_BUILD_PATH=$(echo "${{ github.workspace }}" | tr '\\' '/') + WORKSPACE_SRC_PATH=$(echo "${{ env.SRC_PATH }}" | tr '\\' '/') + sed -i "s|C:\\\\code\\\\toolkit|$WORKSPACE_SRC_PATH|g" setup.iss + sed -i "s|C:\\\\code|$WORKSPACE_BUILD_PATH|g" setup.iss + + - name: Update version number in Unpacking installer .iss + working-directory: ${{ env.EXTRAS_PATH }}/vbdec/installer + shell: bash + run: | + VERSION_CODE=$(date +'%Y.%m') + sed -i 's/RELEASE/'"$VERSION_CODE"'/g' setup.iss + + - name: Build Unpacking installer + working-directory: ${{ env.EXTRAS_PATH }}/vbdec/installer + run: ISCC.exe setup.iss + + + ##---------------- + ## Generate report and upload all + ##---------------- - name: Generate checksums report working-directory: ${{ env.INSTALLER_SCRIPT_PATH }} run: | diff --git a/extras/vbdec/installer/icon.ico b/extras/vbdec/installer/icon.ico new file mode 100644 index 0000000..ced7cd0 Binary files /dev/null and b/extras/vbdec/installer/icon.ico differ diff --git a/extras/vbdec/installer/setup.iss b/extras/vbdec/installer/setup.iss new file mode 100644 index 0000000..53d09ef --- /dev/null +++ b/extras/vbdec/installer/setup.iss @@ -0,0 +1,131 @@ +; 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 runasadmin; + +; 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;