I currently have a basic installer that takes an input folder and compresses all the files using lzma2/ultra64, but the file size is obvously pretty large. So now I have split FA archives that were compressed using xprecomp+srep+lolz, but I can't seem to figure out how to unpack them in my script. Any guidance on what I should add to my script to get it working would be much appreciated. Script is below
code_language.pascal:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define public Dependency_NoExampleSetup
#include "CodeDependencies.iss"
#define MyAppName "Far Cry 4 Gold Edition"
#define MyAppVersion "1.10.0"
#define MyAppPublisher "Ubisoft"
#define MyAppURL "http://ubisoft.com/"
#define MyAppExeName "FarCry4.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{4AC919CF-E54D-48E4-9B19-99F1BD14EB0A}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName=C:\Games\{#MyAppName}
DisableProgramGroupPage=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputBaseFilename=setup
SetupIconFile=C:\Users\Chris\Desktop\Repacking\inno-projects\fc4\inno\icon.ico
Compression=lzma2/ultra64
LZMAUseSeparateProcess=yes
LZMANumBlockThreads=6
LZMADictionarySize=100000
LZMANumFastBytes=273
SolidCompression=no
DiskSpanning=yes
DiskSliceSize=max
WizardStyle=modern
SetupLogging=no
DisableWelcomePage=no
UninstallDisplayName=Far Cry 4 Gold Edition
UninstallDisplayIcon={app}\bin\FarCry4.exe
WizardImageFile=C:\Users\Chris\Desktop\Repacking\inno-projects\fc4\inno\banner.bmp
WizardSmallImageFile=C:\Users\Chris\Desktop\Repacking\inno-projects\fc4\inno\small.bmp
[Messages]
// define wizard title and tray status msg
// both are normally defined in innosetup's default.isl (install folder)
SetupAppTitle = Far Cry 4 Gold Edition Installer
SetupWindowTitle = Far Cry 4 Gold Edition Installer
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\Users\Chris\Desktop\Repacking\inno-projects\fc4\files\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs;
Source: "C:\Users\Chris\Desktop\Repacking\inno-projects\fc4\inno\bass.dll"; Flags: dontcopy
Source: "C:\Users\Chris\Desktop\Repacking\inno-projects\fc4\inno\music.mp3"; Flags: dontcopy
Source: "C:\Users\Chris\Desktop\Repacking\inno-projects\fc4\inno\dxwebsetup.exe"; Flags: dontcopy noencryption
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{autoprograms}\Far Cry 4\Far Cry 4"; Filename: "{app}\bin\{#MyAppExeName}";
Name: "{autodesktop}\Far Cry 4"; Filename: "{app}\bin\{#MyAppExeName}"; Tasks: desktopicon;
Name: "{autoprograms}\Far Cry 4\Far Cry 4 Editor"; Filename: "{app}\bin\IGE_WPF64.exe";
[CustomMessages]
SoundCtrlButtonCaptionSoundOn=Unmute
SoundCtrlButtonCaptionSoundOff=Mute
[Code]
const
BASS_SAMPLE_LOOP = 4;
BASS_ACTIVE_STOPPED = 0;
BASS_ACTIVE_PLAYING = 1;
BASS_ACTIVE_STALLED = 2;
BASS_ACTIVE_PAUSED = 3;
BASS_UNICODE = $80000000;
BASS_CONFIG_GVOL_STREAM = 5;
const
#ifndef UNICODE
EncodingFlag = 0;
#else
EncodingFlag = BASS_UNICODE;
#endif
type
HSTREAM = DWORD;
function BASS_Init(device: LongInt; freq, flags: DWORD;
win: HWND; clsid: Cardinal): BOOL;
external 'BASS_Init@files:bass.dll stdcall';
function BASS_Start: BOOL;
external 'BASS_Start@files:bass.dll stdcall';
function BASS_Pause: BOOL;
external 'BASS_Pause@files:bass.dll stdcall';
function BASS_ChannelPlay(handle: DWORD; restart: BOOL): BOOL;
external 'BASS_ChannelPlay@files:bass.dll stdcall';
function BASS_SetConfig(option: DWORD; value: DWORD ): BOOL;
external 'BASS_SetConfig@files:bass.dll stdcall';
function BASS_ChannelIsActive(handle: DWORD): DWORD;
external 'BASS_ChannelIsActive@files:bass.dll stdcall';
function BASS_Free: BOOL;
external 'BASS_Free@files:bass.dll stdcall';
function BASS_ErrorGetCode(): Integer;
external 'BASS_ErrorGetCode@files:bass.dll stdcall';
function BASS_StreamCreateFile(mem: BOOL; f: string; offset1: DWORD;
offset2: DWORD; length1: DWORD; length2: DWORD; flags: DWORD): HSTREAM;
external 'BASS_StreamCreateFile@files:bass.dll stdcall';
var
SoundStream: HSTREAM;
SoundCtrlButton: TNewButton;
procedure SoundCtrlButtonClick(Sender: TObject);
begin
case BASS_ChannelIsActive(SoundStream) of
BASS_ACTIVE_PLAYING:
begin
if BASS_Pause then
SoundCtrlButton.Caption :=
ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOn}');
end;
BASS_ACTIVE_PAUSED:
begin
if BASS_Start then
SoundCtrlButton.Caption :=
ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOff}');
end;
end;
end;
procedure InitializeWizard;
begin
ExtractTemporaryFile('music.mp3');
if BASS_Init(-1, 44100, 0, 0, 0) then
begin
SoundStream := BASS_StreamCreateFile(False,
ExpandConstant('{tmp}\music.mp3'), 0, 0, 0, 0,
EncodingFlag or BASS_SAMPLE_LOOP);
if SoundStream = 0 then
begin
Log(Format('Error playing file, error code = %d', [BASS_ErrorGetCode]));
end;
BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, 2500);
BASS_ChannelPlay(SoundStream, False);
SoundCtrlButton := TNewButton.Create(WizardForm);
SoundCtrlButton.Parent := WizardForm;
SoundCtrlButton.Left :=
WizardForm.OuterNotebook.Left + WizardForm.InnerNotebook.Left;
SoundCtrlButton.Top := WizardForm.NextButton.Top;
SoundCtrlButton.Anchors := [akLeft, akBottom];
SoundCtrlButton.Width := WizardForm.NextButton.Width;
SoundCtrlButton.Height := WizardForm.NextButton.Height;
SoundCtrlButton.Caption :=
ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOff}');
SoundCtrlButton.OnClick := @SoundCtrlButtonClick;
end;
end;
procedure DeinitializeSetup;
begin
BASS_Free;
end;
function InitializeSetup: Boolean;
begin
// add the dependencies you need
Dependency_AddDotNet40;
Dependency_AddVC2008;
Dependency_AddVC2010;
ExtractTemporaryFile('dxwebsetup.exe');
Dependency_AddDirectX;
// ...
Result := True;
end;
[Run]
Filename: "{app}\bin\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent