View Single Post
  #5  
Old 29-07-2016, 10:39
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,749
Thanks: 2,170
Thanked 11,206 Times in 2,307 Posts
Razor12911 is on a distinguished road
Well then you're gonna have to do all that without Freearc, first encode the audio then include the final output in archive along with other non encoded files in any.

If the files you encoded need decoding for them to work with whatever application is using them then you simply unpack the archive like you unpack other archives.

This is what you should do. (Using ogg example)
Encode all files, keep file list of encoded audio then everything with Freearc.

Then in inno setup. Add this.

if FileExists(ExpandConstant('{app}\ogg.ini')) and (ISDoneError = False) then
begin
Wizardform.ProgressGauge.Max:=0;
i:=1;
repeat
if FileExists(AddBackSlash(ExpandConstant('{app}')) + GetIniString('OggDecode','Ogg' + IntToStr(i),'',ExpandConstant('{app}\ogg.ini'))) then
Wizardform.ProgressGauge.Max:= Wizardform.ProgressGauge.Max + 1;
i:= i + 1;
until GetIniString('OggDecode','Ogg' + IntToStr(i),'',ExpandConstant('{app}\ogg.ini')) = '';
WizardForm.ProgressGauge.Position:=0;
i:=1;
repeat
OggFile:=AddBackSlash(ExpandConstant('{app}')) + GetIniString('OggDecode','Ogg' + IntToStr(i),'',ExpandConstant('{app}\ogg.ini'));
ProgressLabels(GetMessage(3,'',''),OggFile);
Exec(ExpandConstant('{tmp}\oggdec.exe'), '"' + OggFile + '"' + ' ' + '-w"' + OggFile + '_"', '',SW_HIDE, ewWaitUntilTerminated, MsgResult);
RenameFile(OggFile + '_',OggFile);
if FileExists(AddBackSlash(ExpandConstant('{app}')) + GetIniString('OggDecode','Ogg' + IntToStr(i),'',ExpandConstant('{app}\ogg.ini'))) then
WizardForm.ProgressGauge.Position:= WizardForm.ProgressGauge.Position + 1;
i:= i + 1;
until (GetIniString('OggDecode','Ogg' + IntToStr(i),'',ExpandConstant('{app}\ogg.ini')) = '') or ISDoneError = True;
DeleteFile(ExpandConstant('{app}\ogg.ini'));
end;

Take note, this is just an example, you obviously have to do a bit of modification for it to work for your script.
Ogg.ini is the file in this case chosen to have list of files, unfortunately for this to work very well for you, it's either you write this ini configuration format or maybe learn a bit of delphi to be able to use TStringList to be able to use the non configuration approach. Done.

The configuation looks like this.

[OggDecode]
Ogg1=myogg1.ogg
Ogg2=game\encoded.ogg
....
Reply With Quote
The Following 2 Users Say Thank You to Razor12911 For This Useful Post:
averanted (29-07-2016), RamiroCruzo (29-07-2016)